"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/customer.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.CustomerServiceDefinition = exports.PublicSector = exports.Commercial = exports.Private = exports.Customer = exports.CustomerResponse = exports.CustomerListResponse = exports.CustomerList = exports.CustomerType = exports.protobufPackage = void 0;
exports.customerTypeFromJSON = customerTypeFromJSON;
exports.customerTypeToJSON = customerTypeToJSON;
exports.customerTypeToNumber = customerTypeToNumber;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const auth_1 = require("./auth");
const contact_point_1 = require("./contact_point");
const meta_1 = require("./meta");
const options_1 = require("./options");
const organization_1 = require("./organization");
const resource_base_1 = require("./resource_base");
const setting_1 = require("./setting");
const status_1 = require("./status");
const user_1 = require("./user");
exports.protobufPackage = "io.restorecommerce.customer";
var CustomerType;
(function (CustomerType) {
    CustomerType["PRIVATE"] = "PRIVATE";
    CustomerType["COMMERCIAL"] = "COMMERCIAL";
    CustomerType["PUBLIC_SECTOR"] = "PUBLIC_SECTOR";
    CustomerType["UNRECOGNIZED"] = "UNRECOGNIZED";
})(CustomerType || (exports.CustomerType = CustomerType = {}));
function customerTypeFromJSON(object) {
    switch (object) {
        case 0:
        case "PRIVATE":
            return CustomerType.PRIVATE;
        case 1:
        case "COMMERCIAL":
            return CustomerType.COMMERCIAL;
        case 2:
        case "PUBLIC_SECTOR":
            return CustomerType.PUBLIC_SECTOR;
        case -1:
        case "UNRECOGNIZED":
        default:
            return CustomerType.UNRECOGNIZED;
    }
}
function customerTypeToJSON(object) {
    switch (object) {
        case CustomerType.PRIVATE:
            return "PRIVATE";
        case CustomerType.COMMERCIAL:
            return "COMMERCIAL";
        case CustomerType.PUBLIC_SECTOR:
            return "PUBLIC_SECTOR";
        case CustomerType.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function customerTypeToNumber(object) {
    switch (object) {
        case CustomerType.PRIVATE:
            return 0;
        case CustomerType.COMMERCIAL:
            return 1;
        case CustomerType.PUBLIC_SECTOR:
            return 2;
        case CustomerType.UNRECOGNIZED:
        default:
            return -1;
    }
}
function createBaseCustomerList() {
    return {};
}
exports.CustomerList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Customer.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        if (message.subject !== undefined) {
            auth_1.Subject.encode(message.subject, writer.uint32(26).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 = createBaseCustomerList();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.Customer.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.subject = auth_1.Subject.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => exports.Customer.fromJSON(e)) : undefined,
            totalCount: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            subject: isSet(object.subject) ? auth_1.Subject.fromJSON(object.subject) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.Customer.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.CustomerList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCustomerList();
        message.items = object.items?.map((e) => exports.Customer.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseCustomerListResponse() {
    return {};
}
exports.CustomerListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.CustomerResponse.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            status_1.OperationStatus.encode(message.operationStatus, writer.uint32(26).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 = createBaseCustomerListResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.CustomerResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operationStatus = status_1.OperationStatus.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items)
                ? object.items.map((e) => exports.CustomerResponse.fromJSON(e))
                : undefined,
            totalCount: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            operationStatus: isSet(object.operationStatus)
                ? status_1.OperationStatus.fromJSON(object.operationStatus)
                : isSet(object.operation_status)
                    ? status_1.OperationStatus.fromJSON(object.operation_status)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.CustomerResponse.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operationStatus);
        }
        return obj;
    },
    create(base) {
        return exports.CustomerListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCustomerListResponse();
        message.items = object.items?.map((e) => exports.CustomerResponse.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.operationStatus = (object.operationStatus !== undefined && object.operationStatus !== null)
            ? status_1.OperationStatus.fromPartial(object.operationStatus)
            : undefined;
        return message;
    },
};
function createBaseCustomerResponse() {
    return {};
}
exports.CustomerResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Customer.encode(message.payload, writer.uint32(10).fork()).join();
        }
        if (message.status !== undefined) {
            status_1.Status.encode(message.status, 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 = createBaseCustomerResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Customer.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.status = status_1.Status.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            payload: isSet(object.payload) ? exports.Customer.fromJSON(object.payload) : undefined,
            status: isSet(object.status) ? status_1.Status.fromJSON(object.status) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.payload !== undefined) {
            obj.payload = exports.Customer.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.CustomerResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCustomerResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Customer.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseCustomer() {
    return {};
}
exports.Customer = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.meta !== undefined) {
            meta_1.Meta.encode(message.meta, writer.uint32(18).fork()).join();
        }
        if (message.private !== undefined) {
            exports.Private.encode(message.private, writer.uint32(26).fork()).join();
        }
        if (message.commercial !== undefined) {
            exports.Commercial.encode(message.commercial, writer.uint32(34).fork()).join();
        }
        if (message.publicSector !== undefined) {
            exports.PublicSector.encode(message.publicSector, writer.uint32(42).fork()).join();
        }
        if (message.settingId !== undefined && message.settingId !== "") {
            writer.uint32(50).string(message.settingId);
        }
        if (message.name !== undefined) {
            writer.uint32(58).string(message.name);
        }
        if (message.description !== undefined) {
            writer.uint32(66).string(message.description);
        }
        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 = createBaseCustomer();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.meta = meta_1.Meta.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.private = exports.Private.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.commercial = exports.Commercial.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.publicSector = exports.PublicSector.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.settingId = reader.string();
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.description = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            meta: isSet(object.meta) ? meta_1.Meta.fromJSON(object.meta) : undefined,
            private: isSet(object.private) ? exports.Private.fromJSON(object.private) : undefined,
            commercial: isSet(object.commercial) ? exports.Commercial.fromJSON(object.commercial) : undefined,
            publicSector: isSet(object.publicSector)
                ? exports.PublicSector.fromJSON(object.publicSector)
                : isSet(object.public_sector)
                    ? exports.PublicSector.fromJSON(object.public_sector)
                    : undefined,
            settingId: isSet(object.settingId)
                ? globalThis.String(object.settingId)
                : isSet(object.setting_id)
                    ? globalThis.String(object.setting_id)
                    : undefined,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.meta !== undefined) {
            obj.meta = meta_1.Meta.toJSON(message.meta);
        }
        if (message.private !== undefined) {
            obj.private = exports.Private.toJSON(message.private);
        }
        if (message.commercial !== undefined) {
            obj.commercial = exports.Commercial.toJSON(message.commercial);
        }
        if (message.publicSector !== undefined) {
            obj.publicSector = exports.PublicSector.toJSON(message.publicSector);
        }
        if (message.settingId !== undefined && message.settingId !== "") {
            obj.settingId = message.settingId;
        }
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        if (message.description !== undefined) {
            obj.description = message.description;
        }
        return obj;
    },
    create(base) {
        return exports.Customer.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCustomer();
        message.id = object.id ?? undefined;
        message.meta = (object.meta !== undefined && object.meta !== null) ? meta_1.Meta.fromPartial(object.meta) : undefined;
        message.private = (object.private !== undefined && object.private !== null)
            ? exports.Private.fromPartial(object.private)
            : undefined;
        message.commercial = (object.commercial !== undefined && object.commercial !== null)
            ? exports.Commercial.fromPartial(object.commercial)
            : undefined;
        message.publicSector = (object.publicSector !== undefined && object.publicSector !== null)
            ? exports.PublicSector.fromPartial(object.publicSector)
            : undefined;
        message.settingId = object.settingId ?? undefined;
        message.name = object.name ?? undefined;
        message.description = object.description ?? undefined;
        return message;
    },
};
function createBasePrivate() {
    return {};
}
exports.Private = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.userId !== undefined) {
            writer.uint32(10).string(message.userId);
        }
        if (message.contactPointIds !== undefined && message.contactPointIds.length !== 0) {
            for (const v of message.contactPointIds) {
                writer.uint32(18).string(v);
            }
        }
        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 = createBasePrivate();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.contactPointIds === undefined) {
                        message.contactPointIds = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.contactPointIds.push(el);
                    }
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            userId: isSet(object.userId)
                ? globalThis.String(object.userId)
                : isSet(object.user_id)
                    ? globalThis.String(object.user_id)
                    : undefined,
            contactPointIds: globalThis.Array.isArray(object?.contactPointIds)
                ? object.contactPointIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.contact_point_ids)
                    ? object.contact_point_ids.map((e) => globalThis.String(e))
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== undefined) {
            obj.userId = message.userId;
        }
        if (message.contactPointIds?.length) {
            obj.contactPointIds = message.contactPointIds;
        }
        return obj;
    },
    create(base) {
        return exports.Private.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePrivate();
        message.userId = object.userId ?? undefined;
        message.contactPointIds = object.contactPointIds?.map((e) => e) || undefined;
        return message;
    },
};
function createBaseCommercial() {
    return {};
}
exports.Commercial = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.organizationId !== undefined) {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.templateIds !== undefined && message.templateIds.length !== 0) {
            for (const v of message.templateIds) {
                writer.uint32(18).string(v);
            }
        }
        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 = createBaseCommercial();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.templateIds === undefined) {
                        message.templateIds = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.templateIds.push(el);
                    }
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId)
                ? globalThis.String(object.organizationId)
                : isSet(object.organization_id)
                    ? globalThis.String(object.organization_id)
                    : undefined,
            templateIds: globalThis.Array.isArray(object?.templateIds)
                ? object.templateIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.template_ids)
                    ? object.template_ids.map((e) => globalThis.String(e))
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== undefined) {
            obj.organizationId = message.organizationId;
        }
        if (message.templateIds?.length) {
            obj.templateIds = message.templateIds;
        }
        return obj;
    },
    create(base) {
        return exports.Commercial.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommercial();
        message.organizationId = object.organizationId ?? undefined;
        message.templateIds = object.templateIds?.map((e) => e) || undefined;
        return message;
    },
};
function createBasePublicSector() {
    return {};
}
exports.PublicSector = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.organizationId !== undefined) {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.templateIds !== undefined && message.templateIds.length !== 0) {
            for (const v of message.templateIds) {
                writer.uint32(18).string(v);
            }
        }
        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 = createBasePublicSector();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.templateIds === undefined) {
                        message.templateIds = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.templateIds.push(el);
                    }
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId)
                ? globalThis.String(object.organizationId)
                : isSet(object.organization_id)
                    ? globalThis.String(object.organization_id)
                    : undefined,
            templateIds: globalThis.Array.isArray(object?.templateIds)
                ? object.templateIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.template_ids)
                    ? object.template_ids.map((e) => globalThis.String(e))
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== undefined) {
            obj.organizationId = message.organizationId;
        }
        if (message.templateIds?.length) {
            obj.templateIds = message.templateIds;
        }
        return obj;
    },
    create(base) {
        return exports.PublicSector.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePublicSector();
        message.organizationId = object.organizationId ?? undefined;
        message.templateIds = object.templateIds?.map((e) => e) || undefined;
        return message;
    },
};
exports.CustomerServiceDefinition = {
    name: "CustomerService",
    fullName: "io.restorecommerce.customer.CustomerService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.CustomerListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.CustomerList,
            requestStream: false,
            responseType: exports.CustomerListResponse,
            responseStream: false,
            options: {},
        },
        delete: {
            name: "Delete",
            requestType: resource_base_1.DeleteRequest,
            requestStream: false,
            responseType: resource_base_1.DeleteResponse,
            responseStream: false,
            options: {},
        },
        update: {
            name: "Update",
            requestType: exports.CustomerList,
            requestStream: false,
            responseType: exports.CustomerListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.CustomerList,
            requestStream: false,
            responseType: exports.CustomerListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/customer.proto",
        "package": "io.restorecommerce.customer",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/setting.proto",
            "io/restorecommerce/options.proto",
            "io/restorecommerce/user.proto",
            "io/restorecommerce/contact_point.proto",
            "io/restorecommerce/organization.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "CustomerList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.Customer",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "total_count",
                        "number": 2,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "totalCount",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "subject",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.auth.Subject",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "subject",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_total_count", "options": undefined }, { "name": "_subject", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "CustomerListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.CustomerResponse",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "total_count",
                        "number": 2,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "totalCount",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "operation_status",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.OperationStatus",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "operationStatus",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_total_count", "options": undefined }, {
                        "name": "_operation_status",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "CustomerResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.Customer",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "payload",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "status",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.Status",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "status",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_payload", "options": undefined }, { "name": "_status", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "Customer",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "meta",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.meta.Meta",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "meta",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "private",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.Private",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "private",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "commercial",
                        "number": 4,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.Commercial",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "commercial",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "public_sector",
                        "number": 5,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.customer.PublicSector",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "publicSector",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "setting_id",
                        "number": 6,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "settingId",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": false,
                    }, {
                        "name": "name",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "name",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "description",
                        "number": 8,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "description",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "type", "options": undefined },
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_name", "options": undefined },
                    { "name": "_description", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "Private",
                "field": [{
                        "name": "user_id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "userId",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": true,
                    }, {
                        "name": "contact_point_ids",
                        "number": 2,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "contactPointIds",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_user_id", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "Commercial",
                "field": [{
                        "name": "organization_id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "organizationId",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": true,
                    }, {
                        "name": "template_ids",
                        "number": 2,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "templateIds",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_organization_id", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "PublicSector",
                "field": [{
                        "name": "organization_id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "organizationId",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": true,
                    }, {
                        "name": "template_ids",
                        "number": 2,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "templateIds",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_organization_id", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [{
                "name": "CustomerType",
                "value": [{ "name": "PRIVATE", "number": 0, "options": undefined }, {
                        "name": "COMMERCIAL",
                        "number": 1,
                        "options": undefined,
                    }, { "name": "PUBLIC_SECTOR", "number": 2, "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "service": [{
                "name": "CustomerService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.customer.CustomerListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.customer.CustomerList",
                        "outputType": ".io.restorecommerce.customer.CustomerListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Delete",
                        "inputType": ".io.restorecommerce.resourcebase.DeleteRequest",
                        "outputType": ".io.restorecommerce.resourcebase.DeleteResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Update",
                        "inputType": ".io.restorecommerce.customer.CustomerList",
                        "outputType": ".io.restorecommerce.customer.CustomerListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.customer.CustomerList",
                        "outputType": ".io.restorecommerce.customer.CustomerListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [3, 6],
                    "span": [12, 0, 39],
                    "leadingComments": " Used by resolvers\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [6, 0],
                    "span": [19, 0, 27, 1],
                    "leadingComments": "\nMicroservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 6],
                    "span": [69, 2, 27],
                    "leadingComments": "",
                    "trailingComments": " display name!\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 1],
                    "span": [104, 2, 112, 4],
                    "leadingComments": "",
                    "trailingComments": " list of active templates\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 6, 2, 1],
                    "span": [125, 2, 133, 4],
                    "leadingComments": "",
                    "trailingComments": " list of active templates\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.customer.CustomerType": CustomerType,
        ".io.restorecommerce.customer.CustomerList": exports.CustomerList,
        ".io.restorecommerce.customer.CustomerListResponse": exports.CustomerListResponse,
        ".io.restorecommerce.customer.CustomerResponse": exports.CustomerResponse,
        ".io.restorecommerce.customer.Customer": exports.Customer,
        ".io.restorecommerce.customer.Private": exports.Private,
        ".io.restorecommerce.customer.Commercial": exports.Commercial,
        ".io.restorecommerce.customer.PublicSector": exports.PublicSector,
    },
    dependencies: [
        resource_base_1.protoMetadata,
        meta_1.protoMetadata,
        auth_1.protoMetadata,
        status_1.protoMetadata,
        setting_1.protoMetadata,
        options_1.protoMetadata,
        user_1.protoMetadata,
        contact_point_1.protoMetadata,
        organization_1.protoMetadata,
    ],
    options: {
        messages: {
            "Customer": {
                fields: {
                    "setting_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiMuaW8ucmVzdG9yZWNvbW1lcmNlLnNldHRpbmcuU2V0dGluZxILbWFzdGVyX2RhdGEaB3NldHRpbmciBFJlYWQqB3NldHRpbmc=", "base64")),
                    },
                },
            },
            "Private": {
                fields: {
                    "user_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ch0uaW8ucmVzdG9yZWNvbW1lcmNlLnVzZXIuVXNlchIIaWRlbnRpdHkaBHVzZXIiBFJlYWQqBHVzZXI=", "base64")),
                    },
                    "contact_point_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ci4uaW8ucmVzdG9yZWNvbW1lcmNlLmNvbnRhY3RfcG9pbnQuQ29udGFjdFBvaW50EgttYXN0ZXJfZGF0YRoNY29udGFjdF9wb2ludCIEUmVhZCoNY29udGFjdFBvaW50cw==", "base64")),
                    },
                },
            },
            "Commercial": {
                fields: {
                    "organization_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ci0uaW8ucmVzdG9yZWNvbW1lcmNlLm9yZ2FuaXphdGlvbi5Pcmdhbml6YXRpb24SC21hc3Rlcl9kYXRhGgxvcmdhbml6YXRpb24iBFJlYWQqDG9yZ2FuaXphdGlvbg==", "base64")),
                    },
                    "template_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiUuaW8ucmVzdG9yZWNvbW1lcmNlLnRlbXBsYXRlLlRlbXBsYXRlEgttYXN0ZXJfZGF0YRoIdGVtcGxhdGUiBFJlYWQqCXRlbXBsYXRlcw==", "base64")),
                    },
                },
            },
            "PublicSector": {
                fields: {
                    "organization_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ci0uaW8ucmVzdG9yZWNvbW1lcmNlLm9yZ2FuaXphdGlvbi5Pcmdhbml6YXRpb24SC21hc3Rlcl9kYXRhGgxvcmdhbml6YXRpb24iBFJlYWQqDG9yZ2FuaXphdGlvbg==", "base64")),
                    },
                    "template_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiUuaW8ucmVzdG9yZWNvbW1lcmNlLnRlbXBsYXRlLlRlbXBsYXRlEgttYXN0ZXJfZGF0YRoIdGVtcGxhdGUiBFJlYWQqCXRlbXBsYXRlcw==", "base64")),
                    },
                },
            },
        },
        services: { "CustomerService": { methods: { "Read": { "is_query": true } } } },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=customer.js.map