"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/currency.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.CurrencyServiceDefinition = exports.ExchangeRate = exports.Currency = exports.CurrencyResponse = exports.CurrencyListResponse = exports.CurrencyList = exports.SymbolAlignment = exports.protobufPackage = void 0;
exports.symbolAlignmentFromJSON = symbolAlignmentFromJSON;
exports.symbolAlignmentToJSON = symbolAlignmentToJSON;
exports.symbolAlignmentToNumber = symbolAlignmentToNumber;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const timestamp_1 = require("../../google/protobuf/timestamp");
const auth_1 = require("./auth");
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.currency";
var SymbolAlignment;
(function (SymbolAlignment) {
    SymbolAlignment["surfix"] = "surfix";
    SymbolAlignment["prefix"] = "prefix";
    SymbolAlignment["UNRECOGNIZED"] = "UNRECOGNIZED";
})(SymbolAlignment || (exports.SymbolAlignment = SymbolAlignment = {}));
function symbolAlignmentFromJSON(object) {
    switch (object) {
        case 0:
        case "surfix":
            return SymbolAlignment.surfix;
        case 1:
        case "prefix":
            return SymbolAlignment.prefix;
        case -1:
        case "UNRECOGNIZED":
        default:
            return SymbolAlignment.UNRECOGNIZED;
    }
}
function symbolAlignmentToJSON(object) {
    switch (object) {
        case SymbolAlignment.surfix:
            return "surfix";
        case SymbolAlignment.prefix:
            return "prefix";
        case SymbolAlignment.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function symbolAlignmentToNumber(object) {
    switch (object) {
        case SymbolAlignment.surfix:
            return 0;
        case SymbolAlignment.prefix:
            return 1;
        case SymbolAlignment.UNRECOGNIZED:
        default:
            return -1;
    }
}
function createBaseCurrencyList() {
    return {};
}
exports.CurrencyList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Currency.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        if (message.subject !== undefined) {
            auth_1.Subject.encode(message.subject, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseCurrencyList();
        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.Currency.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.subject = auth_1.Subject.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => exports.Currency.fromJSON(e)) : undefined,
            totalCount: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            subject: isSet(object.subject) ? auth_1.Subject.fromJSON(object.subject) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.Currency.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.CurrencyList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCurrencyList();
        message.items = object.items?.map((e) => exports.Currency.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseCurrencyListResponse() {
    return {};
}
exports.CurrencyListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.CurrencyResponse.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            status_1.OperationStatus.encode(message.operationStatus, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseCurrencyListResponse();
        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.CurrencyResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operationStatus = status_1.OperationStatus.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items)
                ? object.items.map((e) => exports.CurrencyResponse.fromJSON(e))
                : undefined,
            totalCount: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            operationStatus: isSet(object.operationStatus)
                ? status_1.OperationStatus.fromJSON(object.operationStatus)
                : isSet(object.operation_status)
                    ? status_1.OperationStatus.fromJSON(object.operation_status)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.CurrencyResponse.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operationStatus);
        }
        return obj;
    },
    create(base) {
        return exports.CurrencyListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCurrencyListResponse();
        message.items = object.items?.map((e) => exports.CurrencyResponse.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.operationStatus = (object.operationStatus !== undefined && object.operationStatus !== null)
            ? status_1.OperationStatus.fromPartial(object.operationStatus)
            : undefined;
        return message;
    },
};
function createBaseCurrencyResponse() {
    return {};
}
exports.CurrencyResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Currency.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 = createBaseCurrencyResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Currency.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.Currency.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.Currency.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.CurrencyResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCurrencyResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Currency.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseCurrency() {
    return {};
}
exports.Currency = {
    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.symbol !== undefined) {
            writer.uint32(34).string(message.symbol);
        }
        if (message.countryIds !== undefined && message.countryIds.length !== 0) {
            for (const v of message.countryIds) {
                writer.uint32(42).string(v);
            }
        }
        if (message.customExchangeRates !== undefined && message.customExchangeRates.length !== 0) {
            for (const v of message.customExchangeRates) {
                exports.ExchangeRate.encode(v, writer.uint32(50).fork()).join();
            }
        }
        if (message.precision !== undefined) {
            writer.uint32(56).int32(message.precision);
        }
        if (message.code !== undefined) {
            writer.uint32(66).string(message.code);
        }
        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 = createBaseCurrency();
        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.symbol = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    if (message.countryIds === undefined) {
                        message.countryIds = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.countryIds.push(el);
                    }
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    if (message.customExchangeRates === undefined) {
                        message.customExchangeRates = [];
                    }
                    const el = exports.ExchangeRate.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.customExchangeRates.push(el);
                    }
                    continue;
                }
                case 7: {
                    if (tag !== 56) {
                        break;
                    }
                    message.precision = reader.int32();
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.code = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            meta: isSet(object.meta) ? meta_1.Meta.fromJSON(object.meta) : undefined,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : undefined,
            countryIds: globalThis.Array.isArray(object?.countryIds)
                ? object.countryIds.map((e) => globalThis.String(e))
                : globalThis.Array.isArray(object?.country_ids)
                    ? object.country_ids.map((e) => globalThis.String(e))
                    : undefined,
            customExchangeRates: globalThis.Array.isArray(object?.customExchangeRates)
                ? object.customExchangeRates.map((e) => exports.ExchangeRate.fromJSON(e))
                : globalThis.Array.isArray(object?.custom_exchange_rates)
                    ? object.custom_exchange_rates.map((e) => exports.ExchangeRate.fromJSON(e))
                    : undefined,
            precision: isSet(object.precision) ? globalThis.Number(object.precision) : undefined,
            code: isSet(object.code) ? globalThis.String(object.code) : 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.symbol !== undefined) {
            obj.symbol = message.symbol;
        }
        if (message.countryIds?.length) {
            obj.countryIds = message.countryIds;
        }
        if (message.customExchangeRates?.length) {
            obj.customExchangeRates = message.customExchangeRates.map((e) => exports.ExchangeRate.toJSON(e));
        }
        if (message.precision !== undefined) {
            obj.precision = Math.round(message.precision);
        }
        if (message.code !== undefined) {
            obj.code = message.code;
        }
        return obj;
    },
    create(base) {
        return exports.Currency.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCurrency();
        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.symbol = object.symbol ?? undefined;
        message.countryIds = object.countryIds?.map((e) => e) || undefined;
        message.customExchangeRates = object.customExchangeRates?.map((e) => exports.ExchangeRate.fromPartial(e)) || undefined;
        message.precision = object.precision ?? undefined;
        message.code = object.code ?? undefined;
        return message;
    },
};
function createBaseExchangeRate() {
    return {};
}
exports.ExchangeRate = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.toCurrencyId !== undefined) {
            writer.uint32(10).string(message.toCurrencyId);
        }
        if (message.rate !== undefined) {
            writer.uint32(25).double(message.rate);
        }
        if (message.expenses !== undefined) {
            writer.uint32(33).double(message.expenses);
        }
        if (message.amount !== undefined) {
            writer.uint32(41).double(message.amount);
        }
        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 = createBaseExchangeRate();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.toCurrencyId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 25) {
                        break;
                    }
                    message.rate = reader.double();
                    continue;
                }
                case 4: {
                    if (tag !== 33) {
                        break;
                    }
                    message.expenses = reader.double();
                    continue;
                }
                case 5: {
                    if (tag !== 41) {
                        break;
                    }
                    message.amount = reader.double();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            toCurrencyId: isSet(object.toCurrencyId)
                ? globalThis.String(object.toCurrencyId)
                : isSet(object.to_currency_id)
                    ? globalThis.String(object.to_currency_id)
                    : undefined,
            rate: isSet(object.rate) ? globalThis.Number(object.rate) : undefined,
            expenses: isSet(object.expenses) ? globalThis.Number(object.expenses) : undefined,
            amount: isSet(object.amount) ? globalThis.Number(object.amount) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.toCurrencyId !== undefined) {
            obj.toCurrencyId = message.toCurrencyId;
        }
        if (message.rate !== undefined) {
            obj.rate = message.rate;
        }
        if (message.expenses !== undefined) {
            obj.expenses = message.expenses;
        }
        if (message.amount !== undefined) {
            obj.amount = message.amount;
        }
        return obj;
    },
    create(base) {
        return exports.ExchangeRate.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseExchangeRate();
        message.toCurrencyId = object.toCurrencyId ?? undefined;
        message.rate = object.rate ?? undefined;
        message.expenses = object.expenses ?? undefined;
        message.amount = object.amount ?? undefined;
        return message;
    },
};
exports.CurrencyServiceDefinition = {
    name: "CurrencyService",
    fullName: "io.restorecommerce.currency.CurrencyService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.CurrencyListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.CurrencyList,
            requestStream: false,
            responseType: exports.CurrencyListResponse,
            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.CurrencyList,
            requestStream: false,
            responseType: exports.CurrencyListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.CurrencyList,
            requestStream: false,
            responseType: exports.CurrencyListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/currency.proto",
        "package": "io.restorecommerce.currency",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
            "google/protobuf/timestamp.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "CurrencyList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.currency.Currency",
                        "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": "CurrencyListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.currency.CurrencyResponse",
                        "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": "CurrencyResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.currency.Currency",
                        "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": "Currency",
                "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": "symbol",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "symbol",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "country_ids",
                        "number": 5,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "countryIds",
                        "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": "custom_exchange_rates",
                        "number": 6,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.currency.ExchangeRate",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "customExchangeRates",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "precision",
                        "number": 7,
                        "label": 1,
                        "type": 5,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "precision",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "code",
                        "number": 8,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "code",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_name", "options": undefined },
                    { "name": "_symbol", "options": undefined },
                    { "name": "_precision", "options": undefined },
                    { "name": "_code", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "ExchangeRate",
                "field": [{
                        "name": "to_currency_id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "toCurrencyId",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "rate",
                        "number": 3,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "rate",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "expenses",
                        "number": 4,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "expenses",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "amount",
                        "number": 5,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "amount",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_to_currency_id", "options": undefined }, { "name": "_rate", "options": undefined }, {
                        "name": "_expenses",
                        "options": undefined,
                    }, { "name": "_amount", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [{
                "name": "SymbolAlignment",
                "value": [{ "name": "surfix", "number": 0, "options": undefined }, {
                        "name": "prefix",
                        "number": 1,
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "service": [{
                "name": "CurrencyService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.currency.CurrencyListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.currency.CurrencyList",
                        "outputType": ".io.restorecommerce.currency.CurrencyListResponse",
                        "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.currency.CurrencyList",
                        "outputType": ".io.restorecommerce.currency.CurrencyListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.currency.CurrencyList",
                        "outputType": ".io.restorecommerce.currency.CurrencyListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [6, 0],
                    "span": [14, 0, 22, 1],
                    "leadingComments": "\n Microservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 5],
                    "span": [64, 2, 50],
                    "leadingComments": "\n For custom exchange rates beyond market.\n Regular rates should be retrived from any API.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 2],
                    "span": [72, 2, 31],
                    "leadingComments": "",
                    "trailingComments": "fees\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 4, 2, 3],
                    "span": [73, 2, 29],
                    "leadingComments": "",
                    "trailingComments": " leave empty == 1.0\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.currency.SymbolAlignment": SymbolAlignment,
        ".io.restorecommerce.currency.CurrencyList": exports.CurrencyList,
        ".io.restorecommerce.currency.CurrencyListResponse": exports.CurrencyListResponse,
        ".io.restorecommerce.currency.CurrencyResponse": exports.CurrencyResponse,
        ".io.restorecommerce.currency.Currency": exports.Currency,
        ".io.restorecommerce.currency.ExchangeRate": exports.ExchangeRate,
    },
    dependencies: [resource_base_1.protoMetadata, meta_1.protoMetadata, auth_1.protoMetadata, status_1.protoMetadata, options_1.protoMetadata, timestamp_1.protoMetadata],
    options: {
        messages: {
            "Currency": {
                fields: {
                    "country_ids": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiMuaW8ucmVzdG9yZWNvbW1lcmNlLmNvdW50cnkuQ291bnRyeRILbWFzdGVyX2RhdGEaB2NvdW50cnkiBFJlYWQqCWNvdW50cmllcw==", "base64")),
                    },
                },
            },
        },
        services: { "CurrencyService": { methods: { "Read": { "is_query": true } } } },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=currency.js.map