// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "go-ape.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";
/**
 * @generated from protobuf message api.GoAPEGenerateRequest
 */
export interface GoAPEGenerateRequest {
    /**
     * @generated from protobuf field: string Namespace = 1 [json_name = "Namespace"];
     */
    namespace: string;
    /**
     * @generated from protobuf field: string TemplateName = 2 [json_name = "TemplateName"];
     */
    templateName: string;
    /**
     * @generated from protobuf field: string LanguageCode = 3 [json_name = "LanguageCode"];
     */
    languageCode: string;
    /**
     * @generated from protobuf field: string DataJSON = 4 [json_name = "DataJSON"];
     */
    dataJSON: string;
    /**
     * @generated from protobuf field: api.GoAPEGenerateType OutputFormat = 5 [json_name = "OutputFormat"];
     */
    outputFormat: GoAPEGenerateType;
}
// ===================== 
// ===== Responses =====
// =====================

/**
 * @generated from protobuf message api.GoAPEGenerateResult
 */
export interface GoAPEGenerateResult {
    /**
     * @generated from protobuf field: bytes Result = 1 [json_name = "Result"];
     */
    result: Uint8Array;
}
// ===================== 
// ===== Requests ======
// =====================

/**
 * @generated from protobuf enum api.GoAPEGenerateType
 */
export enum GoAPEGenerateType {
    /**
     * @generated from protobuf enum value: GO_APE_GENERATE_TYPE_TEXT = 0;
     */
    GO_APE_GENERATE_TYPE_TEXT = 0,
    /**
     * @generated from protobuf enum value: GO_APE_GENERATE_TYPE_PDF = 1;
     */
    GO_APE_GENERATE_TYPE_PDF = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class GoAPEGenerateRequest$Type extends MessageType<GoAPEGenerateRequest> {
    constructor() {
        super("api.GoAPEGenerateRequest", [
            { no: 1, name: "Namespace", kind: "scalar", jsonName: "Namespace", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Namespace" } } },
            { no: 2, name: "TemplateName", kind: "scalar", jsonName: "TemplateName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Template name" } } },
            { no: 3, name: "LanguageCode", kind: "scalar", jsonName: "LanguageCode", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes'>ISO 639 code</a> message language", example: "\"en\"" } } },
            { no: 4, name: "DataJSON", kind: "scalar", jsonName: "DataJSON", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "JSON data to be passed to the template" } } },
            { no: 5, name: "OutputFormat", kind: "enum", jsonName: "OutputFormat", T: () => ["api.GoAPEGenerateType", GoAPEGenerateType], options: { "validate.rules": { enum: { definedOnly: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Output format" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["TemplateName", "DataJSON", "OutputFormat"] } } });
    }
    create(value?: PartialMessage<GoAPEGenerateRequest>): GoAPEGenerateRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.namespace = "";
        message.templateName = "";
        message.languageCode = "";
        message.dataJSON = "";
        message.outputFormat = 0;
        if (value !== undefined)
            reflectionMergePartial<GoAPEGenerateRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GoAPEGenerateRequest): GoAPEGenerateRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Namespace = 1 [json_name = "Namespace"];*/ 1:
                    message.namespace = reader.string();
                    break;
                case /* string TemplateName = 2 [json_name = "TemplateName"];*/ 2:
                    message.templateName = reader.string();
                    break;
                case /* string LanguageCode = 3 [json_name = "LanguageCode"];*/ 3:
                    message.languageCode = reader.string();
                    break;
                case /* string DataJSON = 4 [json_name = "DataJSON"];*/ 4:
                    message.dataJSON = reader.string();
                    break;
                case /* api.GoAPEGenerateType OutputFormat = 5 [json_name = "OutputFormat"];*/ 5:
                    message.outputFormat = reader.int32();
                    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: GoAPEGenerateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Namespace = 1 [json_name = "Namespace"]; */
        if (message.namespace !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.namespace);
        /* string TemplateName = 2 [json_name = "TemplateName"]; */
        if (message.templateName !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.templateName);
        /* string LanguageCode = 3 [json_name = "LanguageCode"]; */
        if (message.languageCode !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.languageCode);
        /* string DataJSON = 4 [json_name = "DataJSON"]; */
        if (message.dataJSON !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.dataJSON);
        /* api.GoAPEGenerateType OutputFormat = 5 [json_name = "OutputFormat"]; */
        if (message.outputFormat !== 0)
            writer.tag(5, WireType.Varint).int32(message.outputFormat);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GoAPEGenerateRequest
 */
export const GoAPEGenerateRequest = new GoAPEGenerateRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GoAPEGenerateResult$Type extends MessageType<GoAPEGenerateResult> {
    constructor() {
        super("api.GoAPEGenerateResult", [
            { no: 1, name: "Result", kind: "scalar", jsonName: "Result", T: 12 /*ScalarType.BYTES*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Result" } } }
        ]);
    }
    create(value?: PartialMessage<GoAPEGenerateResult>): GoAPEGenerateResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.result = new Uint8Array(0);
        if (value !== undefined)
            reflectionMergePartial<GoAPEGenerateResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GoAPEGenerateResult): GoAPEGenerateResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* bytes Result = 1 [json_name = "Result"];*/ 1:
                    message.result = reader.bytes();
                    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: GoAPEGenerateResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* bytes Result = 1 [json_name = "Result"]; */
        if (message.result.length)
            writer.tag(1, WireType.LengthDelimited).bytes(message.result);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GoAPEGenerateResult
 */
export const GoAPEGenerateResult = new GoAPEGenerateResult$Type();
/**
 * @generated ServiceType for protobuf service api.GoAPEService
 */
export const GoAPEService = new ServiceType("api.GoAPEService", [
    { name: "Generate", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Go APE"], description: "Generates a desired output from a template" }, "api.rscType": "Platform", "api.roles": "Platform.GoAPE", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GoAPEGenerateRequest, O: GoAPEGenerateResult }
], { "api.k8sService": "go-ape" });
