"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: grpc/health/v1/health.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.HealthDefinition = exports.HealthCheckResponse = exports.HealthCheckRequest = exports.HealthCheckResponse_ServingStatus = exports.protobufPackage = void 0;
exports.healthCheckResponse_ServingStatusFromJSON = healthCheckResponse_ServingStatusFromJSON;
exports.healthCheckResponse_ServingStatusToJSON = healthCheckResponse_ServingStatusToJSON;
exports.healthCheckResponse_ServingStatusToNumber = healthCheckResponse_ServingStatusToNumber;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const options_1 = require("../../../io/restorecommerce/options");
exports.protobufPackage = "grpc.health.v1";
var HealthCheckResponse_ServingStatus;
(function (HealthCheckResponse_ServingStatus) {
    HealthCheckResponse_ServingStatus["UNKNOWN"] = "UNKNOWN";
    HealthCheckResponse_ServingStatus["SERVING"] = "SERVING";
    HealthCheckResponse_ServingStatus["NOT_SERVING"] = "NOT_SERVING";
    HealthCheckResponse_ServingStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
})(HealthCheckResponse_ServingStatus || (exports.HealthCheckResponse_ServingStatus = HealthCheckResponse_ServingStatus = {}));
function healthCheckResponse_ServingStatusFromJSON(object) {
    switch (object) {
        case 0:
        case "UNKNOWN":
            return HealthCheckResponse_ServingStatus.UNKNOWN;
        case 1:
        case "SERVING":
            return HealthCheckResponse_ServingStatus.SERVING;
        case 2:
        case "NOT_SERVING":
            return HealthCheckResponse_ServingStatus.NOT_SERVING;
        case -1:
        case "UNRECOGNIZED":
        default:
            return HealthCheckResponse_ServingStatus.UNRECOGNIZED;
    }
}
function healthCheckResponse_ServingStatusToJSON(object) {
    switch (object) {
        case HealthCheckResponse_ServingStatus.UNKNOWN:
            return "UNKNOWN";
        case HealthCheckResponse_ServingStatus.SERVING:
            return "SERVING";
        case HealthCheckResponse_ServingStatus.NOT_SERVING:
            return "NOT_SERVING";
        case HealthCheckResponse_ServingStatus.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function healthCheckResponse_ServingStatusToNumber(object) {
    switch (object) {
        case HealthCheckResponse_ServingStatus.UNKNOWN:
            return 0;
        case HealthCheckResponse_ServingStatus.SERVING:
            return 1;
        case HealthCheckResponse_ServingStatus.NOT_SERVING:
            return 2;
        case HealthCheckResponse_ServingStatus.UNRECOGNIZED:
        default:
            return -1;
    }
}
function createBaseHealthCheckRequest() {
    return {};
}
exports.HealthCheckRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.service !== undefined && message.service !== "") {
            writer.uint32(10).string(message.service);
        }
        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 = createBaseHealthCheckRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.service = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { service: isSet(object.service) ? globalThis.String(object.service) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.service !== undefined && message.service !== "") {
            obj.service = message.service;
        }
        return obj;
    },
    create(base) {
        return exports.HealthCheckRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseHealthCheckRequest();
        message.service = object.service ?? undefined;
        return message;
    },
};
function createBaseHealthCheckResponse() {
    return {};
}
exports.HealthCheckResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.status !== undefined && message.status !== HealthCheckResponse_ServingStatus.UNKNOWN) {
            writer.uint32(8).int32(healthCheckResponse_ServingStatusToNumber(message.status));
        }
        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 = createBaseHealthCheckResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.status = healthCheckResponse_ServingStatusFromJSON(reader.int32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { status: isSet(object.status) ? healthCheckResponse_ServingStatusFromJSON(object.status) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.status !== undefined && message.status !== HealthCheckResponse_ServingStatus.UNKNOWN) {
            obj.status = healthCheckResponse_ServingStatusToJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.HealthCheckResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseHealthCheckResponse();
        message.status = object.status ?? undefined;
        return message;
    },
};
exports.HealthDefinition = {
    name: "Health",
    fullName: "grpc.health.v1.Health",
    methods: {
        check: {
            name: "Check",
            requestType: exports.HealthCheckRequest,
            requestStream: false,
            responseType: exports.HealthCheckResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "grpc/health/v1/health.proto",
        "package": "grpc.health.v1",
        "dependency": ["io/restorecommerce/options.proto"],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "HealthCheckRequest",
                "field": [{
                        "name": "service",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "service",
                        "options": undefined,
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "HealthCheckResponse",
                "field": [{
                        "name": "status",
                        "number": 1,
                        "label": 1,
                        "type": 14,
                        "typeName": ".grpc.health.v1.HealthCheckResponse.ServingStatus",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "status",
                        "options": undefined,
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [{
                        "name": "ServingStatus",
                        "value": [{ "name": "UNKNOWN", "number": 0, "options": undefined }, {
                                "name": "SERVING",
                                "number": 1,
                                "options": undefined,
                            }, { "name": "NOT_SERVING", "number": 2, "options": undefined }],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "extensionRange": [],
                "oneofDecl": [],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "Health",
                "method": [{
                        "name": "Check",
                        "inputType": ".grpc.health.v1.HealthCheckRequest",
                        "outputType": ".grpc.health.v1.HealthCheckResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": {
            "javaPackage": "",
            "javaOuterClassname": "",
            "javaMultipleFiles": false,
            "javaGenerateEqualsAndHash": false,
            "javaStringCheckUtf8": false,
            "optimizeFor": 1,
            "goPackage": "",
            "ccGenericServices": false,
            "javaGenericServices": false,
            "pyGenericServices": false,
            "deprecated": false,
            "ccEnableArenas": true,
            "objcClassPrefix": "",
            "csharpNamespace": "Grpc.Health.V1",
            "swiftPrefix": "",
            "phpClassPrefix": "",
            "phpNamespace": "",
            "phpMetadataNamespace": "",
            "rubyPackage": "",
            "features": undefined,
            "uninterpretedOption": [],
        },
        "sourceCodeInfo": { "location": [] },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".grpc.health.v1.HealthCheckRequest": exports.HealthCheckRequest,
        ".grpc.health.v1.HealthCheckResponse": exports.HealthCheckResponse,
        ".grpc.health.v1.HealthCheckResponse.ServingStatus": HealthCheckResponse_ServingStatus,
    },
    dependencies: [options_1.protoMetadata],
    options: { services: { "Health": { methods: { "Check": { "is_query": true } } } } },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=health.js.map