UNPKG

@zitadel/node

Version:

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

3,720 lines 129 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.5
//   protoc               unknown
// source: zitadel/org/v2beta/org_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 { Metadata as Metadata1, MetadataQuery } from "../../metadata/v2beta/metadata.js";
import { AddHumanUserRequest } from "../../user/v2beta/user_service.js";
import { Domain, DomainSearchFilter, domainValidationTypeFromJSON, domainValidationTypeToJSON, Organization, OrganizationSearchFilter, orgFieldNameFromJSON, orgFieldNameToJSON, } from "./org.js";
export const protobufPackage = "zitadel.org.v2beta";
function createBaseCreateOrganizationRequest() {
    return { name: "", id: undefined, admins: [] };
}
export const CreateOrganizationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.name !== "") {
            writer.uint32(10).string(message.name);
        }
        if (message.id !== undefined) {
            writer.uint32(18).string(message.id);
        }
        for (const v of message.admins) {
            CreateOrganizationRequest_Admin.encode(v, writer.uint32(26).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 = createBaseCreateOrganizationRequest();
        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 !== 18) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.admins.push(CreateOrganizationRequest_Admin.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            name: isSet(object.name) ? globalThis.String(object.name) : "",
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            admins: globalThis.Array.isArray(object?.admins)
                ? object.admins.map((e) => CreateOrganizationRequest_Admin.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== "") {
            obj.name = message.name;
        }
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.admins?.length) {
            obj.admins = message.admins.map((e) => CreateOrganizationRequest_Admin.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return CreateOrganizationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateOrganizationRequest();
        message.name = object.name ?? "";
        message.id = object.id ?? undefined;
        message.admins = object.admins?.map((e) => CreateOrganizationRequest_Admin.fromPartial(e)) || [];
        return message;
    },
};
function createBaseCreateOrganizationRequest_Admin() {
    return { userId: undefined, human: undefined, roles: [] };
}
export const CreateOrganizationRequest_Admin = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== undefined) {
            writer.uint32(10).string(message.userId);
        }
        if (message.human !== undefined) {
            AddHumanUserRequest.encode(message.human, writer.uint32(18).fork()).join();
        }
        for (const v of message.roles) {
            writer.uint32(26).string(v);
        }
        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 = createBaseCreateOrganizationRequest_Admin();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.human = AddHumanUserRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.roles.push(reader.string());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
            human: isSet(object.human) ? AddHumanUserRequest.fromJSON(object.human) : undefined,
            roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e) => globalThis.String(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== undefined) {
            obj.userId = message.userId;
        }
        if (message.human !== undefined) {
            obj.human = AddHumanUserRequest.toJSON(message.human);
        }
        if (message.roles?.length) {
            obj.roles = message.roles;
        }
        return obj;
    },
    create(base) {
        return CreateOrganizationRequest_Admin.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateOrganizationRequest_Admin();
        message.userId = object.userId ?? undefined;
        message.human = (object.human !== undefined && object.human !== null)
            ? AddHumanUserRequest.fromPartial(object.human)
            : undefined;
        message.roles = object.roles?.map((e) => e) || [];
        return message;
    },
};
function createBaseCreatedAdmin() {
    return { userId: "", emailCode: undefined, phoneCode: undefined };
}
export const CreatedAdmin = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.emailCode !== undefined) {
            writer.uint32(18).string(message.emailCode);
        }
        if (message.phoneCode !== undefined) {
            writer.uint32(26).string(message.phoneCode);
        }
        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 = createBaseCreatedAdmin();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.emailCode = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.phoneCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
            emailCode: isSet(object.emailCode) ? globalThis.String(object.emailCode) : undefined,
            phoneCode: isSet(object.phoneCode) ? globalThis.String(object.phoneCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.emailCode !== undefined) {
            obj.emailCode = message.emailCode;
        }
        if (message.phoneCode !== undefined) {
            obj.phoneCode = message.phoneCode;
        }
        return obj;
    },
    create(base) {
        return CreatedAdmin.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreatedAdmin();
        message.userId = object.userId ?? "";
        message.emailCode = object.emailCode ?? undefined;
        message.phoneCode = object.phoneCode ?? undefined;
        return message;
    },
};
function createBaseAssignedAdmin() {
    return { userId: "" };
}
export const AssignedAdmin = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        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 = createBaseAssignedAdmin();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { userId: isSet(object.userId) ? globalThis.String(object.userId) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        return obj;
    },
    create(base) {
        return AssignedAdmin.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAssignedAdmin();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseOrganizationAdmin() {
    return { createdAdmin: undefined, assignedAdmin: undefined };
}
export const OrganizationAdmin = {
    encode(message, writer = new BinaryWriter()) {
        if (message.createdAdmin !== undefined) {
            CreatedAdmin.encode(message.createdAdmin, writer.uint32(10).fork()).join();
        }
        if (message.assignedAdmin !== undefined) {
            AssignedAdmin.encode(message.assignedAdmin, 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 = createBaseOrganizationAdmin();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.createdAdmin = CreatedAdmin.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.assignedAdmin = AssignedAdmin.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            createdAdmin: isSet(object.createdAdmin) ? CreatedAdmin.fromJSON(object.createdAdmin) : undefined,
            assignedAdmin: isSet(object.assignedAdmin) ? AssignedAdmin.fromJSON(object.assignedAdmin) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.createdAdmin !== undefined) {
            obj.createdAdmin = CreatedAdmin.toJSON(message.createdAdmin);
        }
        if (message.assignedAdmin !== undefined) {
            obj.assignedAdmin = AssignedAdmin.toJSON(message.assignedAdmin);
        }
        return obj;
    },
    create(base) {
        return OrganizationAdmin.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOrganizationAdmin();
        message.createdAdmin = (object.createdAdmin !== undefined && object.createdAdmin !== null)
            ? CreatedAdmin.fromPartial(object.createdAdmin)
            : undefined;
        message.assignedAdmin = (object.assignedAdmin !== undefined && object.assignedAdmin !== null)
            ? AssignedAdmin.fromPartial(object.assignedAdmin)
            : undefined;
        return message;
    },
};
function createBaseCreateOrganizationResponse() {
    return { creationDate: undefined, id: "", organizationAdmins: [] };
}
export const CreateOrganizationResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        if (message.id !== "") {
            writer.uint32(18).string(message.id);
        }
        for (const v of message.organizationAdmins) {
            OrganizationAdmin.encode(v, writer.uint32(26).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 = createBaseCreateOrganizationResponse();
        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;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.organizationAdmins.push(OrganizationAdmin.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,
            id: isSet(object.id) ? globalThis.String(object.id) : "",
            organizationAdmins: globalThis.Array.isArray(object?.organizationAdmins)
                ? object.organizationAdmins.map((e) => OrganizationAdmin.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        if (message.id !== "") {
            obj.id = message.id;
        }
        if (message.organizationAdmins?.length) {
            obj.organizationAdmins = message.organizationAdmins.map((e) => OrganizationAdmin.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return CreateOrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateOrganizationResponse();
        message.creationDate = object.creationDate ?? undefined;
        message.id = object.id ?? "";
        message.organizationAdmins = object.organizationAdmins?.map((e) => OrganizationAdmin.fromPartial(e)) || [];
        return message;
    },
};
function createBaseUpdateOrganizationRequest() {
    return { id: "", name: "" };
}
export const UpdateOrganizationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        if (message.name !== "") {
            writer.uint32(18).string(message.name);
        }
        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 = createBaseUpdateOrganizationRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : "",
            name: isSet(object.name) ? globalThis.String(object.name) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        if (message.name !== "") {
            obj.name = message.name;
        }
        return obj;
    },
    create(base) {
        return UpdateOrganizationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateOrganizationRequest();
        message.id = object.id ?? "";
        message.name = object.name ?? "";
        return message;
    },
};
function createBaseUpdateOrganizationResponse() {
    return { changeDate: undefined };
}
export const UpdateOrganizationResponse = {
    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 = createBaseUpdateOrganizationResponse();
        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 UpdateOrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateOrganizationResponse();
        message.changeDate = object.changeDate ?? undefined;
        return message;
    },
};
function createBaseListOrganizationsRequest() {
    return { pagination: undefined, sortingColumn: 0, filter: [] };
}
export const ListOrganizationsRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        if (message.sortingColumn !== 0) {
            writer.uint32(16).int32(message.sortingColumn);
        }
        for (const v of message.filter) {
            OrganizationSearchFilter.encode(v, writer.uint32(26).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 = createBaseListOrganizationsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.filter.push(OrganizationSearchFilter.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? orgFieldNameFromJSON(object.sortingColumn) : 0,
            filter: globalThis.Array.isArray(object?.filter)
                ? object.filter.map((e) => OrganizationSearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = orgFieldNameToJSON(message.sortingColumn);
        }
        if (message.filter?.length) {
            obj.filter = message.filter.map((e) => OrganizationSearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationsRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationsRequest();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.filter = object.filter?.map((e) => OrganizationSearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListOrganizationsResponse() {
    return { pagination: undefined, organizations: [] };
}
export const ListOrganizationsResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        for (const v of message.organizations) {
            Organization.encode(v, 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 = createBaseListOrganizationsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.organizations.push(Organization.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
            organizations: globalThis.Array.isArray(object?.organizations)
                ? object.organizations.map((e) => Organization.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        if (message.organizations?.length) {
            obj.organizations = message.organizations.map((e) => Organization.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationsResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationsResponse();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        message.organizations = object.organizations?.map((e) => Organization.fromPartial(e)) || [];
        return message;
    },
};
function createBaseDeleteOrganizationRequest() {
    return { id: "" };
}
export const DeleteOrganizationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        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 = createBaseDeleteOrganizationRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return DeleteOrganizationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationRequest();
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseDeleteOrganizationResponse() {
    return { deletionDate: undefined };
}
export const DeleteOrganizationResponse = {
    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 = createBaseDeleteOrganizationResponse();
        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 DeleteOrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseDeactivateOrganizationRequest() {
    return { id: "" };
}
export const DeactivateOrganizationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        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 = createBaseDeactivateOrganizationRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return DeactivateOrganizationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateOrganizationRequest();
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseDeactivateOrganizationResponse() {
    return { changeDate: undefined };
}
export const DeactivateOrganizationResponse = {
    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 = createBaseDeactivateOrganizationResponse();
        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 DeactivateOrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateOrganizationResponse();
        message.changeDate = object.changeDate ?? undefined;
        return message;
    },
};
function createBaseActivateOrganizationRequest() {
    return { id: "" };
}
export const ActivateOrganizationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        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 = createBaseActivateOrganizationRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return ActivateOrganizationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseActivateOrganizationRequest();
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseActivateOrganizationResponse() {
    return { changeDate: undefined };
}
export const ActivateOrganizationResponse = {
    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 = createBaseActivateOrganizationResponse();
        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 ActivateOrganizationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseActivateOrganizationResponse();
        message.changeDate = object.changeDate ?? undefined;
        return message;
    },
};
function createBaseAddOrganizationDomainRequest() {
    return { organizationId: "", domain: "" };
}
export const AddOrganizationDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        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 = createBaseAddOrganizationDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = 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 {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return AddOrganizationDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOrganizationDomainRequest();
        message.organizationId = object.organizationId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseAddOrganizationDomainResponse() {
    return { creationDate: undefined };
}
export const AddOrganizationDomainResponse = {
    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 = createBaseAddOrganizationDomainResponse();
        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 AddOrganizationDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOrganizationDomainResponse();
        message.creationDate = object.creationDate ?? undefined;
        return message;
    },
};
function createBaseListOrganizationDomainsRequest() {
    return { organizationId: "", pagination: undefined, filters: [] };
}
export const ListOrganizationDomainsRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        for (const v of message.filters) {
            DomainSearchFilter.encode(v, writer.uint32(26).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 = createBaseListOrganizationDomainsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.filters.push(DomainSearchFilter.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            filters: globalThis.Array.isArray(object?.filters)
                ? object.filters.map((e) => DomainSearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.filters?.length) {
            obj.filters = message.filters.map((e) => DomainSearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationDomainsRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationDomainsRequest();
        message.organizationId = object.organizationId ?? "";
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.filters = object.filters?.map((e) => DomainSearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListOrganizationDomainsResponse() {
    return { pagination: undefined, domains: [] };
}
export const ListOrganizationDomainsResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        for (const v of message.domains) {
            Domain.encode(v, 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 = createBaseListOrganizationDomainsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domains.push(Domain.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
            domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e) => Domain.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        if (message.domains?.length) {
            obj.domains = message.domains.map((e) => Domain.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationDomainsResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationDomainsResponse();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        message.domains = object.domains?.map((e) => Domain.fromPartial(e)) || [];
        return message;
    },
};
function createBaseDeleteOrganizationDomainRequest() {
    return { organizationId: "", domain: "" };
}
export const DeleteOrganizationDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        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 = createBaseDeleteOrganizationDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = 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 {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return DeleteOrganizationDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationDomainRequest();
        message.organizationId = object.organizationId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseDeleteOrganizationDomainResponse() {
    return { deletionDate: undefined };
}
export const DeleteOrganizationDomainResponse = {
    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 = createBaseDeleteOrganizationDomainResponse();
        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 DeleteOrganizationDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationDomainResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseGenerateOrganizationDomainValidationRequest() {
    return { organizationId: "", domain: "", type: 0 };
}
export const GenerateOrganizationDomainValidationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.domain !== "") {
            writer.uint32(18).string(message.domain);
        }
        if (message.type !== 0) {
            writer.uint32(24).int32(message.type);
        }
        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 = createBaseGenerateOrganizationDomainValidationRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.domain = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.type = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
            type: isSet(object.type) ? domainValidationTypeFromJSON(object.type) : 0,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        if (message.type !== 0) {
            obj.type = domainValidationTypeToJSON(message.type);
        }
        return obj;
    },
    create(base) {
        return GenerateOrganizationDomainValidationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGenerateOrganizationDomainValidationRequest();
        message.organizationId = object.organizationId ?? "";
        message.domain = object.domain ?? "";
        message.type = object.type ?? 0;
        return message;
    },
};
function createBaseGenerateOrganizationDomainValidationResponse() {
    return { token: "", url: "" };
}
export const GenerateOrganizationDomainValidationResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.token !== "") {
            writer.uint32(10).string(message.token);
        }
        if (message.url !== "") {
            writer.uint32(18).string(message.url);
        }
        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 = createBaseGenerateOrganizationDomainValidationResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.token = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.url = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            token: isSet(object.token) ? globalThis.String(object.token) : "",
            url: isSet(object.url) ? globalThis.String(object.url) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.token !== "") {
            obj.token = message.token;
        }
        if (message.url !== "") {
            obj.url = message.url;
        }
        return obj;
    },
    create(base) {
        return GenerateOrganizationDomainValidationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGenerateOrganizationDomainValidationResponse();
        message.token = object.token ?? "";
        message.url = object.url ?? "";
        return message;
    },
};
function createBaseVerifyOrganizationDomainRequest() {
    return { organizationId: "", domain: "" };
}
export const VerifyOrganizationDomainRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        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 = createBaseVerifyOrganizationDomainRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = 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 {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return VerifyOrganizationDomainRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyOrganizationDomainRequest();
        message.organizationId = object.organizationId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseVerifyOrganizationDomainResponse() {
    return { changeDate: undefined };
}
export const VerifyOrganizationDomainResponse = {
    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 = createBaseVerifyOrganizationDomainResponse();
        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 VerifyOrganizationDomainResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyOrganizationDomainResponse();
        message.changeDate = object.changeDate ?? undefined;
        return message;
    },
};
function createBaseMetadata() {
    return { key: "", value: Buffer.alloc(0) };
}
export const Metadata = {
    encode(message, writer = new BinaryWriter()) {
        if (message.key !== "") {
            writer.uint32(10).string(message.key);
        }
        if (message.value.length !== 0) {
            writer.uint32(18).bytes(message.value);
        }
        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 = createBaseMetadata();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.key = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.value = Buffer.from(reader.bytes());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            key: isSet(object.key) ? globalThis.String(object.key) : "",
            value: isSet(object.value) ? Buffer.from(bytesFromBase64(object.value)) : Buffer.alloc(0),
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.key !== "") {
            obj.key = message.key;
        }
        if (message.value.length !== 0) {
            obj.value = base64FromBytes(message.value);
        }
        return obj;
    },
    create(base) {
        return Metadata.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseMetadata();
        message.key = object.key ?? "";
        message.value = object.value ?? Buffer.alloc(0);
        return message;
    },
};
function createBaseSetOrganizationMetadataRequest() {
    return { organizationId: "", metadata: [] };
}
export const SetOrganizationMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        for (const v of message.metadata) {
            Metadata.encode(v, 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 = createBaseSetOrganizationMetadataRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.metadata.push(Metadata.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            metadata: globalThis.Array.isArray(object?.metadata) ? object.metadata.map((e) => Metadata.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.metadata?.length) {
            obj.metadata = message.metadata.map((e) => Metadata.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return SetOrganizationMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetOrganizationMetadataRequest();
        message.organizationId = object.organizationId ?? "";
        message.metadata = object.metadata?.map((e) => Metadata.fromPartial(e)) || [];
        return message;
    },
};
function createBaseSetOrganizationMetadataResponse() {
    return { setDate: undefined };
}
export const SetOrganizationMetadataResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.setDate !== undefined) {
            Timestamp.encode(toTimestamp(message.setDate), 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 = createBaseSetOrganizationMetadataResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.setDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { setDate: isSet(object.setDate) ? fromJsonTimestamp(object.setDate) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.setDate !== undefined) {
            obj.setDate = message.setDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return SetOrganizationMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetOrganizationMetadataResponse();
        message.setDate = object.setDate ?? undefined;
        return message;
    },
};
function createBaseListOrganizationMetadataRequest() {
    return { organizationId: "", pagination: undefined, filter: [] };
}
export const ListOrganizationMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        for (const v of message.filter) {
            MetadataQuery.encode(v, writer.uint32(26).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 = createBaseListOrganizationMetadataRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.filter.push(MetadataQuery.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            filter: globalThis.Array.isArray(object?.filter) ? object.filter.map((e) => MetadataQuery.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.filter?.length) {
            obj.filter = message.filter.map((e) => MetadataQuery.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationMetadataRequest();
        message.organizationId = object.organizationId ?? "";
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.filter = object.filter?.map((e) => MetadataQuery.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListOrganizationMetadataResponse() {
    return { pagination: undefined, metadata: [] };
}
export const ListOrganizationMetadataResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        for (const v of message.metadata) {
            Metadata1.encode(v, 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 = createBaseListOrganizationMetadataResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.pagination = PaginationResponse.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.metadata.push(Metadata1.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined,
            metadata: globalThis.Array.isArray(object?.metadata)
                ? object.metadata.map((e) => Metadata1.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        if (message.metadata?.length) {
            obj.metadata = message.metadata.map((e) => Metadata1.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListOrganizationMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListOrganizationMetadataResponse();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        message.metadata = object.metadata?.map((e) => Metadata1.fromPartial(e)) || [];
        return message;
    },
};
function createBaseDeleteOrganizationMetadataRequest() {
    return { organizationId: "", keys: [] };
}
export const DeleteOrganizationMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        for (const v of message.keys) {
            writer.uint32(18).string(v);
        }
        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 = createBaseDeleteOrganizationMetadataRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.organizationId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.keys.push(reader.string());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : "",
            keys: globalThis.Array.isArray(object?.keys) ? object.keys.map((e) => globalThis.String(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.keys?.length) {
            obj.keys = message.keys;
        }
        return obj;
    },
    create(base) {
        return DeleteOrganizationMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationMetadataRequest();
        message.organizationId = object.organizationId ?? "";
        message.keys = object.keys?.map((e) => e) || [];
        return message;
    },
};
function createBaseDeleteOrganizationMetadataResponse() {
    return { deletionDate: undefined };
}
export const DeleteOrganizationMetadataResponse = {
    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 = createBaseDeleteOrganizationMetadataResponse();
        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 DeleteOrganizationMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteOrganizationMetadataResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
export const OrganizationServiceDefinition = {
    name: "OrganizationService",
    fullName: "zitadel.org.v2beta.OrganizationService",
    methods: {
        /**
         * Create Organization
         *
         * Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER.
         *
         * Required permission:
         *  - `org.create`
         */
        createOrganization: {
            name: "CreateOrganization",
            requestType: CreateOrganizationRequest,
            requestStream: false,
            responseType: CreateOrganizationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            97,
                            74,
                            42,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            35,
                            10,
                            33,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            74,
                            51,
                            10,
                            3,
                            52,
                            48,
                            57,
                            18,
                            44,
                            10,
                            42,
                            84,
                            104,
                            101,
                            32,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            32,
                            116,
                            111,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            32,
                            97,
                            108,
                            114,
                            101,
                            97,
                            100,
                            121,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            115,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([14, 10, 12, 10, 10, 111, 114, 103, 46, 99, 114, 101, 97, 116, 101])],
                    578365826: [
                        Buffer.from([
                            26,
                            58,
                            1,
                            42,
                            34,
                            21,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Update Organization
         *
         * Change the name of the organization.
         *
         * Required permission:
         *  - `org.write`
         */
        updateOrganization: {
            name: "UpdateOrganization",
            requestType: UpdateOrganizationRequest,
            requestStream: false,
            responseType: UpdateOrganizationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            123,
                            74,
                            42,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            35,
                            10,
                            33,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            74,
                            33,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            26,
                            10,
                            24,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            115,
                            97,
                            116,
                            105,
                            111,
                            110,
                            39,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                            74,
                            42,
                            10,
                            3,
                            52,
                            48,
                            57,
                            18,
                            35,
                            10,
                            33,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            115,
                            97,
                            116,
                            105,
                            111,
                            110,
                            39,
                            115,
                            32,
                            110,
                            97,
                            109,
                            101,
                            32,
                            97,
                            108,
                            114,
                            101,
                            97,
                            100,
                            121,
                            32,
                            116,
                            97,
                            107,
                            101,
                            110,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            31,
                            58,
                            1,
                            42,
                            34,
                            26,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Organizations
         *
         * Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition.
         *
         * Required permission:
         *  - `iam.read`
         */
        listOrganizations: {
            name: "ListOrganizations",
            requestType: ListOrganizationsRequest,
            requestStream: false,
            responseType: ListOrganizationsResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 105, 97, 109, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            33,
                            58,
                            1,
                            42,
                            34,
                            28,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete Organization
         *
         * Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in.
         *
         * Required permission:
         *  - `org.delete`
         */
        deleteOrganization: {
            name: "DeleteOrganization",
            requestType: DeleteOrganizationRequest,
            requestStream: false,
            responseType: DeleteOrganizationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            79,
                            74,
                            42,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            35,
                            10,
                            33,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            74,
                            33,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            26,
                            10,
                            24,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            115,
                            97,
                            116,
                            105,
                            111,
                            110,
                            39,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                        ]),
                    ],
                    400010: [Buffer.from([14, 10, 12, 10, 10, 111, 114, 103, 46, 100, 101, 108, 101, 116, 101])],
                    578365826: [
                        Buffer.from([
                            28,
                            42,
                            26,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Set Organization Metadata
         *
         * Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded.
         *
         * Required permission:
         *  - `org.write`
         */
        setOrganizationMetadata: {
            name: "SetOrganizationMetadata",
            requestType: SetOrganizationMetadataRequest,
            requestStream: false,
            responseType: SetOrganizationMetadataResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            44,
                            74,
                            7,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            0,
                            74,
                            33,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            26,
                            10,
                            24,
                            79,
                            114,
                            103,
                            97,
                            110,
                            105,
                            115,
                            97,
                            116,
                            105,
                            111,
                            110,
                            39,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            53,
                            58,
                            1,
                            42,
                            34,
                            48,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Organization Metadata
         *
         * List metadata of an organization filtered by query.
         *
         * Required permission:
         *  - `org.read`
         */
        listOrganizationMetadata: {
            name: "ListOrganizationMetadata",
            requestType: ListOrganizationMetadataRequest,
            requestStream: false,
            responseType: ListOrganizationMetadataResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 111, 114, 103, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            60,
                            58,
                            1,
                            42,
                            34,
                            55,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete Organization Metadata
         *
         * Delete metadata objects from an organization with a specific key.
         *
         * Required permission:
         *  - `org.write`
         */
        deleteOrganizationMetadata: {
            name: "DeleteOrganizationMetadata",
            requestType: DeleteOrganizationMetadataRequest,
            requestStream: false,
            responseType: DeleteOrganizationMetadataResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            50,
                            42,
                            48,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add Organization Domain
         *
         * Add a new domain to an organization. The domains are used to identify to which organization a user belongs.
         *
         * Required permission:
         *  - `org.write`
         */
        addOrganizationDomain: {
            name: "AddOrganizationDomain",
            requestType: AddOrganizationDomainRequest,
            requestStream: false,
            responseType: AddOrganizationDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            41,
                            74,
                            7,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            0,
                            74,
                            30,
                            10,
                            3,
                            52,
                            48,
                            57,
                            18,
                            23,
                            10,
                            21,
                            68,
                            111,
                            109,
                            97,
                            105,
                            110,
                            32,
                            97,
                            108,
                            114,
                            101,
                            97,
                            100,
                            121,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            52,
                            58,
                            1,
                            42,
                            34,
                            47,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * List Organization Domains
         *
         * Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs.
         *
         * Required permission:
         *  - `org.read`
         */
        listOrganizationDomains: {
            name: "ListOrganizationDomains",
            requestType: ListOrganizationDomainsRequest,
            requestStream: false,
            responseType: ListOrganizationDomainsResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([12, 10, 10, 10, 8, 111, 114, 103, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            59,
                            58,
                            1,
                            42,
                            34,
                            54,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete Organization Domain
         *
         * Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead.
         *
         * Required permission:
         *  - `org.write`
         */
        deleteOrganizationDomain: {
            name: "DeleteOrganizationDomain",
            requestType: DeleteOrganizationDomainRequest,
            requestStream: false,
            responseType: DeleteOrganizationDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            49,
                            42,
                            47,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Generate Organization Domain Validation
         *
         * Generate a new file to be able to verify your domain with DNS or HTTP challenge.
         *
         * Required permission:
         *  - `org.write`
         */
        generateOrganizationDomainValidation: {
            name: "GenerateOrganizationDomainValidation",
            requestType: GenerateOrganizationDomainValidationRequest,
            requestStream: false,
            responseType: GenerateOrganizationDomainValidationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            56,
                            74,
                            7,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            0,
                            74,
                            45,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            38,
                            10,
                            36,
                            68,
                            111,
                            109,
                            97,
                            105,
                            110,
                            32,
                            100,
                            111,
                            101,
                            115,
                            110,
                            39,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            32,
                            111,
                            110,
                            32,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                        ]),
                    ],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            72,
                            58,
                            1,
                            42,
                            34,
                            67,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            118,
                            97,
                            108,
                            105,
                            100,
                            97,
                            116,
                            105,
                            111,
                            110,
                            47,
                            103,
                            101,
                            110,
                            101,
                            114,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify Organization Domain
         *
         * Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique.
         *
         * Required permission:
         *  - `org.write`
         */
        verifyOrganizationDomain: {
            name: "VerifyOrganizationDomain",
            requestType: VerifyOrganizationDomainRequest,
            requestStream: false,
            responseType: VerifyOrganizationDomainResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            70,
                            58,
                            1,
                            42,
                            34,
                            65,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            111,
                            109,
                            97,
                            105,
                            110,
                            115,
                            47,
                            118,
                            97,
                            108,
                            105,
                            100,
                            97,
                            116,
                            105,
                            111,
                            110,
                            47,
                            118,
                            101,
                            114,
                            105,
                            102,
                            121,
                        ]),
                    ],
                },
            },
        },
        /**
         * Deactivate Organization
         *
         * Sets the state of my organization to deactivated. Users of this organization will not be able to log in.
         *
         * Required permission:
         *  - `org.write`
         */
        deactivateOrganization: {
            name: "DeactivateOrganization",
            requestType: DeactivateOrganizationRequest,
            requestStream: false,
            responseType: DeactivateOrganizationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            42,
                            58,
                            1,
                            42,
                            34,
                            37,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                            47,
                            100,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Activate Organization
         *
         * Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again.
         *
         * Required permission:
         *  - `org.write`
         */
        activateOrganization: {
            name: "ActivateOrganization",
            requestType: ActivateOrganizationRequest,
            requestStream: false,
            responseType: ActivateOrganizationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([13, 10, 11, 10, 9, 111, 114, 103, 46, 119, 114, 105, 116, 101])],
                    578365826: [
                        Buffer.from([
                            40,
                            58,
                            1,
                            42,
                            34,
                            35,
                            47,
                            118,
                            50,
                            98,
                            101,
                            116,
                            97,
                            47,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                            47,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
    },
};
function bytesFromBase64(b64) {
    return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
}
function base64FromBytes(arr) {
    return globalThis.Buffer.from(arr).toString("base64");
}
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;
}