"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/country.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.CountryServiceDefinition = exports.Country_LocaleName = exports.Country = exports.CountryResponse = exports.CountryListResponse = exports.CountryList = exports.Deleted = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const auth_1 = require("./auth");
const locale_1 = require("./locale");
const meta_1 = require("./meta");
const options_1 = require("./options");
const resource_base_1 = require("./resource_base");
const status_1 = require("./status");
exports.protobufPackage = "io.restorecommerce.country";
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 createBaseCountryList() {
    return {};
}
exports.CountryList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Country.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 = createBaseCountryList();
        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.Country.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.Country.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.Country.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.CountryList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCountryList();
        message.items = object.items?.map((e) => exports.Country.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 createBaseCountryListResponse() {
    return {};
}
exports.CountryListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.CountryResponse.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 = createBaseCountryListResponse();
        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.CountryResponse.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.CountryResponse.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.CountryResponse.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.CountryListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCountryListResponse();
        message.items = object.items?.map((e) => exports.CountryResponse.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 createBaseCountryResponse() {
    return {};
}
exports.CountryResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Country.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 = createBaseCountryResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Country.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.Country.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.Country.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.CountryResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCountryResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Country.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseCountry() {
    return {};
}
exports.Country = {
    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.name !== undefined) {
            writer.uint32(26).string(message.name);
        }
        if (message.country_code !== undefined) {
            writer.uint32(34).string(message.country_code);
        }
        if (message.geographical_name !== undefined) {
            writer.uint32(42).string(message.geographical_name);
        }
        if (message.economic_areas !== undefined && message.economic_areas.length !== 0) {
            for (const v of message.economic_areas) {
                writer.uint32(50).string(v);
            }
        }
        if (message.country_code_alpha_2 !== undefined) {
            writer.uint32(58).string(message.country_code_alpha_2);
        }
        if (message.country_code_alpha_3 !== undefined) {
            writer.uint32(66).string(message.country_code_alpha_3);
        }
        if (message.locale_ids !== undefined && message.locale_ids.length !== 0) {
            for (const v of message.locale_ids) {
                writer.uint32(74).string(v);
            }
        }
        if (message.localized_names !== undefined && message.localized_names.length !== 0) {
            for (const v of message.localized_names) {
                exports.Country_LocaleName.encode(v, writer.uint32(82).fork()).join();
            }
        }
        if (message.timezone_ids !== undefined && message.timezone_ids.length !== 0) {
            for (const v of message.timezone_ids) {
                writer.uint32(90).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 = createBaseCountry();
        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.name = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.country_code = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.geographical_name = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    if (message.economic_areas === undefined) {
                        message.economic_areas = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.economic_areas.push(el);
                    }
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.country_code_alpha_2 = reader.string();
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.country_code_alpha_3 = reader.string();
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        break;
                    }
                    if (message.locale_ids === undefined) {
                        message.locale_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.locale_ids.push(el);
                    }
                    continue;
                }
                case 10: {
                    if (tag !== 82) {
                        break;
                    }
                    if (message.localized_names === undefined) {
                        message.localized_names = [];
                    }
                    const el = exports.Country_LocaleName.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.localized_names.push(el);
                    }
                    continue;
                }
                case 11: {
                    if (tag !== 90) {
                        break;
                    }
                    if (message.timezone_ids === undefined) {
                        message.timezone_ids = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.timezone_ids.push(el);
                    }
                    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,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            country_code: isSet(object.countryCode)
                ? globalThis.String(object.countryCode)
                : isSet(object.country_code)
                    ? globalThis.String(object.country_code)
                    : undefined,
            geographical_name: isSet(object.geographicalName)
                ? globalThis.String(object.geographicalName)
                : isSet(object.geographical_name)
                    ? globalThis.String(object.geographical_name)
                    : undefined,
            economic_areas: globalThis.Array.isArray(object?.economicAreas)
                ? object.economicAreas.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.economic_areas)
                    ? object.economic_areas.map((e) => globalThis.String(e))
                    : undefined,
            country_code_alpha_2: isSet(object.countryCodeAlpha2)
                ? globalThis.String(object.countryCodeAlpha2)
                : isSet(object.country_code_alpha_2)
                    ? globalThis.String(object.country_code_alpha_2)
                    : undefined,
            country_code_alpha_3: isSet(object.countryCodeAlpha3)
                ? globalThis.String(object.countryCodeAlpha3)
                : isSet(object.country_code_alpha_3)
                    ? globalThis.String(object.country_code_alpha_3)
                    : undefined,
            locale_ids: globalThis.Array.isArray(object?.localeIds)
                ? object.localeIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.locale_ids)
                    ? object.locale_ids.map((e) => globalThis.String(e))
                    : undefined,
            localized_names: globalThis.Array.isArray(object?.localizedNames)
                ? object.localizedNames.map((e) => exports.Country_LocaleName.fromJSON(e))
                : globalThis.Array.isArray(object?.localized_names)
                    ? object.localized_names.map((e) => exports.Country_LocaleName.fromJSON(e))
                    : undefined,
            timezone_ids: globalThis.Array.isArray(object?.timezoneIds)
                ? object.timezoneIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.timezone_ids)
                    ? object.timezone_ids.map((e) => globalThis.String(e))
                    : 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.name !== undefined) {
            obj.name = message.name;
        }
        if (message.country_code !== undefined) {
            obj.countryCode = message.country_code;
        }
        if (message.geographical_name !== undefined) {
            obj.geographicalName = message.geographical_name;
        }
        if (message.economic_areas?.length) {
            obj.economicAreas = message.economic_areas;
        }
        if (message.country_code_alpha_2 !== undefined) {
            obj.countryCodeAlpha2 = message.country_code_alpha_2;
        }
        if (message.country_code_alpha_3 !== undefined) {
            obj.countryCodeAlpha3 = message.country_code_alpha_3;
        }
        if (message.locale_ids?.length) {
            obj.localeIds = message.locale_ids;
        }
        if (message.localized_names?.length) {
            obj.localizedNames = message.localized_names.map((e) => exports.Country_LocaleName.toJSON(e));
        }
        if (message.timezone_ids?.length) {
            obj.timezoneIds = message.timezone_ids;
        }
        return obj;
    },
    create(base) {
        return exports.Country.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCountry();
        message.id = object.id ?? undefined;
        message.meta = (object.meta !== undefined && object.meta !== null) ? meta_1.Meta.fromPartial(object.meta) : undefined;
        message.name = object.name ?? undefined;
        message.country_code = object.country_code ?? undefined;
        message.geographical_name = object.geographical_name ?? undefined;
        message.economic_areas = object.economic_areas?.map((e) => e) || undefined;
        message.country_code_alpha_2 = object.country_code_alpha_2 ?? undefined;
        message.country_code_alpha_3 = object.country_code_alpha_3 ?? undefined;
        message.locale_ids = object.locale_ids?.map((e) => e) || undefined;
        message.localized_names = object.localized_names?.map((e) => exports.Country_LocaleName.fromPartial(e)) || undefined;
        message.timezone_ids = object.timezone_ids?.map((e) => e) || undefined;
        return message;
    },
};
function createBaseCountry_LocaleName() {
    return {};
}
exports.Country_LocaleName = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.locale !== undefined) {
            writer.uint32(10).string(message.locale);
        }
        if (message.name !== undefined) {
            writer.uint32(18).string(message.name);
        }
        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 = createBaseCountry_LocaleName();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.locale = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            locale: isSet(object.locale) ? globalThis.String(object.locale) : undefined,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.locale !== undefined) {
            obj.locale = message.locale;
        }
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        return obj;
    },
    create(base) {
        return exports.Country_LocaleName.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCountry_LocaleName();
        message.locale = object.locale ?? undefined;
        message.name = object.name ?? undefined;
        return message;
    },
};
exports.CountryServiceDefinition = {
    name: "CountryService",
    fullName: "io.restorecommerce.country.CountryService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.CountryListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.CountryList,
            requestStream: false,
            responseType: exports.CountryListResponse,
            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.CountryList,
            requestStream: false,
            responseType: exports.CountryListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.CountryList,
            requestStream: false,
            responseType: exports.CountryListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/country.proto",
        "package": "io.restorecommerce.country",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
            "io/restorecommerce/locale.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": "CountryList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.country.Country",
                        "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": "CountryListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.country.CountryResponse",
                        "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": "CountryResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.country.Country",
                        "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": "Country",
                "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": "name",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "name",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "country_code",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "countryCode",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "geographical_name",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "geographicalName",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "economic_areas",
                        "number": 6,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "economicAreas",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "country_code_alpha_2",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "countryCodeAlpha2",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "country_code_alpha_3",
                        "number": 8,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 6,
                        "jsonName": "countryCodeAlpha3",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "locale_ids",
                        "number": 9,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "localeIds",
                        "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": "localized_names",
                        "number": 10,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.country.Country.LocaleName",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "localizedNames",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "timezone_ids",
                        "number": 11,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "timezoneIds",
                        "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": [{
                        "name": "LocaleName",
                        "field": [{
                                "name": "locale",
                                "number": 1,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 0,
                                "jsonName": "locale",
                                "options": undefined,
                                "proto3Optional": true,
                            }, {
                                "name": "name",
                                "number": 2,
                                "label": 1,
                                "type": 9,
                                "typeName": "",
                                "extendee": "",
                                "defaultValue": "",
                                "oneofIndex": 1,
                                "jsonName": "name",
                                "options": undefined,
                                "proto3Optional": true,
                            }],
                        "extension": [],
                        "nestedType": [],
                        "enumType": [],
                        "extensionRange": [],
                        "oneofDecl": [{ "name": "_locale", "options": undefined }, { "name": "_name", "options": undefined }],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_name", "options": undefined },
                    { "name": "_country_code", "options": undefined },
                    { "name": "_geographical_name", "options": undefined },
                    { "name": "_country_code_alpha_2", "options": undefined },
                    { "name": "_country_code_alpha_3", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "CountryService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.country.CountryListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.country.CountryList",
                        "outputType": ".io.restorecommerce.country.CountryListResponse",
                        "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.country.CountryList",
                        "outputType": ".io.restorecommerce.country.CountryListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.country.CountryList",
                        "outputType": ".io.restorecommerce.country.CountryListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [3, 5],
                    "span": [11, 0, 41],
                    "leadingComments": " Used by resolvers\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [6, 0],
                    "span": [16, 0, 24, 1],
                    "leadingComments": "\n Microservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 3],
                    "span": [56, 2, 35],
                    "leadingComments": "",
                    "trailingComments": " primaly used in target application (fallback)\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 6],
                    "span": [59, 2, 43],
                    "leadingComments": "",
                    "trailingComments": " ISO 3166-1 alpha-2\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 7],
                    "span": [60, 2, 43],
                    "leadingComments": "",
                    "trailingComments": " ISO 3166-1 alpha-3\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 8],
                    "span": [61, 2, 69, 4],
                    "leadingComments": "",
                    "trailingComments": " list of common locale in this country, sorted by priority first\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 9],
                    "span": [70, 2, 43],
                    "leadingComments": "",
                    "trailingComments": " list of localized names\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 10],
                    "span": [71, 2, 79, 4],
                    "leadingComments": "",
                    "trailingComments": " list of avalable timezones in this country\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.country.Deleted": exports.Deleted,
        ".io.restorecommerce.country.CountryList": exports.CountryList,
        ".io.restorecommerce.country.CountryListResponse": exports.CountryListResponse,
        ".io.restorecommerce.country.CountryResponse": exports.CountryResponse,
        ".io.restorecommerce.country.Country": exports.Country,
        ".io.restorecommerce.country.Country.LocaleName": exports.Country_LocaleName,
    },
    dependencies: [resource_base_1.protoMetadata, meta_1.protoMetadata, auth_1.protoMetadata, status_1.protoMetadata, options_1.protoMetadata, locale_1.protoMetadata],
    options: {
        messages: {
            "Country": {
                fields: {
                    "locale_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiEuaW8ucmVzdG9yZWNvbW1lcmNlLmxvY2FsZS5Mb2NhbGUSC21hc3Rlcl9kYXRhGgZsb2NhbGUiBFJlYWQqB2xvY2FsZXM=", "base64")),
                    },
                    "timezone_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiUuaW8ucmVzdG9yZWNvbW1lcmNlLnRpbWV6b25lLlRpbWV6b25lEgttYXN0ZXJfZGF0YRoIdGltZXpvbmUiBFJlYWQqCXRpbWV6b25lcw==", "base64")),
                    },
                },
            },
        },
        services: { "CountryService": { methods: { "Read": { "is_query": true } } } },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=country.js.map