"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/policy_set.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.PolicySetServiceDefinition = exports.PolicySetRQ = exports.PolicySetResponse = exports.PolicySetListResponse = exports.PolicySetList = exports.PolicySet = exports.protobufPackage = void 0;
/* 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 policy_1 = require("./policy");
const resource_base_1 = require("./resource_base");
const rule_1 = require("./rule");
const status_1 = require("./status");
exports.protobufPackage = "io.restorecommerce.policy_set";
function createBasePolicySet() {
    return {};
}
exports.PolicySet = {
    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.description !== undefined) {
            writer.uint32(34).string(message.description);
        }
        if (message.target !== undefined) {
            rule_1.Target.encode(message.target, writer.uint32(42).fork()).join();
        }
        if (message.combiningAlgorithm !== undefined) {
            writer.uint32(50).string(message.combiningAlgorithm);
        }
        if (message.policies !== undefined && message.policies.length !== 0) {
            for (const v of message.policies) {
                writer.uint32(58).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 = createBasePolicySet();
        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.description = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.target = rule_1.Target.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.combiningAlgorithm = reader.string();
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    if (message.policies === undefined) {
                        message.policies = [];
                    }
                    const el = reader.string();
                    if (el !== undefined) {
                        message.policies.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,
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
            target: isSet(object.target) ? rule_1.Target.fromJSON(object.target) : undefined,
            combiningAlgorithm: isSet(object.combiningAlgorithm)
                ? globalThis.String(object.combiningAlgorithm)
                : isSet(object.combining_algorithm)
                    ? globalThis.String(object.combining_algorithm)
                    : undefined,
            policies: globalThis.Array.isArray(object?.policies)
                ? object.policies.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.description !== undefined) {
            obj.description = message.description;
        }
        if (message.target !== undefined) {
            obj.target = rule_1.Target.toJSON(message.target);
        }
        if (message.combiningAlgorithm !== undefined) {
            obj.combiningAlgorithm = message.combiningAlgorithm;
        }
        if (message.policies?.length) {
            obj.policies = message.policies;
        }
        return obj;
    },
    create(base) {
        return exports.PolicySet.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePolicySet();
        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.description = object.description ?? undefined;
        message.target = (object.target !== undefined && object.target !== null)
            ? rule_1.Target.fromPartial(object.target)
            : undefined;
        message.combiningAlgorithm = object.combiningAlgorithm ?? undefined;
        message.policies = object.policies?.map((e) => e) || undefined;
        return message;
    },
};
function createBasePolicySetList() {
    return {};
}
exports.PolicySetList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.PolicySet.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 = createBasePolicySetList();
        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.PolicySet.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.PolicySet.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.PolicySet.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.PolicySetList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePolicySetList();
        message.items = object.items?.map((e) => exports.PolicySet.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 createBasePolicySetListResponse() {
    return {};
}
exports.PolicySetListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.PolicySetResponse.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 = createBasePolicySetListResponse();
        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.PolicySetResponse.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.PolicySetResponse.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.PolicySetResponse.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.PolicySetListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePolicySetListResponse();
        message.items = object.items?.map((e) => exports.PolicySetResponse.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 createBasePolicySetResponse() {
    return {};
}
exports.PolicySetResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.PolicySet.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 = createBasePolicySetResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.PolicySet.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.PolicySet.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.PolicySet.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.PolicySetResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePolicySetResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.PolicySet.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBasePolicySetRQ() {
    return {};
}
exports.PolicySetRQ = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.target !== undefined) {
            rule_1.Target.encode(message.target, writer.uint32(18).fork()).join();
        }
        if (message.combiningAlgorithm !== undefined) {
            writer.uint32(26).string(message.combiningAlgorithm);
        }
        if (message.policies !== undefined && message.policies.length !== 0) {
            for (const v of message.policies) {
                policy_1.PolicyRQ.encode(v, writer.uint32(34).fork()).join();
            }
        }
        if (message.effect !== undefined) {
            writer.uint32(40).int32((0, rule_1.effectToNumber)(message.effect));
        }
        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 = createBasePolicySetRQ();
        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.target = rule_1.Target.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.combiningAlgorithm = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    if (message.policies === undefined) {
                        message.policies = [];
                    }
                    const el = policy_1.PolicyRQ.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.policies.push(el);
                    }
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.effect = (0, rule_1.effectFromJSON)(reader.int32());
                    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,
            target: isSet(object.target) ? rule_1.Target.fromJSON(object.target) : undefined,
            combiningAlgorithm: isSet(object.combiningAlgorithm)
                ? globalThis.String(object.combiningAlgorithm)
                : isSet(object.combining_algorithm)
                    ? globalThis.String(object.combining_algorithm)
                    : undefined,
            policies: globalThis.Array.isArray(object?.policies)
                ? object.policies.map((e) => policy_1.PolicyRQ.fromJSON(e))
                : undefined,
            effect: isSet(object.effect) ? (0, rule_1.effectFromJSON)(object.effect) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.target !== undefined) {
            obj.target = rule_1.Target.toJSON(message.target);
        }
        if (message.combiningAlgorithm !== undefined) {
            obj.combiningAlgorithm = message.combiningAlgorithm;
        }
        if (message.policies?.length) {
            obj.policies = message.policies.map((e) => policy_1.PolicyRQ.toJSON(e));
        }
        if (message.effect !== undefined) {
            obj.effect = (0, rule_1.effectToJSON)(message.effect);
        }
        return obj;
    },
    create(base) {
        return exports.PolicySetRQ.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePolicySetRQ();
        message.id = object.id ?? undefined;
        message.target = (object.target !== undefined && object.target !== null)
            ? rule_1.Target.fromPartial(object.target)
            : undefined;
        message.combiningAlgorithm = object.combiningAlgorithm ?? undefined;
        message.policies = object.policies?.map((e) => policy_1.PolicyRQ.fromPartial(e)) || undefined;
        message.effect = object.effect ?? undefined;
        return message;
    },
};
exports.PolicySetServiceDefinition = {
    name: "PolicySetService",
    fullName: "io.restorecommerce.policy_set.PolicySetService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.PolicySetListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.PolicySetList,
            requestStream: false,
            responseType: exports.PolicySetListResponse,
            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.PolicySetList,
            requestStream: false,
            responseType: exports.PolicySetListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.PolicySetList,
            requestStream: false,
            responseType: exports.PolicySetListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/policy_set.proto",
        "package": "io.restorecommerce.policy_set",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/policy.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/rule.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "PolicySet",
                "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": "description",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "description",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "target",
                        "number": 5,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rule.Target",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "target",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "combining_algorithm",
                        "number": 6,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "combiningAlgorithm",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "policies",
                        "number": 7,
                        "label": 3,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "policies",
                        "options": undefined,
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_name", "options": undefined },
                    { "name": "_description", "options": undefined },
                    { "name": "_target", "options": undefined },
                    { "name": "_combining_algorithm", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "PolicySetList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.policy_set.PolicySet",
                        "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": "PolicySetListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.policy_set.PolicySetResponse",
                        "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": "PolicySetResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.policy_set.PolicySet",
                        "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": "PolicySetRQ",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "target",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.rule.Target",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "target",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "combining_algorithm",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "combiningAlgorithm",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "policies",
                        "number": 4,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.policy.PolicyRQ",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "policies",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "effect",
                        "number": 5,
                        "label": 1,
                        "type": 14,
                        "typeName": ".io.restorecommerce.rule.Effect",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "effect",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }, { "name": "_target", "options": undefined }, {
                        "name": "_combining_algorithm",
                        "options": undefined,
                    }, { "name": "_effect", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "PolicySetService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.policy_set.PolicySetListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.policy_set.PolicySetList",
                        "outputType": ".io.restorecommerce.policy_set.PolicySetListResponse",
                        "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.policy_set.PolicySetList",
                        "outputType": ".io.restorecommerce.policy_set.PolicySetListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.policy_set.PolicySetList",
                        "outputType": ".io.restorecommerce.policy_set.PolicySetListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [4, 0, 2, 6],
                    "span": [19, 2, 31],
                    "leadingComments": "",
                    "trailingComments": " policy IDs\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.policy_set.PolicySet": exports.PolicySet,
        ".io.restorecommerce.policy_set.PolicySetList": exports.PolicySetList,
        ".io.restorecommerce.policy_set.PolicySetListResponse": exports.PolicySetListResponse,
        ".io.restorecommerce.policy_set.PolicySetResponse": exports.PolicySetResponse,
        ".io.restorecommerce.policy_set.PolicySetRQ": exports.PolicySetRQ,
    },
    dependencies: [
        resource_base_1.protoMetadata,
        meta_1.protoMetadata,
        policy_1.protoMetadata,
        auth_1.protoMetadata,
        rule_1.protoMetadata,
        status_1.protoMetadata,
        options_1.protoMetadata,
    ],
    options: { services: { "PolicySetService": { methods: { "Read": { "is_query": true } } } } },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=policy_set.js.map