"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/organization.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.OrganizationServiceDefinition = exports.Organization = exports.OrganizationResponse = exports.OrganizationListResponse = exports.OrganizationList = exports.DeleteOrgData = exports.Deleted = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const any_1 = require("../../google/protobuf/any");
const address_1 = require("./address");
const auth_1 = require("./auth");
const contact_point_1 = require("./contact_point");
const image_1 = require("./image");
const meta_1 = require("./meta");
const options_1 = require("./options");
const payment_method_1 = require("./payment_method");
const resource_base_1 = require("./resource_base");
const status_1 = require("./status");
exports.protobufPackage = "io.restorecommerce.organization";
function createBaseDeleted() {
    return {};
}
exports.Deleted = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        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 = createBaseDeleted();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = 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 };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return exports.Deleted.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleted();
        message.id = object.id ?? undefined;
        return message;
    },
};
function createBaseDeleteOrgData() {
    return {};
}
exports.DeleteOrgData = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.org_ids !== undefined && message.org_ids.length !== 0) {
            for (const v of message.org_ids) {
                writer.uint32(10).string(v);
            }
        }
        if (message.user_ids !== undefined && message.user_ids.length !== 0) {
            for (const v of message.user_ids) {
                writer.uint32(18).string(v);
            }
        }
        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 = createBaseDeleteOrgData();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    if (message.org_ids === undefined) {
                        message.org_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.org_ids.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    if (message.user_ids === undefined) {
                        message.user_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.user_ids.push(el);
                    }
                    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 {
            org_ids: globalThis.Array.isArray(object?.orgIds)
                ? object.orgIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.org_ids)
                    ? object.org_ids.map((e) => globalThis.String(e))
                    : undefined,
            user_ids: globalThis.Array.isArray(object?.userIds)
                ? object.userIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.user_ids)
                    ? object.user_ids.map((e) => globalThis.String(e))
                    : undefined,
            subject: isSet(object.subject) ? auth_1.Subject.fromJSON(object.subject) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.org_ids?.length) {
            obj.orgIds = message.org_ids;
        }
        if (message.user_ids?.length) {
            obj.userIds = message.user_ids;
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.DeleteOrgData.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrgData();
        message.org_ids = object.org_ids?.map((e) => e) || undefined;
        message.user_ids = object.user_ids?.map((e) => e) || undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseOrganizationList() {
    return {};
}
exports.OrganizationList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Organization.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.total_count !== undefined) {
            writer.uint32(16).uint32(message.total_count);
        }
        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 = createBaseOrganizationList();
        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.Organization.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.total_count = 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.Organization.fromJSON(e))
                : undefined,
            total_count: 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.Organization.toJSON(e));
        }
        if (message.total_count !== undefined) {
            obj.totalCount = Math.round(message.total_count);
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.OrganizationList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOrganizationList();
        message.items = object.items?.map((e) => exports.Organization.fromPartial(e)) || undefined;
        message.total_count = object.total_count ?? undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseOrganizationListResponse() {
    return {};
}
exports.OrganizationListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.OrganizationResponse.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.total_count !== undefined) {
            writer.uint32(16).uint32(message.total_count);
        }
        if (message.operation_status !== undefined) {
            status_1.OperationStatus.encode(message.operation_status, 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 = createBaseOrganizationListResponse();
        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.OrganizationResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.total_count = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operation_status = 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.OrganizationResponse.fromJSON(e))
                : undefined,
            total_count: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            operation_status: 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.OrganizationResponse.toJSON(e));
        }
        if (message.total_count !== undefined) {
            obj.totalCount = Math.round(message.total_count);
        }
        if (message.operation_status !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operation_status);
        }
        return obj;
    },
    create(base) {
        return exports.OrganizationListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOrganizationListResponse();
        message.items = object.items?.map((e) => exports.OrganizationResponse.fromPartial(e)) || undefined;
        message.total_count = object.total_count ?? undefined;
        message.operation_status = (object.operation_status !== undefined && object.operation_status !== null)
            ? status_1.OperationStatus.fromPartial(object.operation_status)
            : undefined;
        return message;
    },
};
function createBaseOrganizationResponse() {
    return {};
}
exports.OrganizationResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Organization.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 = createBaseOrganizationResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Organization.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.Organization.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.Organization.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.OrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOrganizationResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Organization.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseOrganization() {
    return {};
}
exports.Organization = {
    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.parent_id !== undefined) {
            writer.uint32(26).string(message.parent_id);
        }
        if (message.contact_point_ids !== undefined && message.contact_point_ids.length !== 0) {
            for (const v of message.contact_point_ids) {
                writer.uint32(34).string(v);
            }
        }
        if (message.website !== undefined) {
            writer.uint32(42).string(message.website);
        }
        if (message.email !== undefined) {
            writer.uint32(50).string(message.email);
        }
        if (message.logo !== undefined) {
            image_1.Image.encode(message.logo, writer.uint32(58).fork()).join();
        }
        if (message.vat_id !== undefined) {
            writer.uint32(66).string(message.vat_id);
        }
        if (message.isic_v4 !== undefined) {
            writer.uint32(74).string(message.isic_v4);
        }
        if (message.registration !== undefined) {
            writer.uint32(82).string(message.registration);
        }
        if (message.registration_court !== undefined) {
            writer.uint32(90).string(message.registration_court);
        }
        if (message.name !== undefined) {
            writer.uint32(98).string(message.name);
        }
        if (message.payment_method_ids !== undefined && message.payment_method_ids.length !== 0) {
            for (const v of message.payment_method_ids) {
                writer.uint32(106).string(v);
            }
        }
        if (message.data !== undefined) {
            any_1.Any.encode(message.data, writer.uint32(114).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 = createBaseOrganization();
        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.parent_id = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    if (message.contact_point_ids === undefined) {
                        message.contact_point_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.contact_point_ids.push(el);
                    }
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.website = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.email = reader.string();
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.logo = image_1.Image.decode(reader, reader.uint32());
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.vat_id = reader.string();
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        break;
                    }
                    message.isic_v4 = reader.string();
                    continue;
                }
                case 10: {
                    if (tag !== 82) {
                        break;
                    }
                    message.registration = reader.string();
                    continue;
                }
                case 11: {
                    if (tag !== 90) {
                        break;
                    }
                    message.registration_court = reader.string();
                    continue;
                }
                case 12: {
                    if (tag !== 98) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
                case 13: {
                    if (tag !== 106) {
                        break;
                    }
                    if (message.payment_method_ids === undefined) {
                        message.payment_method_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.payment_method_ids.push(el);
                    }
                    continue;
                }
                case 14: {
                    if (tag !== 114) {
                        break;
                    }
                    message.data = any_1.Any.decode(reader, reader.uint32());
                    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,
            parent_id: isSet(object.parentId)
                ? globalThis.String(object.parentId)
                : isSet(object.parent_id)
                    ? globalThis.String(object.parent_id)
                    : undefined,
            contact_point_ids: 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,
            website: isSet(object.website) ? globalThis.String(object.website) : undefined,
            email: isSet(object.email) ? globalThis.String(object.email) : undefined,
            logo: isSet(object.logo) ? image_1.Image.fromJSON(object.logo) : undefined,
            vat_id: isSet(object.vatId)
                ? globalThis.String(object.vatId)
                : isSet(object.vat_id)
                    ? globalThis.String(object.vat_id)
                    : undefined,
            isic_v4: isSet(object.isicV4)
                ? globalThis.String(object.isicV4)
                : isSet(object.isic_v4)
                    ? globalThis.String(object.isic_v4)
                    : undefined,
            registration: isSet(object.registration) ? globalThis.String(object.registration) : undefined,
            registration_court: isSet(object.registrationCourt)
                ? globalThis.String(object.registrationCourt)
                : isSet(object.registration_court)
                    ? globalThis.String(object.registration_court)
                    : undefined,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            payment_method_ids: globalThis.Array.isArray(object?.paymentMethodIds)
                ? object.paymentMethodIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.payment_method_ids)
                    ? object.payment_method_ids.map((e) => globalThis.String(e))
                    : undefined,
            data: isSet(object.data) ? any_1.Any.fromJSON(object.data) : 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.parent_id !== undefined) {
            obj.parentId = message.parent_id;
        }
        if (message.contact_point_ids?.length) {
            obj.contactPointIds = message.contact_point_ids;
        }
        if (message.website !== undefined) {
            obj.website = message.website;
        }
        if (message.email !== undefined) {
            obj.email = message.email;
        }
        if (message.logo !== undefined) {
            obj.logo = image_1.Image.toJSON(message.logo);
        }
        if (message.vat_id !== undefined) {
            obj.vatId = message.vat_id;
        }
        if (message.isic_v4 !== undefined) {
            obj.isicV4 = message.isic_v4;
        }
        if (message.registration !== undefined) {
            obj.registration = message.registration;
        }
        if (message.registration_court !== undefined) {
            obj.registrationCourt = message.registration_court;
        }
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        if (message.payment_method_ids?.length) {
            obj.paymentMethodIds = message.payment_method_ids;
        }
        if (message.data !== undefined) {
            obj.data = any_1.Any.toJSON(message.data);
        }
        return obj;
    },
    create(base) {
        return exports.Organization.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOrganization();
        message.id = object.id ?? undefined;
        message.meta = (object.meta !== undefined && object.meta !== null) ? meta_1.Meta.fromPartial(object.meta) : undefined;
        message.parent_id = object.parent_id ?? undefined;
        message.contact_point_ids = object.contact_point_ids?.map((e) => e) || undefined;
        message.website = object.website ?? undefined;
        message.email = object.email ?? undefined;
        message.logo = (object.logo !== undefined && object.logo !== null) ? image_1.Image.fromPartial(object.logo) : undefined;
        message.vat_id = object.vat_id ?? undefined;
        message.isic_v4 = object.isic_v4 ?? undefined;
        message.registration = object.registration ?? undefined;
        message.registration_court = object.registration_court ?? undefined;
        message.name = object.name ?? undefined;
        message.payment_method_ids = object.payment_method_ids?.map((e) => e) || undefined;
        message.data = (object.data !== undefined && object.data !== null) ? any_1.Any.fromPartial(object.data) : undefined;
        return message;
    },
};
exports.OrganizationServiceDefinition = {
    name: "OrganizationService",
    fullName: "io.restorecommerce.organization.OrganizationService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.OrganizationListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.OrganizationList,
            requestStream: false,
            responseType: exports.OrganizationListResponse,
            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.OrganizationList,
            requestStream: false,
            responseType: exports.OrganizationListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.OrganizationList,
            requestStream: false,
            responseType: exports.OrganizationListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/organization.proto",
        "package": "io.restorecommerce.organization",
        "dependency": [
            "google/protobuf/any.proto",
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/image.proto",
            "io/restorecommerce/options.proto",
            "io/restorecommerce/address.proto",
            "io/restorecommerce/contact_point.proto",
            "io/restorecommerce/payment_method.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Deleted",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "DeleteOrgData",
                "field": [{
                        "name": "org_ids",
                        "number": 1,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "orgIds",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "user_ids",
                        "number": 2,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "userIds",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "subject",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.auth.Subject",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "subject",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_subject", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "OrganizationList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.organization.Organization",
                        "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": "OrganizationListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.organization.OrganizationResponse",
                        "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": "OrganizationResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.organization.Organization",
                        "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": "Organization",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "meta",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.meta.Meta",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "meta",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "parent_id",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "parentId",
                        "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": 4,
                        "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,
                    }, {
                        "name": "website",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "website",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "email",
                        "number": 6,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "email",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "logo",
                        "number": 7,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.image.Image",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "logo",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "vat_id",
                        "number": 8,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 6,
                        "jsonName": "vatId",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "isic_v4",
                        "number": 9,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 7,
                        "jsonName": "isicV4",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "registration",
                        "number": 10,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 8,
                        "jsonName": "registration",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "registration_court",
                        "number": 11,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 9,
                        "jsonName": "registrationCourt",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "name",
                        "number": 12,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 10,
                        "jsonName": "name",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "payment_method_ids",
                        "number": 13,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "paymentMethodIds",
                        "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": "data",
                        "number": 14,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Any",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 11,
                        "jsonName": "data",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_parent_id", "options": undefined },
                    { "name": "_website", "options": undefined },
                    { "name": "_email", "options": undefined },
                    { "name": "_logo", "options": undefined },
                    { "name": "_vat_id", "options": undefined },
                    { "name": "_isic_v4", "options": undefined },
                    { "name": "_registration", "options": undefined },
                    { "name": "_registration_court", "options": undefined },
                    { "name": "_name", "options": undefined },
                    { "name": "_data", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "OrganizationService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.organization.OrganizationListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.organization.OrganizationList",
                        "outputType": ".io.restorecommerce.organization.OrganizationListResponse",
                        "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.organization.OrganizationList",
                        "outputType": ".io.restorecommerce.organization.OrganizationListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.organization.OrganizationList",
                        "outputType": ".io.restorecommerce.organization.OrganizationListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [3, 7],
                    "span": [14, 0, 42],
                    "leadingComments": " Used by resolvers\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 0],
                    "span": [56, 2, 25],
                    "leadingComments": "",
                    "trailingComments": " Organization ID, unique, key\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 2],
                    "span": [58, 2, 66, 4],
                    "leadingComments": "",
                    "trailingComments": "  Hierarchically superior organization; may be null\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 3],
                    "span": [67, 2, 75, 4],
                    "leadingComments": "",
                    "trailingComments": " list of possible legal addresses of different types\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 6],
                    "span": [78, 2, 51],
                    "leadingComments": "",
                    "trailingComments": " base64; arangoDB does not support blob storage\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 5, 2, 13],
                    "span": [93, 2, 41],
                    "leadingComments": "",
                    "trailingComments": " additional data\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.organization.Deleted": exports.Deleted,
        ".io.restorecommerce.organization.DeleteOrgData": exports.DeleteOrgData,
        ".io.restorecommerce.organization.OrganizationList": exports.OrganizationList,
        ".io.restorecommerce.organization.OrganizationListResponse": exports.OrganizationListResponse,
        ".io.restorecommerce.organization.OrganizationResponse": exports.OrganizationResponse,
        ".io.restorecommerce.organization.Organization": exports.Organization,
    },
    dependencies: [
        any_1.protoMetadata,
        resource_base_1.protoMetadata,
        meta_1.protoMetadata,
        auth_1.protoMetadata,
        status_1.protoMetadata,
        image_1.protoMetadata,
        options_1.protoMetadata,
        address_1.protoMetadata,
        contact_point_1.protoMetadata,
        payment_method_1.protoMetadata,
    ],
    options: {
        messages: {
            "Organization": {
                fields: {
                    "parent_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ci0uaW8ucmVzdG9yZWNvbW1lcmNlLm9yZ2FuaXphdGlvbi5Pcmdhbml6YXRpb24SC21hc3Rlcl9kYXRhGgxvcmdhbml6YXRpb24iBFJlYWQqBnBhcmVudA==", "base64")),
                    },
                    "contact_point_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("Ci4uaW8ucmVzdG9yZWNvbW1lcmNlLmNvbnRhY3RfcG9pbnQuQ29udGFjdFBvaW50EgttYXN0ZXJfZGF0YRoNY29udGFjdF9wb2ludCIEUmVhZCoNY29udGFjdFBvaW50cw==", "base64")),
                    },
                    "payment_method_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CjAuaW8ucmVzdG9yZWNvbW1lcmNlLnBheW1lbnRfbWV0aG9kLlBheW1lbnRNZXRob2QSB3BheW1lbnQaDnBheW1lbnRfbWV0aG9kIgRSZWFkKg5wYXltZW50TWV0aG9kcw==", "base64")),
                    },
                },
            },
        },
        services: { "OrganizationService": { methods: { "Read": { "is_query": true } } } },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=organization.js.map