"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v1.176.0
//   protoc               v3.19.1
// source: v1/tenants.proto
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tenant = exports.TenantsGetReply = exports.TenantNames = exports.TenantsGetRequest = exports.TenantActivityStatus = exports.protobufPackage = void 0;
exports.tenantActivityStatusFromJSON = tenantActivityStatusFromJSON;
exports.tenantActivityStatusToJSON = tenantActivityStatusToJSON;
/* eslint-disable */
const minimal_js_1 = __importDefault(require("protobufjs/minimal.js"));
exports.protobufPackage = "weaviate.v1";
var TenantActivityStatus;
(function (TenantActivityStatus) {
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_UNSPECIFIED"] = 0] = "TENANT_ACTIVITY_STATUS_UNSPECIFIED";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_HOT"] = 1] = "TENANT_ACTIVITY_STATUS_HOT";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_COLD"] = 2] = "TENANT_ACTIVITY_STATUS_COLD";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_FROZEN"] = 4] = "TENANT_ACTIVITY_STATUS_FROZEN";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_UNFREEZING"] = 5] = "TENANT_ACTIVITY_STATUS_UNFREEZING";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_FREEZING"] = 6] = "TENANT_ACTIVITY_STATUS_FREEZING";
    /** TENANT_ACTIVITY_STATUS_ACTIVE - not used yet - added to let the clients already add code to handle this in the future */
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_ACTIVE"] = 7] = "TENANT_ACTIVITY_STATUS_ACTIVE";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_INACTIVE"] = 8] = "TENANT_ACTIVITY_STATUS_INACTIVE";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_OFFLOADED"] = 9] = "TENANT_ACTIVITY_STATUS_OFFLOADED";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_OFFLOADING"] = 10] = "TENANT_ACTIVITY_STATUS_OFFLOADING";
    TenantActivityStatus[TenantActivityStatus["TENANT_ACTIVITY_STATUS_ONLOADING"] = 11] = "TENANT_ACTIVITY_STATUS_ONLOADING";
    TenantActivityStatus[TenantActivityStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(TenantActivityStatus || (exports.TenantActivityStatus = TenantActivityStatus = {}));
function tenantActivityStatusFromJSON(object) {
    switch (object) {
        case 0:
        case "TENANT_ACTIVITY_STATUS_UNSPECIFIED":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_UNSPECIFIED;
        case 1:
        case "TENANT_ACTIVITY_STATUS_HOT":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_HOT;
        case 2:
        case "TENANT_ACTIVITY_STATUS_COLD":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_COLD;
        case 4:
        case "TENANT_ACTIVITY_STATUS_FROZEN":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_FROZEN;
        case 5:
        case "TENANT_ACTIVITY_STATUS_UNFREEZING":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_UNFREEZING;
        case 6:
        case "TENANT_ACTIVITY_STATUS_FREEZING":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_FREEZING;
        case 7:
        case "TENANT_ACTIVITY_STATUS_ACTIVE":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_ACTIVE;
        case 8:
        case "TENANT_ACTIVITY_STATUS_INACTIVE":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_INACTIVE;
        case 9:
        case "TENANT_ACTIVITY_STATUS_OFFLOADED":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_OFFLOADED;
        case 10:
        case "TENANT_ACTIVITY_STATUS_OFFLOADING":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_OFFLOADING;
        case 11:
        case "TENANT_ACTIVITY_STATUS_ONLOADING":
            return TenantActivityStatus.TENANT_ACTIVITY_STATUS_ONLOADING;
        case -1:
        case "UNRECOGNIZED":
        default:
            return TenantActivityStatus.UNRECOGNIZED;
    }
}
function tenantActivityStatusToJSON(object) {
    switch (object) {
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_UNSPECIFIED:
            return "TENANT_ACTIVITY_STATUS_UNSPECIFIED";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_HOT:
            return "TENANT_ACTIVITY_STATUS_HOT";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_COLD:
            return "TENANT_ACTIVITY_STATUS_COLD";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_FROZEN:
            return "TENANT_ACTIVITY_STATUS_FROZEN";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_UNFREEZING:
            return "TENANT_ACTIVITY_STATUS_UNFREEZING";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_FREEZING:
            return "TENANT_ACTIVITY_STATUS_FREEZING";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_ACTIVE:
            return "TENANT_ACTIVITY_STATUS_ACTIVE";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_INACTIVE:
            return "TENANT_ACTIVITY_STATUS_INACTIVE";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_OFFLOADED:
            return "TENANT_ACTIVITY_STATUS_OFFLOADED";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_OFFLOADING:
            return "TENANT_ACTIVITY_STATUS_OFFLOADING";
        case TenantActivityStatus.TENANT_ACTIVITY_STATUS_ONLOADING:
            return "TENANT_ACTIVITY_STATUS_ONLOADING";
        case TenantActivityStatus.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function createBaseTenantsGetRequest() {
    return { collection: "", names: undefined };
}
exports.TenantsGetRequest = {
    encode(message, writer = minimal_js_1.default.Writer.create()) {
        if (message.collection !== "") {
            writer.uint32(10).string(message.collection);
        }
        if (message.names !== undefined) {
            exports.TenantNames.encode(message.names, writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseTenantsGetRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if (tag !== 10) {
                        break;
                    }
                    message.collection = reader.string();
                    continue;
                case 2:
                    if (tag !== 18) {
                        break;
                    }
                    message.names = exports.TenantNames.decode(reader, reader.uint32());
                    continue;
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skipType(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            collection: isSet(object.collection) ? globalThis.String(object.collection) : "",
            names: isSet(object.names) ? exports.TenantNames.fromJSON(object.names) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.collection !== "") {
            obj.collection = message.collection;
        }
        if (message.names !== undefined) {
            obj.names = exports.TenantNames.toJSON(message.names);
        }
        return obj;
    },
    create(base) {
        return exports.TenantsGetRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseTenantsGetRequest();
        message.collection = object.collection ?? "";
        message.names = (object.names !== undefined && object.names !== null)
            ? exports.TenantNames.fromPartial(object.names)
            : undefined;
        return message;
    },
};
function createBaseTenantNames() {
    return { values: [] };
}
exports.TenantNames = {
    encode(message, writer = minimal_js_1.default.Writer.create()) {
        for (const v of message.values) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseTenantNames();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if (tag !== 10) {
                        break;
                    }
                    message.values.push(reader.string());
                    continue;
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skipType(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            values: globalThis.Array.isArray(object?.values) ? object.values.map((e) => globalThis.String(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.values?.length) {
            obj.values = message.values;
        }
        return obj;
    },
    create(base) {
        return exports.TenantNames.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseTenantNames();
        message.values = object.values?.map((e) => e) || [];
        return message;
    },
};
function createBaseTenantsGetReply() {
    return { took: 0, tenants: [] };
}
exports.TenantsGetReply = {
    encode(message, writer = minimal_js_1.default.Writer.create()) {
        if (message.took !== 0) {
            writer.uint32(13).float(message.took);
        }
        for (const v of message.tenants) {
            exports.Tenant.encode(v, writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseTenantsGetReply();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if (tag !== 13) {
                        break;
                    }
                    message.took = reader.float();
                    continue;
                case 2:
                    if (tag !== 18) {
                        break;
                    }
                    message.tenants.push(exports.Tenant.decode(reader, reader.uint32()));
                    continue;
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skipType(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            took: isSet(object.took) ? globalThis.Number(object.took) : 0,
            tenants: globalThis.Array.isArray(object?.tenants) ? object.tenants.map((e) => exports.Tenant.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.took !== 0) {
            obj.took = message.took;
        }
        if (message.tenants?.length) {
            obj.tenants = message.tenants.map((e) => exports.Tenant.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return exports.TenantsGetReply.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseTenantsGetReply();
        message.took = object.took ?? 0;
        message.tenants = object.tenants?.map((e) => exports.Tenant.fromPartial(e)) || [];
        return message;
    },
};
function createBaseTenant() {
    return { name: "", activityStatus: 0 };
}
exports.Tenant = {
    encode(message, writer = minimal_js_1.default.Writer.create()) {
        if (message.name !== "") {
            writer.uint32(10).string(message.name);
        }
        if (message.activityStatus !== 0) {
            writer.uint32(16).int32(message.activityStatus);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_js_1.default.Reader ? input : minimal_js_1.default.Reader.create(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseTenant();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    if (tag !== 10) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                case 2:
                    if (tag !== 16) {
                        break;
                    }
                    message.activityStatus = reader.int32();
                    continue;
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skipType(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            name: isSet(object.name) ? globalThis.String(object.name) : "",
            activityStatus: isSet(object.activityStatus) ? tenantActivityStatusFromJSON(object.activityStatus) : 0,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== "") {
            obj.name = message.name;
        }
        if (message.activityStatus !== 0) {
            obj.activityStatus = tenantActivityStatusToJSON(message.activityStatus);
        }
        return obj;
    },
    create(base) {
        return exports.Tenant.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseTenant();
        message.name = object.name ?? "";
        message.activityStatus = object.activityStatus ?? 0;
        return message;
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
