"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.11.8
//   protoc               v4.25.9
// source: echo/echo.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.EchoServiceDefinition = exports.EchoResponse = exports.EchoRequest = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const any_1 = require("../google/protobuf/any");
exports.protobufPackage = "echo";
function createBaseEchoRequest() {
    return {};
}
exports.EchoRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.message !== undefined) {
            writer.uint32(10).string(message.message);
        }
        if (message.test !== undefined) {
            any_1.Any.encode(message.test, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseEchoRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.message = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.test = any_1.Any.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            message: isSet(object.message) ? globalThis.String(object.message) : undefined,
            test: isSet(object.test) ? any_1.Any.fromJSON(object.test) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.message !== undefined) {
            obj.message = message.message;
        }
        if (message.test !== undefined) {
            obj.test = any_1.Any.toJSON(message.test);
        }
        return obj;
    },
    create(base) {
        return exports.EchoRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseEchoRequest();
        message.message = object.message ?? undefined;
        message.test = (object.test !== undefined && object.test !== null) ? any_1.Any.fromPartial(object.test) : undefined;
        return message;
    },
};
function createBaseEchoResponse() {
    return {};
}
exports.EchoResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.message !== undefined) {
            writer.uint32(10).string(message.message);
        }
        if (message.test !== undefined) {
            any_1.Any.encode(message.test, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseEchoResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.message = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.test = any_1.Any.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            message: isSet(object.message) ? globalThis.String(object.message) : undefined,
            test: isSet(object.test) ? any_1.Any.fromJSON(object.test) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.message !== undefined) {
            obj.message = message.message;
        }
        if (message.test !== undefined) {
            obj.test = any_1.Any.toJSON(message.test);
        }
        return obj;
    },
    create(base) {
        return exports.EchoResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseEchoResponse();
        message.message = object.message ?? undefined;
        message.test = (object.test !== undefined && object.test !== null) ? any_1.Any.fromPartial(object.test) : undefined;
        return message;
    },
};
exports.EchoServiceDefinition = {
    name: "EchoService",
    fullName: "echo.EchoService",
    methods: {
        /** Sends a greeting */
        echoUnary: {
            name: "echoUnary",
            requestType: exports.EchoRequest,
            requestStream: false,
            responseType: exports.EchoResponse,
            responseStream: false,
            options: {},
        },
        echoServerStream: {
            name: "echoServerStream",
            requestType: exports.EchoRequest,
            requestStream: false,
            responseType: exports.EchoResponse,
            responseStream: true,
            options: {},
        },
        echoClientStream: {
            name: "echoClientStream",
            requestType: exports.EchoRequest,
            requestStream: true,
            responseType: exports.EchoResponse,
            responseStream: false,
            options: {},
        },
        echoBidiStream: {
            name: "echoBidiStream",
            requestType: exports.EchoRequest,
            requestStream: true,
            responseType: exports.EchoResponse,
            responseStream: true,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "echo/echo.proto",
        "package": "echo",
        "dependency": ["google/protobuf/any.proto"],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "EchoRequest",
                "field": [{
                        "name": "message",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "message",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "test",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Any",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "test",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_message", "options": undefined }, { "name": "_test", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "EchoResponse",
                "field": [{
                        "name": "message",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "message",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "test",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Any",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "test",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_message", "options": undefined }, { "name": "_test", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "EchoService",
                "method": [{
                        "name": "echoUnary",
                        "inputType": ".echo.EchoRequest",
                        "outputType": ".echo.EchoResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "echoServerStream",
                        "inputType": ".echo.EchoRequest",
                        "outputType": ".echo.EchoResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": true,
                    }, {
                        "name": "echoClientStream",
                        "inputType": ".echo.EchoRequest",
                        "outputType": ".echo.EchoResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": true,
                        "serverStreaming": false,
                    }, {
                        "name": "echoBidiStream",
                        "inputType": ".echo.EchoRequest",
                        "outputType": ".echo.EchoResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": true,
                        "serverStreaming": true,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [3, 0],
                    "span": [4, 0, 35],
                    "leadingComments": ' import "google/protobuf/wrappers.proto";\n',
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [6, 0],
                    "span": [7, 0, 13, 1],
                    "leadingComments": " The greeting service definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [6, 0, 2, 0],
                    "span": [9, 2, 55],
                    "leadingComments": " Sends a greeting\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: { ".echo.EchoRequest": exports.EchoRequest, ".echo.EchoResponse": exports.EchoResponse },
    dependencies: [any_1.protoMetadata],
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=echo.js.map