// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "client.proto" (package "api", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { RequestOrganisationHeader } from "./shared";
/**
 * @generated from protobuf message api.OpenIDClient
 */
export interface OpenIDClient {
    /**
     * @generated from protobuf field: string AppName = 1 [json_name = "AppName"];
     */
    appName: string;
    /**
     * @generated from protobuf field: string DisplayName = 2 [json_name = "DisplayName"];
     */
    displayName: string;
    /**
     * @generated from protobuf field: string RootURI = 3 [json_name = "RootURI"];
     */
    rootURI: string;
    /**
     * @generated from protobuf field: repeated string RedirectURIs = 4 [json_name = "RedirectURIs"];
     */
    redirectURIs: string[];
    /**
     * @generated from protobuf field: string Description = 5 [json_name = "Description"];
     */
    description: string;
}
/**
 * @generated from protobuf message api.RegisterPlatformClientRequest
 */
export interface RegisterPlatformClientRequest {
    /**
     * @generated from protobuf field: api.OpenIDClient Client = 1 [json_name = "Client"];
     */
    client?: OpenIDClient;
}
/**
 * @generated from protobuf message api.RegisterClientRequest
 */
export interface RegisterClientRequest {
    /**
     * @generated from protobuf field: api.RequestOrganisationHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestOrganisationHeader;
    /**
     * @generated from protobuf field: api.OpenIDClient Client = 2 [json_name = "Client"];
     */
    client?: OpenIDClient;
}
/**
 * @generated from protobuf message api.RegisterClientResult
 */
export interface RegisterClientResult {
    /**
     * @generated from protobuf field: string ClientID = 1 [json_name = "ClientID"];
     */
    clientID: string;
}
// @generated message type with reflection information, may provide speed optimized methods
class OpenIDClient$Type extends MessageType<OpenIDClient> {
    constructor() {
        super("api.OpenIDClient", [
            { no: 1, name: "AppName", kind: "scalar", jsonName: "AppName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", pattern: "^[a-z]+$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The application name must be lowercase and can only contain letters and numbers. It must be unique within the organisation.", example: "\"reflexvisibility\"", pattern: "^[a-z]+$" } } },
            { no: 2, name: "DisplayName", kind: "scalar", jsonName: "DisplayName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The display name of the application.", example: "\"Reflex Visibility\"" } } },
            { no: 3, name: "RootURI", kind: "scalar", jsonName: "RootURI", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The root URI of the application.", example: "\"https://localhost\"" } } },
            { no: 4, name: "RedirectURIs", kind: "scalar", jsonName: "RedirectURIs", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The allowed redirect URIs of the application.", example: "\"https://localhost/*\"" } } },
            { no: 5, name: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The description of the application.", example: "\"Reflex Visibility application from Reflex Platform\"" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["AppName", "RootURI", "DisplayName"] } } });
    }
    create(value?: PartialMessage<OpenIDClient>): OpenIDClient {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.appName = "";
        message.displayName = "";
        message.rootURI = "";
        message.redirectURIs = [];
        message.description = "";
        if (value !== undefined)
            reflectionMergePartial<OpenIDClient>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenIDClient): OpenIDClient {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string AppName = 1 [json_name = "AppName"];*/ 1:
                    message.appName = reader.string();
                    break;
                case /* string DisplayName = 2 [json_name = "DisplayName"];*/ 2:
                    message.displayName = reader.string();
                    break;
                case /* string RootURI = 3 [json_name = "RootURI"];*/ 3:
                    message.rootURI = reader.string();
                    break;
                case /* repeated string RedirectURIs = 4 [json_name = "RedirectURIs"];*/ 4:
                    message.redirectURIs.push(reader.string());
                    break;
                case /* string Description = 5 [json_name = "Description"];*/ 5:
                    message.description = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: OpenIDClient, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string AppName = 1 [json_name = "AppName"]; */
        if (message.appName !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.appName);
        /* string DisplayName = 2 [json_name = "DisplayName"]; */
        if (message.displayName !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.displayName);
        /* string RootURI = 3 [json_name = "RootURI"]; */
        if (message.rootURI !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.rootURI);
        /* repeated string RedirectURIs = 4 [json_name = "RedirectURIs"]; */
        for (let i = 0; i < message.redirectURIs.length; i++)
            writer.tag(4, WireType.LengthDelimited).string(message.redirectURIs[i]);
        /* string Description = 5 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.description);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.OpenIDClient
 */
export const OpenIDClient = new OpenIDClient$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RegisterPlatformClientRequest$Type extends MessageType<RegisterPlatformClientRequest> {
    constructor() {
        super("api.RegisterPlatformClientRequest", [
            { no: 1, name: "Client", kind: "message", jsonName: "Client", T: () => OpenIDClient, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Client"] } } });
    }
    create(value?: PartialMessage<RegisterPlatformClientRequest>): RegisterPlatformClientRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<RegisterPlatformClientRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterPlatformClientRequest): RegisterPlatformClientRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.OpenIDClient Client = 1 [json_name = "Client"];*/ 1:
                    message.client = OpenIDClient.internalBinaryRead(reader, reader.uint32(), options, message.client);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: RegisterPlatformClientRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.OpenIDClient Client = 1 [json_name = "Client"]; */
        if (message.client)
            OpenIDClient.internalBinaryWrite(message.client, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RegisterPlatformClientRequest
 */
export const RegisterPlatformClientRequest = new RegisterPlatformClientRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RegisterClientRequest$Type extends MessageType<RegisterClientRequest> {
    constructor() {
        super("api.RegisterClientRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestOrganisationHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "Client", kind: "message", jsonName: "Client", T: () => OpenIDClient, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Client"] } } });
    }
    create(value?: PartialMessage<RegisterClientRequest>): RegisterClientRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<RegisterClientRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterClientRequest): RegisterClientRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestOrganisationHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestOrganisationHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.OpenIDClient Client = 2 [json_name = "Client"];*/ 2:
                    message.client = OpenIDClient.internalBinaryRead(reader, reader.uint32(), options, message.client);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: RegisterClientRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestOrganisationHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestOrganisationHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.OpenIDClient Client = 2 [json_name = "Client"]; */
        if (message.client)
            OpenIDClient.internalBinaryWrite(message.client, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RegisterClientRequest
 */
export const RegisterClientRequest = new RegisterClientRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RegisterClientResult$Type extends MessageType<RegisterClientResult> {
    constructor() {
        super("api.RegisterClientResult", [
            { no: 1, name: "ClientID", kind: "scalar", jsonName: "ClientID", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<RegisterClientResult>): RegisterClientResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.clientID = "";
        if (value !== undefined)
            reflectionMergePartial<RegisterClientResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterClientResult): RegisterClientResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ClientID = 1 [json_name = "ClientID"];*/ 1:
                    message.clientID = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: RegisterClientResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ClientID = 1 [json_name = "ClientID"]; */
        if (message.clientID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.clientID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RegisterClientResult
 */
export const RegisterClientResult = new RegisterClientResult$Type();
/**
 * @generated ServiceType for protobuf service api.ClientService
 */
export const ClientService = new ServiceType("api.ClientService", [
    { name: "RegisterPlatformClient", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["OIDC"], description: "Register a new client for the platform" }, "api.rscType": "Platform", "api.roles": "Platform.Permission", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: RegisterPlatformClientRequest, O: RegisterClientResult },
    { name: "RegisterClient", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["OIDC"], description: "Register a new client for an organisation" }, "api.rscType": "Organisation", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: RegisterClientRequest, O: RegisterClientResult }
], { "api.k8sService": "authorization-server" });
