UNPKG

@zitadel/node

Version:

Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.

2,622 lines 88.9 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.5
//   protoc               unknown
// source: zitadel/instance/v2beta/instance_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { Timestamp } from "../../../google/protobuf/timestamp.js";
import { PaginationRequest, PaginationResponse } from "../../filter/v2beta/filter.js";
import { Domain, domainFieldNameFromJSON, domainFieldNameToJSON, DomainSearchQuery, fieldNameFromJSON, fieldNameToJSON, Instance, Query, TrustedDomain, trustedDomainFieldNameFromJSON, trustedDomainFieldNameToJSON, TrustedDomainSearchQuery, } from "./instance.js";
export const protobufPackage = "zitadel.instance.v2beta";
function createBaseDeleteInstanceRequest() {
    return { instanceId: "" };
}
export const DeleteInstanceRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseDeleteInstanceRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        return obj;
    },
    create(base) {
        return DeleteInstanceRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteInstanceRequest();
        message.instanceId = object.instanceId ?? "";
        return message;
    },
};
function createBaseDeleteInstanceResponse() {
    return { deletionDate: undefined };
}
export const DeleteInstanceResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.deletionDate !== undefined) {
            Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseDeleteInstanceResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.deletionDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.deletionDate !== undefined) {
            obj.deletionDate = message.deletionDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return DeleteInstanceResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteInstanceResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseGetInstanceRequest() {
    return { instanceId: "" };
}
export const GetInstanceRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseGetInstanceRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        return obj;
    },
    create(base) {
        return GetInstanceRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetInstanceRequest();
        message.instanceId = object.instanceId ?? "";
        return message;
    },
};
function createBaseGetInstanceResponse() {
    return { instance: undefined };
}
export const GetInstanceResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseGetInstanceResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        return obj;
    },
    create(base) {
        return GetInstanceResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetInstanceResponse();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        return message;
    },
};
function createBaseUpdateInstanceRequest() {
    return { instanceId: "", instanceName: "" };
}
export const UpdateInstanceRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.instanceName !== "") {
            writer.uint32(18).string(message.instanceName);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseUpdateInstanceRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.instanceName = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            instanceName: isSet(object.instanceName) ? globalThis.String(object.instanceName) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.instanceName !== "") {
            obj.instanceName = message.instanceName;
        }
        return obj;
    },
    create(base) {
        return UpdateInstanceRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateInstanceRequest();
        message.instanceId = object.instanceId ?? "";
        message.instanceName = object.instanceName ?? "";
        return message;
    },
};
function createBaseUpdateInstanceResponse() {
    return { changeDate: undefined };
}
export const UpdateInstanceResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.changeDate !== undefined) {
            Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseUpdateInstanceResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.changeDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.changeDate !== undefined) {
            obj.changeDate = message.changeDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return UpdateInstanceResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateInstanceResponse();
        message.changeDate = object.changeDate ?? undefined;
        return message;
    },
};
function createBaseListInstancesRequest() {
    return { queries: [], pagination: undefined, sortingColumn: undefined };
}
export const ListInstancesRequest = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.queries) {
            Query.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        if (message.sortingColumn !== undefined) {
            writer.uint32(24).int32(message.sortingColumn);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListInstancesRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.queries.push(Query.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => Query.fromJSON(e)) : [],
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? fieldNameFromJSON(object.sortingColumn) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.queries?.length) {
            obj.queries = message.queries.map((e) => Query.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== undefined) {
            obj.sortingColumn = fieldNameToJSON(message.sortingColumn);
        }
        return obj;
    },
    create(base) {
        return ListInstancesRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListInstancesRequest();
        message.queries = object.queries?.map((e) => Query.fromPartial(e)) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? undefined;
        return message;
    },
};
function createBaseListInstancesResponse() {
    return { instances: [], pagination: undefined };
}
export const ListInstancesResponse = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.instances) {
            Instance.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListInstancesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instances.push(Instance.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instances: globalThis.Array.isArray(object?.instances)
                ? object.instances.map((e) => Instance.fromJSON(e))
                : [],
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instances?.length) {
            obj.instances = message.instances.map((e) => Instance.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return ListInstancesResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListInstancesResponse();
        message.instances = object.instances?.map((e) => Instance.fromPartial(e)) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseAddCustomDomainRequest() {
    return { instanceId: "", domain: "" };
}
export const AddCustomDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.domain !== "") {
            writer.uint32(18).string(message.domain);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddCustomDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domain = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return AddCustomDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddCustomDomainRequest();
        message.instanceId = object.instanceId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseAddCustomDomainResponse() {
    return { creationDate: undefined };
}
export const AddCustomDomainResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddCustomDomainResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.creationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return AddCustomDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddCustomDomainResponse();
        message.creationDate = object.creationDate ?? undefined;
        return message;
    },
};
function createBaseRemoveCustomDomainRequest() {
    return { instanceId: "", domain: "" };
}
export const RemoveCustomDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.domain !== "") {
            writer.uint32(18).string(message.domain);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRemoveCustomDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domain = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return RemoveCustomDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveCustomDomainRequest();
        message.instanceId = object.instanceId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseRemoveCustomDomainResponse() {
    return { deletionDate: undefined };
}
export const RemoveCustomDomainResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.deletionDate !== undefined) {
            Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRemoveCustomDomainResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.deletionDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.deletionDate !== undefined) {
            obj.deletionDate = message.deletionDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return RemoveCustomDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveCustomDomainResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseListCustomDomainsRequest() {
    return { instanceId: "", pagination: undefined, sortingColumn: 0, queries: [] };
}
export const ListCustomDomainsRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        if (message.sortingColumn !== 0) {
            writer.uint32(24).int32(message.sortingColumn);
        }
        for (const v of message.queries) {
            DomainSearchQuery.encode(v, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListCustomDomainsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.queries.push(DomainSearchQuery.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? domainFieldNameFromJSON(object.sortingColumn) : 0,
            queries: globalThis.Array.isArray(object?.queries)
                ? object.queries.map((e) => DomainSearchQuery.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = domainFieldNameToJSON(message.sortingColumn);
        }
        if (message.queries?.length) {
            obj.queries = message.queries.map((e) => DomainSearchQuery.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListCustomDomainsRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListCustomDomainsRequest();
        message.instanceId = object.instanceId ?? "";
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.queries = object.queries?.map((e) => DomainSearchQuery.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListCustomDomainsResponse() {
    return { domains: [], pagination: undefined };
}
export const ListCustomDomainsResponse = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.domains) {
            Domain.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListCustomDomainsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.domains.push(Domain.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e) => Domain.fromJSON(e)) : [],
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.domains?.length) {
            obj.domains = message.domains.map((e) => Domain.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return ListCustomDomainsResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListCustomDomainsResponse();
        message.domains = object.domains?.map((e) => Domain.fromPartial(e)) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseAddTrustedDomainRequest() {
    return { instanceId: "", domain: "" };
}
export const AddTrustedDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.domain !== "") {
            writer.uint32(18).string(message.domain);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddTrustedDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domain = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return AddTrustedDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddTrustedDomainRequest();
        message.instanceId = object.instanceId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseAddTrustedDomainResponse() {
    return { creationDate: undefined };
}
export const AddTrustedDomainResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddTrustedDomainResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.creationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return AddTrustedDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddTrustedDomainResponse();
        message.creationDate = object.creationDate ?? undefined;
        return message;
    },
};
function createBaseRemoveTrustedDomainRequest() {
    return { instanceId: "", domain: "" };
}
export const RemoveTrustedDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.domain !== "") {
            writer.uint32(18).string(message.domain);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRemoveTrustedDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domain = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return RemoveTrustedDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveTrustedDomainRequest();
        message.instanceId = object.instanceId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseRemoveTrustedDomainResponse() {
    return { deletionDate: undefined };
}
export const RemoveTrustedDomainResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.deletionDate !== undefined) {
            Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRemoveTrustedDomainResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.deletionDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.deletionDate !== undefined) {
            obj.deletionDate = message.deletionDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return RemoveTrustedDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveTrustedDomainResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseListTrustedDomainsRequest() {
    return { instanceId: "", pagination: undefined, sortingColumn: 0, queries: [] };
}
export const ListTrustedDomainsRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instanceId !== "") {
            writer.uint32(10).string(message.instanceId);
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        if (message.sortingColumn !== 0) {
            writer.uint32(24).int32(message.sortingColumn);
        }
        for (const v of message.queries) {
            TrustedDomainSearchQuery.encode(v, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListTrustedDomainsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instanceId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.queries.push(TrustedDomainSearchQuery.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? trustedDomainFieldNameFromJSON(object.sortingColumn) : 0,
            queries: globalThis.Array.isArray(object?.queries)
                ? object.queries.map((e) => TrustedDomainSearchQuery.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instanceId !== "") {
            obj.instanceId = message.instanceId;
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = trustedDomainFieldNameToJSON(message.sortingColumn);
        }
        if (message.queries?.length) {
            obj.queries = message.queries.map((e) => TrustedDomainSearchQuery.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListTrustedDomainsRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListTrustedDomainsRequest();
        message.instanceId = object.instanceId ?? "";
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.queries = object.queries?.map((e) => TrustedDomainSearchQuery.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListTrustedDomainsResponse() {
    return { trustedDomain: [], pagination: undefined };
}
export const ListTrustedDomainsResponse = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.trustedDomain) {
            TrustedDomain.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseListTrustedDomainsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.trustedDomain.push(TrustedDomain.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            trustedDomain: globalThis.Array.isArray(object?.trustedDomain)
                ? object.trustedDomain.map((e) => TrustedDomain.fromJSON(e))
                : [],
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.trustedDomain?.length) {
            obj.trustedDomain = message.trustedDomain.map((e) => TrustedDomain.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return ListTrustedDomainsResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListTrustedDomainsResponse();
        message.trustedDomain = object.trustedDomain?.map((e) => TrustedDomain.fromPartial(e)) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
export const InstanceServiceDefinition = {
    name: "InstanceService",
    fullName: "zitadel.instance.v2beta.InstanceService",
    methods: {
        /**
         * Delete Instance
         *
         * Deletes an instance with the given ID.
         *
         * Required permissions:
         *   - `system.instance.delete`
         */
        deleteInstance: {
            name: "DeleteInstance",
            requestType: DeleteInstanceRequest,
            requestStream: false,
            responseType: DeleteInstanceResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            32,
                            74,
                            30,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            23,
                            10,
                            21,
                            84,
                            104,
                            101,
                            32,
                            100,
                            101,
                            108,
                            101,
                            116,
                            101,
                            100,
                            32,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            26,
                            10,
                            24,
                            10,
                            22,
                            115,
                            121,
                            115,
                            116,
                            101,
                            109,
                            46,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            46,
                            100,
                            101,
                            108,
                            101,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            33,
                            42,
                            31,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Get Instance
         *
         * Returns the instance in the current context.
         *
         * The instace_id in the input message will be used in the future.
         *
         * Required permissions:
         *   - `iam.read`
         */
        getInstance: {
            name: "GetInstance",
            requestType: GetInstanceRequest,
            requestStream: false,
            responseType: GetInstanceResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            39,
                            74,
                            37,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            30,
                            10,
                            28,
                            84,
                            104,
                            101,
                            32,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            32,
                            111,
                            102,
                            32,
                            116,
                            104,
                            101,
                            32,
                            99,
                            111,
                            110,
                            116,
                            101,
                            120,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 105, 97, 109, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            33,
                            18,
                            31,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Update Instance
         *
         * Updates instance in context with the given name.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *   - `iam.write`
         */
        updateInstance: {
            name: "UpdateInstance",
            requestType: UpdateInstanceRequest,
            requestStream: false,
            responseType: UpdateInstanceResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            49,
                            74,
                            47,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            40,
                            10,
                            38,
                            84,
                            104,
                            101,
                            32,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            32,
                            119,
                            97,
                            115,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            117,
                            112,
                            100,
                            97,
                            116,
                            101,
                            100,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 105, 97, 109, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            36,
                            58,
                            1,
                            42,
                            26,
                            31,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Instances
         *
         * Lists instances matching the given query.
         * The query can be used to filter either by instance ID or domain.
         * The request is paginated and returns 100 results by default.
         *
         * Required permissions:
         *  - `system.instance.read`
         */
        listInstances: {
            name: "ListInstances",
            requestType: ListInstancesRequest,
            requestStream: false,
            responseType: ListInstancesResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            33,
                            74,
                            31,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            24,
                            10,
                            22,
                            84,
                            104,
                            101,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            24,
                            10,
                            22,
                            10,
                            20,
                            115,
                            121,
                            115,
                            116,
                            101,
                            109,
                            46,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            46,
                            114,
                            101,
                            97,
                            100,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            29,
                            58,
                            1,
                            42,
                            34,
                            24,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add Custom Domain
         *
         * Adds a custom domain to the instance in context.
         *
         * The instance_id in the input message will be used in the future
         *
         * Required permissions:
         *   - `system.domain.write`
         */
        addCustomDomain: {
            name: "AddCustomDomain",
            requestType: AddCustomDomainRequest,
            requestStream: false,
            responseType: AddCustomDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            35,
                            74,
                            33,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            26,
                            10,
                            24,
                            84,
                            104,
                            101,
                            32,
                            97,
                            100,
                            100,
                            101,
                            100,
                            32,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            23,
                            10,
                            21,
                            10,
                            19,
                            115,
                            121,
                            115,
                            116,
                            101,
                            109,
                            46,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            51,
                            58,
                            1,
                            42,
                            34,
                            46,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove Custom Domain
         *
         * Removes a custom domain from the instance.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *  - `system.domain.write`
         */
        removeCustomDomain: {
            name: "RemoveCustomDomain",
            requestType: RemoveCustomDomainRequest,
            requestStream: false,
            responseType: RemoveCustomDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            37,
                            74,
                            35,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            28,
                            10,
                            26,
                            84,
                            104,
                            101,
                            32,
                            114,
                            101,
                            109,
                            111,
                            118,
                            101,
                            100,
                            32,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            23,
                            10,
                            21,
                            10,
                            19,
                            115,
                            121,
                            115,
                            116,
                            101,
                            109,
                            46,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            57,
                            42,
                            55,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            123,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Custom Domains
         *
         * Lists custom domains of the instance.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *  - `iam.read`
         */
        listCustomDomains: {
            name: "ListCustomDomains",
            requestType: ListCustomDomainsRequest,
            requestStream: false,
            responseType: ListCustomDomainsResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            38,
                            74,
                            36,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            29,
                            10,
                            27,
                            84,
                            104,
                            101,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 105, 97, 109, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            58,
                            58,
                            1,
                            42,
                            34,
                            53,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            99,
                            117,
                            115,
                            116,
                            111,
                            109,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add Trusted Domain
         *
         * Adds a trusted domain to the instance.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *  - `iam.write`
         */
        addTrustedDomain: {
            name: "AddTrustedDomain",
            requestType: AddTrustedDomainRequest,
            requestStream: false,
            responseType: AddTrustedDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            36,
                            74,
                            34,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            27,
                            10,
                            25,
                            84,
                            104,
                            101,
                            32,
                            97,
                            100,
                            100,
                            101,
                            100,
                            32,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 105, 97, 109, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            52,
                            58,
                            1,
                            42,
                            34,
                            47,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove Trusted Domain
         *
         * Removes a trusted domain from the instance.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *  - `iam.write`
         */
        removeTrustedDomain: {
            name: "RemoveTrustedDomain",
            requestType: RemoveTrustedDomainRequest,
            requestStream: false,
            responseType: RemoveTrustedDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            38,
                            74,
                            36,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            29,
                            10,
                            27,
                            84,
                            104,
                            101,
                            32,
                            114,
                            101,
                            109,
                            111,
                            118,
                            101,
                            100,
                            32,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 105, 97, 109, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            58,
                            42,
                            56,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            123,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Trusted Domains
         *
         * Lists trusted domains of the instance.
         *
         * The instance_id in the input message will be used in the future.
         *
         * Required permissions:
         *   - `iam.read`
         */
        listTrustedDomains: {
            name: "ListTrustedDomains",
            requestType: ListTrustedDomainsRequest,
            requestStream: false,
            responseType: ListTrustedDomainsResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            39,
                            74,
                            37,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            30,
                            10,
                            28,
                            84,
                            104,
                            101,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            32,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 105, 97, 109, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            59,
                            58,
                            1,
                            42,
                            34,
                            54,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            115,
                            47,
                            123,
                            105,
                            110,
                            115,
                            116,
                            97,
                            110,
                            99,
                            101,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            114,
                            117,
                            115,
                            116,
                            101,
                            100,
                            45,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
    },
};
function toTimestamp(date) {
    const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
    const nanos = (date.getTime() % 1_000) * 1_000_000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = (t.seconds.toNumber() || 0) * 1_000;
    millis += (t.nanos || 0) / 1_000_000;
    return new globalThis.Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof globalThis.Date) {
        return o;
    }
    else if (typeof o === "string") {
        return new globalThis.Date(o);
    }
    else {
        return fromTimestamp(Timestamp.fromJSON(o));
    }
}
function numberToLong(number) {
    return Long.fromNumber(number);
}
function isSet(value) {
    return value !== null && value !== undefined;
}