"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: io/restorecommerce/options.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.KafkaSubscription = exports.Resolver = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const descriptor_1 = require("../../google/protobuf/descriptor");
exports.protobufPackage = "io.restorecommerce.options";
function createBaseResolver() {
    return {};
}
exports.Resolver = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.targetType !== undefined && message.targetType !== "") {
            writer.uint32(10).string(message.targetType);
        }
        if (message.targetService !== undefined && message.targetService !== "") {
            writer.uint32(18).string(message.targetService);
        }
        if (message.targetSubService !== undefined && message.targetSubService !== "") {
            writer.uint32(26).string(message.targetSubService);
        }
        if (message.targetMethod !== undefined && message.targetMethod !== "") {
            writer.uint32(34).string(message.targetMethod);
        }
        if (message.fieldName !== undefined && message.fieldName !== "") {
            writer.uint32(42).string(message.fieldName);
        }
        if (message.limit !== undefined) {
            writer.uint32(48).uint32(message.limit);
        }
        if (message.latency !== undefined) {
            writer.uint32(56).uint32(message.latency);
        }
        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 = createBaseResolver();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.targetType = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.targetService = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.targetSubService = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.targetMethod = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.fieldName = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 48) {
                        break;
                    }
                    message.limit = reader.uint32();
                    continue;
                }
                case 7: {
                    if (tag !== 56) {
                        break;
                    }
                    message.latency = reader.uint32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            targetType: isSet(object.targetType)
                ? globalThis.String(object.targetType)
                : isSet(object.target_type)
                    ? globalThis.String(object.target_type)
                    : undefined,
            targetService: isSet(object.targetService)
                ? globalThis.String(object.targetService)
                : isSet(object.target_service)
                    ? globalThis.String(object.target_service)
                    : undefined,
            targetSubService: isSet(object.targetSubService)
                ? globalThis.String(object.targetSubService)
                : isSet(object.target_sub_service)
                    ? globalThis.String(object.target_sub_service)
                    : undefined,
            targetMethod: isSet(object.targetMethod)
                ? globalThis.String(object.targetMethod)
                : isSet(object.target_method)
                    ? globalThis.String(object.target_method)
                    : undefined,
            fieldName: isSet(object.fieldName)
                ? globalThis.String(object.fieldName)
                : isSet(object.field_name)
                    ? globalThis.String(object.field_name)
                    : undefined,
            limit: isSet(object.limit) ? globalThis.Number(object.limit) : undefined,
            latency: isSet(object.latency) ? globalThis.Number(object.latency) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.targetType !== undefined && message.targetType !== "") {
            obj.targetType = message.targetType;
        }
        if (message.targetService !== undefined && message.targetService !== "") {
            obj.targetService = message.targetService;
        }
        if (message.targetSubService !== undefined && message.targetSubService !== "") {
            obj.targetSubService = message.targetSubService;
        }
        if (message.targetMethod !== undefined && message.targetMethod !== "") {
            obj.targetMethod = message.targetMethod;
        }
        if (message.fieldName !== undefined && message.fieldName !== "") {
            obj.fieldName = message.fieldName;
        }
        if (message.limit !== undefined) {
            obj.limit = Math.round(message.limit);
        }
        if (message.latency !== undefined) {
            obj.latency = Math.round(message.latency);
        }
        return obj;
    },
    create(base) {
        return exports.Resolver.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResolver();
        message.targetType = object.targetType ?? undefined;
        message.targetService = object.targetService ?? undefined;
        message.targetSubService = object.targetSubService ?? undefined;
        message.targetMethod = object.targetMethod ?? undefined;
        message.fieldName = object.fieldName ?? undefined;
        message.limit = object.limit ?? undefined;
        message.latency = object.latency ?? undefined;
        return message;
    },
};
function createBaseKafkaSubscription() {
    return {};
}
exports.KafkaSubscription = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.plural !== undefined && message.plural !== "") {
            writer.uint32(10).string(message.plural);
        }
        if (message.topic !== undefined && message.topic !== "") {
            writer.uint32(18).string(message.topic);
        }
        if (message.created !== undefined && message.created !== "") {
            writer.uint32(26).string(message.created);
        }
        if (message.updated !== undefined && message.updated !== "") {
            writer.uint32(34).string(message.updated);
        }
        if (message.deleted !== undefined && message.deleted !== "") {
            writer.uint32(42).string(message.deleted);
        }
        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 = createBaseKafkaSubscription();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.plural = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.topic = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.created = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.updated = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.deleted = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            plural: isSet(object.plural) ? globalThis.String(object.plural) : undefined,
            topic: isSet(object.topic) ? globalThis.String(object.topic) : undefined,
            created: isSet(object.created) ? globalThis.String(object.created) : undefined,
            updated: isSet(object.updated) ? globalThis.String(object.updated) : undefined,
            deleted: isSet(object.deleted) ? globalThis.String(object.deleted) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.plural !== undefined && message.plural !== "") {
            obj.plural = message.plural;
        }
        if (message.topic !== undefined && message.topic !== "") {
            obj.topic = message.topic;
        }
        if (message.created !== undefined && message.created !== "") {
            obj.created = message.created;
        }
        if (message.updated !== undefined && message.updated !== "") {
            obj.updated = message.updated;
        }
        if (message.deleted !== undefined && message.deleted !== "") {
            obj.deleted = message.deleted;
        }
        return obj;
    },
    create(base) {
        return exports.KafkaSubscription.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseKafkaSubscription();
        message.plural = object.plural ?? undefined;
        message.topic = object.topic ?? undefined;
        message.created = object.created ?? undefined;
        message.updated = object.updated ?? undefined;
        message.deleted = object.deleted ?? undefined;
        return message;
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/options.proto",
        "package": "io.restorecommerce.options",
        "dependency": ["google/protobuf/descriptor.proto"],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Resolver",
                "field": [{
                        "name": "target_type",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "targetType",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "target_service",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "targetService",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "target_sub_service",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "targetSubService",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "target_method",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "targetMethod",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "field_name",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "fieldName",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "limit",
                        "number": 6,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "limit",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "latency",
                        "number": 7,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "latency",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_limit", "options": undefined }, { "name": "_latency", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "KafkaSubscription",
                "field": [{
                        "name": "plural",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "plural",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "topic",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "topic",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "created",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "created",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "updated",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "updated",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "deleted",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "deleted",
                        "options": undefined,
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [],
        "extension": [{
                "name": "resolver",
                "number": 31000,
                "label": 1,
                "type": 11,
                "typeName": ".io.restorecommerce.options.Resolver",
                "extendee": ".google.protobuf.FieldOptions",
                "defaultValue": "",
                "oneofIndex": 0,
                "jsonName": "resolver",
                "options": undefined,
                "proto3Optional": false,
            }, {
                "name": "is_query",
                "number": 31001,
                "label": 1,
                "type": 8,
                "typeName": "",
                "extendee": ".google.protobuf.MethodOptions",
                "defaultValue": "",
                "oneofIndex": 0,
                "jsonName": "isQuery",
                "options": undefined,
                "proto3Optional": false,
            }, {
                "name": "service_name",
                "number": 31002,
                "label": 1,
                "type": 9,
                "typeName": "",
                "extendee": ".google.protobuf.ServiceOptions",
                "defaultValue": "",
                "oneofIndex": 0,
                "jsonName": "serviceName",
                "options": undefined,
                "proto3Optional": false,
            }, {
                "name": "kafka_subscriber",
                "number": 31003,
                "label": 1,
                "type": 11,
                "typeName": ".io.restorecommerce.options.KafkaSubscription",
                "extendee": ".google.protobuf.MessageOptions",
                "defaultValue": "",
                "oneofIndex": 0,
                "jsonName": "kafkaSubscriber",
                "options": undefined,
                "proto3Optional": false,
            }],
        "options": undefined,
        "sourceCodeInfo": { "location": [] },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.options.Resolver": exports.Resolver,
        ".io.restorecommerce.options.KafkaSubscription": exports.KafkaSubscription,
    },
    dependencies: [descriptor_1.protoMetadata],
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=options.js.map