"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/command.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.CommandServiceDefinition = exports.CommandResponse = exports.CommandListResponse = exports.CommandList = exports.CommandParameter = exports.Command = exports.CommandParameter_ParameterType = exports.protobufPackage = void 0;
exports.commandParameter_ParameterTypeFromJSON = commandParameter_ParameterTypeFromJSON;
exports.commandParameter_ParameterTypeToJSON = commandParameter_ParameterTypeToJSON;
exports.commandParameter_ParameterTypeToNumber = commandParameter_ParameterTypeToNumber;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
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.command";
var CommandParameter_ParameterType;
(function (CommandParameter_ParameterType) {
    CommandParameter_ParameterType["boolean_value"] = "boolean_value";
    CommandParameter_ParameterType["object_value"] = "object_value";
    CommandParameter_ParameterType["array_value"] = "array_value";
    CommandParameter_ParameterType["number_value"] = "number_value";
    CommandParameter_ParameterType["string_value"] = "string_value";
    CommandParameter_ParameterType["UNRECOGNIZED"] = "UNRECOGNIZED";
})(CommandParameter_ParameterType || (exports.CommandParameter_ParameterType = CommandParameter_ParameterType = {}));
function commandParameter_ParameterTypeFromJSON(object) {
    switch (object) {
        case 0:
        case "boolean_value":
            return CommandParameter_ParameterType.boolean_value;
        case 1:
        case "object_value":
            return CommandParameter_ParameterType.object_value;
        case 2:
        case "array_value":
            return CommandParameter_ParameterType.array_value;
        case 3:
        case "number_value":
            return CommandParameter_ParameterType.number_value;
        case 4:
        case "string_value":
            return CommandParameter_ParameterType.string_value;
        case -1:
        case "UNRECOGNIZED":
        default:
            return CommandParameter_ParameterType.UNRECOGNIZED;
    }
}
function commandParameter_ParameterTypeToJSON(object) {
    switch (object) {
        case CommandParameter_ParameterType.boolean_value:
            return "boolean_value";
        case CommandParameter_ParameterType.object_value:
            return "object_value";
        case CommandParameter_ParameterType.array_value:
            return "array_value";
        case CommandParameter_ParameterType.number_value:
            return "number_value";
        case CommandParameter_ParameterType.string_value:
            return "string_value";
        case CommandParameter_ParameterType.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function commandParameter_ParameterTypeToNumber(object) {
    switch (object) {
        case CommandParameter_ParameterType.boolean_value:
            return 0;
        case CommandParameter_ParameterType.object_value:
            return 1;
        case CommandParameter_ParameterType.array_value:
            return 2;
        case CommandParameter_ParameterType.number_value:
            return 3;
        case CommandParameter_ParameterType.string_value:
            return 4;
        case CommandParameter_ParameterType.UNRECOGNIZED:
        default:
            return -1;
    }
}
function createBaseCommand() {
    return {};
}
exports.Command = {
    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.parameters !== undefined && message.parameters.length !== 0) {
            for (const v of message.parameters) {
                exports.CommandParameter.encode(v, writer.uint32(34).fork()).join();
            }
        }
        if (message.description !== undefined) {
            writer.uint32(42).string(message.description);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseCommand();
        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;
                    }
                    if (message.parameters === undefined) {
                        message.parameters = [];
                    }
                    const el = exports.CommandParameter.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.parameters.push(el);
                    }
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.description = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            meta: isSet(object.meta) ? meta_1.Meta.fromJSON(object.meta) : undefined,
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            parameters: globalThis.Array.isArray(object?.parameters)
                ? object.parameters.map((e) => exports.CommandParameter.fromJSON(e))
                : undefined,
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.meta !== undefined) {
            obj.meta = meta_1.Meta.toJSON(message.meta);
        }
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        if (message.parameters?.length) {
            obj.parameters = message.parameters.map((e) => exports.CommandParameter.toJSON(e));
        }
        if (message.description !== undefined) {
            obj.description = message.description;
        }
        return obj;
    },
    create(base) {
        return exports.Command.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommand();
        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.parameters = object.parameters?.map((e) => exports.CommandParameter.fromPartial(e)) || undefined;
        message.description = object.description ?? undefined;
        return message;
    },
};
function createBaseCommandParameter() {
    return {};
}
exports.CommandParameter = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.field !== undefined) {
            writer.uint32(10).string(message.field);
        }
        if (message.description !== undefined) {
            writer.uint32(18).string(message.description);
        }
        if (message.type !== undefined) {
            writer.uint32(24).int32(commandParameter_ParameterTypeToNumber(message.type));
        }
        if (message.properties !== undefined) {
            writer.uint32(34).string(message.properties);
        }
        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 = createBaseCommandParameter();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.field = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.description = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.type = commandParameter_ParameterTypeFromJSON(reader.int32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.properties = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            field: isSet(object.field) ? globalThis.String(object.field) : undefined,
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
            type: isSet(object.type) ? commandParameter_ParameterTypeFromJSON(object.type) : undefined,
            properties: isSet(object.properties) ? globalThis.String(object.properties) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.field !== undefined) {
            obj.field = message.field;
        }
        if (message.description !== undefined) {
            obj.description = message.description;
        }
        if (message.type !== undefined) {
            obj.type = commandParameter_ParameterTypeToJSON(message.type);
        }
        if (message.properties !== undefined) {
            obj.properties = message.properties;
        }
        return obj;
    },
    create(base) {
        return exports.CommandParameter.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommandParameter();
        message.field = object.field ?? undefined;
        message.description = object.description ?? undefined;
        message.type = object.type ?? undefined;
        message.properties = object.properties ?? undefined;
        return message;
    },
};
function createBaseCommandList() {
    return {};
}
exports.CommandList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Command.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 = createBaseCommandList();
        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.Command.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.Command.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.Command.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.CommandList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommandList();
        message.items = object.items?.map((e) => exports.Command.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 createBaseCommandListResponse() {
    return {};
}
exports.CommandListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.CommandResponse.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 = createBaseCommandListResponse();
        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.CommandResponse.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.CommandResponse.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.CommandResponse.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.CommandListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommandListResponse();
        message.items = object.items?.map((e) => exports.CommandResponse.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 createBaseCommandResponse() {
    return {};
}
exports.CommandResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Command.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 = createBaseCommandResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Command.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.Command.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.Command.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.CommandResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCommandResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Command.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
exports.CommandServiceDefinition = {
    name: "CommandService",
    fullName: "io.restorecommerce.command.CommandService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.CommandListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.CommandList,
            requestStream: false,
            responseType: exports.CommandListResponse,
            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.CommandList,
            requestStream: false,
            responseType: exports.CommandListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.CommandList,
            requestStream: false,
            responseType: exports.CommandListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/command.proto",
        "package": "io.restorecommerce.command",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Command",
                "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": "parameters",
                        "number": 4,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.command.CommandParameter",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "parameters",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "description",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "description",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_meta", "options": undefined }, {
                        "name": "_name",
                        "options": undefined,
                    }, { "name": "_description", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "CommandParameter",
                "field": [{
                        "name": "field",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "field",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "description",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "description",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "type",
                        "number": 3,
                        "label": 1,
                        "type": 14,
                        "typeName": ".io.restorecommerce.command.CommandParameter.ParameterType",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "type",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "properties",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "properties",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [{
                        "name": "ParameterType",
                        "value": [
                            { "name": "boolean_value", "number": 0, "options": undefined },
                            { "name": "object_value", "number": 1, "options": undefined },
                            { "name": "array_value", "number": 2, "options": undefined },
                            { "name": "number_value", "number": 3, "options": undefined },
                            { "name": "string_value", "number": 4, "options": undefined },
                        ],
                        "options": undefined,
                        "reservedRange": [],
                        "reservedName": [],
                        "visibility": 0,
                    }],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_field", "options": undefined }, { "name": "_description", "options": undefined }, {
                        "name": "_type",
                        "options": undefined,
                    }, { "name": "_properties", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "CommandList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.command.Command",
                        "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": "CommandListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.command.CommandResponse",
                        "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": "CommandResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.command.Command",
                        "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,
            }],
        "enumType": [],
        "service": [{
                "name": "CommandService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.command.CommandListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.command.CommandList",
                        "outputType": ".io.restorecommerce.command.CommandListResponse",
                        "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.command.CommandList",
                        "outputType": ".io.restorecommerce.command.CommandListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.command.CommandList",
                        "outputType": ".io.restorecommerce.command.CommandListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [4, 0],
                    "span": [11, 0, 17, 1],
                    "leadingComments": " command resource\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 2],
                    "span": [14, 2, 27],
                    "leadingComments": "",
                    "trailingComments": " command name\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 3],
                    "span": [15, 2, 43],
                    "leadingComments": "",
                    "trailingComments": " all possible parameters\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 0, 2, 4],
                    "span": [16, 2, 34],
                    "leadingComments": "",
                    "trailingComments": " command description\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 0],
                    "span": [28, 2, 28],
                    "leadingComments": "",
                    "trailingComments": "  field name\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 1],
                    "span": [29, 2, 34],
                    "leadingComments": "",
                    "trailingComments": " field description\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 2],
                    "span": [30, 2, 34],
                    "leadingComments": "",
                    "trailingComments": " field's type\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 1, 2, 3],
                    "span": [31, 2, 33],
                    "leadingComments": "",
                    "trailingComments": " dump properties in case of `object_value``\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.command.Command": exports.Command,
        ".io.restorecommerce.command.CommandParameter": exports.CommandParameter,
        ".io.restorecommerce.command.CommandParameter.ParameterType": CommandParameter_ParameterType,
        ".io.restorecommerce.command.CommandList": exports.CommandList,
        ".io.restorecommerce.command.CommandListResponse": exports.CommandListResponse,
        ".io.restorecommerce.command.CommandResponse": exports.CommandResponse,
    },
    dependencies: [resource_base_1.protoMetadata, meta_1.protoMetadata, auth_1.protoMetadata, status_1.protoMetadata, options_1.protoMetadata],
    options: { services: { "CommandService": { methods: { "Read": { "is_query": true } } } } },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=command.js.map