// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "connectionSettings.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 { RequestConnectionHeader } from "./shared";
/**
 * @generated from protobuf message api.ConnectionSettings
 */
export interface ConnectionSettings {
    /**
     * @generated from protobuf field: string connectionID = 1;
     */
    connectionID: string;
    /**
     * @generated from protobuf field: string settings = 2;
     */
    settings: string;
}
/**
 * @generated from protobuf message api.PutConnectionSettingsRequest
 */
export interface PutConnectionSettingsRequest {
    /**
     * @generated from protobuf field: api.RequestConnectionHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestConnectionHeader;
    /**
     * @generated from protobuf field: map<string, string> settings = 2;
     */
    settings: {
        [key: string]: string;
    };
}
/**
 * @generated from protobuf message api.PutConnectionSettingsResult
 */
export interface PutConnectionSettingsResult {
    /**
     * @generated from protobuf field: string settings = 1;
     */
    settings: string;
}
/**
 * Settings of the connection to get
 *
 * @generated from protobuf message api.GetConnectionSettingsRequest
 */
export interface GetConnectionSettingsRequest {
    /**
     * @generated from protobuf field: api.RequestConnectionHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestConnectionHeader;
}
/**
 * @generated from protobuf message api.GetConnectionSettingsResult
 */
export interface GetConnectionSettingsResult {
    /**
     * @generated from protobuf field: string settings = 1;
     */
    settings: string;
}
/**
 * ConnectionID of the settings to delete
 *
 * @generated from protobuf message api.DeleteConnectionSettingsRequest
 */
export interface DeleteConnectionSettingsRequest {
    /**
     * @generated from protobuf field: api.RequestConnectionHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestConnectionHeader;
}
/**
 * @generated from protobuf message api.DeleteConnectionSettingsResult
 */
export interface DeleteConnectionSettingsResult {
}
// @generated message type with reflection information, may provide speed optimized methods
class ConnectionSettings$Type extends MessageType<ConnectionSettings> {
    constructor() {
        super("api.ConnectionSettings", [
            { no: 1, name: "connectionID", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "settings", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<ConnectionSettings>): ConnectionSettings {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.connectionID = "";
        message.settings = "";
        if (value !== undefined)
            reflectionMergePartial<ConnectionSettings>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectionSettings): ConnectionSettings {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string connectionID */ 1:
                    message.connectionID = reader.string();
                    break;
                case /* string settings */ 2:
                    message.settings = 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: ConnectionSettings, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string connectionID = 1; */
        if (message.connectionID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.connectionID);
        /* string settings = 2; */
        if (message.settings !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.settings);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ConnectionSettings
 */
export const ConnectionSettings = new ConnectionSettings$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PutConnectionSettingsRequest$Type extends MessageType<PutConnectionSettingsRequest> {
    constructor() {
        super("api.PutConnectionSettingsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestConnectionHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "settings", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ }, options: { "validate.rules": { map: { minPairs: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "settings: at least one pair of \"key: value\" needed" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Settings of the connection to store", required: ["Header"] } } });
    }
    create(value?: PartialMessage<PutConnectionSettingsRequest>): PutConnectionSettingsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.settings = {};
        if (value !== undefined)
            reflectionMergePartial<PutConnectionSettingsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutConnectionSettingsRequest): PutConnectionSettingsRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestConnectionHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestConnectionHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* map<string, string> settings */ 2:
                    this.binaryReadMap2(message.settings, reader, options);
                    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;
    }
    private binaryReadMap2(map: PutConnectionSettingsRequest["settings"], reader: IBinaryReader, options: BinaryReadOptions): void {
        let len = reader.uint32(), end = reader.pos + len, key: keyof PutConnectionSettingsRequest["settings"] | undefined, val: PutConnectionSettingsRequest["settings"][any] | undefined;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = reader.string();
                    break;
                default: throw new globalThis.Error("unknown map entry field for field api.PutConnectionSettingsRequest.settings");
            }
        }
        map[key ?? ""] = val ?? "";
    }
    internalBinaryWrite(message: PutConnectionSettingsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestConnectionHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestConnectionHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* map<string, string> settings = 2; */
        for (let k of globalThis.Object.keys(message.settings))
            writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.settings[k]).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.PutConnectionSettingsRequest
 */
export const PutConnectionSettingsRequest = new PutConnectionSettingsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PutConnectionSettingsResult$Type extends MessageType<PutConnectionSettingsResult> {
    constructor() {
        super("api.PutConnectionSettingsResult", [
            { no: 1, name: "settings", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Settings response" } } });
    }
    create(value?: PartialMessage<PutConnectionSettingsResult>): PutConnectionSettingsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.settings = "";
        if (value !== undefined)
            reflectionMergePartial<PutConnectionSettingsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutConnectionSettingsResult): PutConnectionSettingsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string settings */ 1:
                    message.settings = 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: PutConnectionSettingsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string settings = 1; */
        if (message.settings !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.settings);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PutConnectionSettingsResult
 */
export const PutConnectionSettingsResult = new PutConnectionSettingsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetConnectionSettingsRequest$Type extends MessageType<GetConnectionSettingsRequest> {
    constructor() {
        super("api.GetConnectionSettingsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestConnectionHeader, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Settings of the connection to get", required: ["Header"] } } });
    }
    create(value?: PartialMessage<GetConnectionSettingsRequest>): GetConnectionSettingsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<GetConnectionSettingsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetConnectionSettingsRequest): GetConnectionSettingsRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestConnectionHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestConnectionHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    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: GetConnectionSettingsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestConnectionHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestConnectionHeader.internalBinaryWrite(message.header, 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.GetConnectionSettingsRequest
 */
export const GetConnectionSettingsRequest = new GetConnectionSettingsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetConnectionSettingsResult$Type extends MessageType<GetConnectionSettingsResult> {
    constructor() {
        super("api.GetConnectionSettingsResult", [
            { no: 1, name: "settings", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Settings response" } } });
    }
    create(value?: PartialMessage<GetConnectionSettingsResult>): GetConnectionSettingsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.settings = "";
        if (value !== undefined)
            reflectionMergePartial<GetConnectionSettingsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetConnectionSettingsResult): GetConnectionSettingsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string settings */ 1:
                    message.settings = 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: GetConnectionSettingsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string settings = 1; */
        if (message.settings !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.settings);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetConnectionSettingsResult
 */
export const GetConnectionSettingsResult = new GetConnectionSettingsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteConnectionSettingsRequest$Type extends MessageType<DeleteConnectionSettingsRequest> {
    constructor() {
        super("api.DeleteConnectionSettingsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestConnectionHeader, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "ConnectionID of the settings to delete", required: ["Header"] } } });
    }
    create(value?: PartialMessage<DeleteConnectionSettingsRequest>): DeleteConnectionSettingsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteConnectionSettingsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteConnectionSettingsRequest): DeleteConnectionSettingsRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestConnectionHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestConnectionHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    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: DeleteConnectionSettingsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestConnectionHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestConnectionHeader.internalBinaryWrite(message.header, 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.DeleteConnectionSettingsRequest
 */
export const DeleteConnectionSettingsRequest = new DeleteConnectionSettingsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteConnectionSettingsResult$Type extends MessageType<DeleteConnectionSettingsResult> {
    constructor() {
        super("api.DeleteConnectionSettingsResult", []);
    }
    create(value?: PartialMessage<DeleteConnectionSettingsResult>): DeleteConnectionSettingsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteConnectionSettingsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteConnectionSettingsResult): DeleteConnectionSettingsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                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: DeleteConnectionSettingsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteConnectionSettingsResult
 */
export const DeleteConnectionSettingsResult = new DeleteConnectionSettingsResult$Type();
/**
 * @generated ServiceType for protobuf service api.ConnectionSettingsService
 */
export const ConnectionSettingsService = new ServiceType("api.ConnectionSettingsService", [
    { name: "Get", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Connection Settings"], description: "Use to get get connection's settings" }, "api.rscType": "Connection", "api.roles": "Platform.Connection-Settings", "google.api.method_visibility": { restriction: "SDK" } }, I: GetConnectionSettingsRequest, O: GetConnectionSettingsResult },
    { name: "Put", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Connection Settings"], description: "Use to create or update connection's settings" }, "api.rscType": "Connection", "api.roles": "Platform.Connection-Settings", "google.api.method_visibility": { restriction: "SDK" } }, I: PutConnectionSettingsRequest, O: PutConnectionSettingsResult },
    { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Connection Settings"], description: "Use to delete connection's settings" }, "api.rscType": "Connection", "api.roles": "Platform.Connection-Settings", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteConnectionSettingsRequest, O: DeleteConnectionSettingsResult }
], { "api.k8sService": "organisation-server", "api.roleManager": true, "api.resourceManager": true });
