"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/reference.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.Reference = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
exports.protobufPackage = "io.restorecommerce.reference";
function createBaseReference() {
    return {};
}
exports.Reference = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.instanceType !== undefined) {
            writer.uint32(10).string(message.instanceType);
        }
        if (message.instanceId !== undefined) {
            writer.uint32(18).string(message.instanceId);
        }
        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 = createBaseReference();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceType = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceType: isSet(object.instanceType)
                ? globalThis.String(object.instanceType)
                : isSet(object.instance_type)
                    ? globalThis.String(object.instance_type)
                    : undefined,
            instanceId: isSet(object.instanceId)
                ? globalThis.String(object.instanceId)
                : isSet(object.instance_id)
                    ? globalThis.String(object.instance_id)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceType !== undefined) {
            obj.instanceType = message.instanceType;
        }
        if (message.instanceId !== undefined) {
            obj.instanceId = message.instanceId;
        }
        return obj;
    },
    create(base) {
        return exports.Reference.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseReference();
        message.instanceType = object.instanceType ?? undefined;
        message.instanceId = object.instanceId ?? undefined;
        return message;
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/reference.proto",
        "package": "io.restorecommerce.reference",
        "dependency": [],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Reference",
                "field": [{
                        "name": "instance_type",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "instanceType",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "instance_id",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "instanceId",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_instance_type", "options": undefined }, {
                        "name": "_instance_id",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": { "location": [] },
        "syntax": "proto3",
        "edition": 0,
    },
    references: { ".io.restorecommerce.reference.Reference": exports.Reference },
    dependencies: [],
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=reference.js.map