UNPKG

@zitadel/node

Version:

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

15,378 lines 536 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.5
//   protoc               unknown
// source: zitadel/user/v2/user_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { Struct } from "../../../google/protobuf/struct.js";
import { Timestamp } from "../../../google/protobuf/timestamp.js";
import { PaginationRequest, PaginationResponse } from "../../filter/v2/filter.js";
import { Metadata as Metadata1, MetadataSearchFilter } from "../../metadata/v2/metadata.js";
import { Details, ListDetails, ListQuery, Organization } from "../../object/v2/object.js";
import { passkeyAuthenticatorFromJSON, passkeyAuthenticatorToJSON, PasskeyRegistrationCode, ReturnPasskeyRegistrationCode, SendPasskeyRegistrationLink, } from "./auth.js";
import { ReturnEmailVerificationCode, SendEmailVerificationCode, SetHumanEmail } from "./email.js";
import { FormData, IDPInformation, IDPIntent, IDPLink, LDAPCredentials, RedirectURLs } from "./idp.js";
import { Key, keyFieldNameFromJSON, keyFieldNameToJSON, KeysSearchFilter } from "./key.js";
import { HashedPassword, Password, ReturnPasswordResetCode, SendPasswordResetLink, SetPassword } from "./password.js";
import { PersonalAccessToken, personalAccessTokenFieldNameFromJSON, personalAccessTokenFieldNameToJSON, PersonalAccessTokensSearchFilter, } from "./pat.js";
import { ReturnPhoneVerificationCode, SendPhoneVerificationCode, SetHumanPhone } from "./phone.js";
import { SearchQuery, userFieldNameFromJSON, userFieldNameToJSON } from "./query.js";
import { AuthFactor, authFactorStateFromJSON, authFactorStateToJSON, genderFromJSON, genderToJSON, Passkey, ReturnInviteCode, SendInviteCode, SetHumanProfile, SetMetadataEntry, User, } from "./user.js";
export const protobufPackage = "zitadel.user.v2";
export var AuthenticationMethodType;
(function (AuthenticationMethodType) {
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_UNSPECIFIED"] = 0] = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_PASSWORD"] = 1] = "AUTHENTICATION_METHOD_TYPE_PASSWORD";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_PASSKEY"] = 2] = "AUTHENTICATION_METHOD_TYPE_PASSKEY";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_IDP"] = 3] = "AUTHENTICATION_METHOD_TYPE_IDP";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_TOTP"] = 4] = "AUTHENTICATION_METHOD_TYPE_TOTP";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_U2F"] = 5] = "AUTHENTICATION_METHOD_TYPE_U2F";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_OTP_SMS"] = 6] = "AUTHENTICATION_METHOD_TYPE_OTP_SMS";
    AuthenticationMethodType[AuthenticationMethodType["AUTHENTICATION_METHOD_TYPE_OTP_EMAIL"] = 7] = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL";
    AuthenticationMethodType[AuthenticationMethodType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(AuthenticationMethodType || (AuthenticationMethodType = {}));
export function authenticationMethodTypeFromJSON(object) {
    switch (object) {
        case 0:
        case "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_UNSPECIFIED;
        case 1:
        case "AUTHENTICATION_METHOD_TYPE_PASSWORD":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_PASSWORD;
        case 2:
        case "AUTHENTICATION_METHOD_TYPE_PASSKEY":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_PASSKEY;
        case 3:
        case "AUTHENTICATION_METHOD_TYPE_IDP":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_IDP;
        case 4:
        case "AUTHENTICATION_METHOD_TYPE_TOTP":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_TOTP;
        case 5:
        case "AUTHENTICATION_METHOD_TYPE_U2F":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_U2F;
        case 6:
        case "AUTHENTICATION_METHOD_TYPE_OTP_SMS":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_OTP_SMS;
        case 7:
        case "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL":
            return AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_OTP_EMAIL;
        case -1:
        case "UNRECOGNIZED":
        default:
            return AuthenticationMethodType.UNRECOGNIZED;
    }
}
export function authenticationMethodTypeToJSON(object) {
    switch (object) {
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_UNSPECIFIED:
            return "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_PASSWORD:
            return "AUTHENTICATION_METHOD_TYPE_PASSWORD";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_PASSKEY:
            return "AUTHENTICATION_METHOD_TYPE_PASSKEY";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_IDP:
            return "AUTHENTICATION_METHOD_TYPE_IDP";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_TOTP:
            return "AUTHENTICATION_METHOD_TYPE_TOTP";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_U2F:
            return "AUTHENTICATION_METHOD_TYPE_U2F";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_OTP_SMS:
            return "AUTHENTICATION_METHOD_TYPE_OTP_SMS";
        case AuthenticationMethodType.AUTHENTICATION_METHOD_TYPE_OTP_EMAIL:
            return "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL";
        case AuthenticationMethodType.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
export var AuthFactors;
(function (AuthFactors) {
    AuthFactors[AuthFactors["OTP"] = 0] = "OTP";
    AuthFactors[AuthFactors["OTP_SMS"] = 1] = "OTP_SMS";
    AuthFactors[AuthFactors["OTP_EMAIL"] = 2] = "OTP_EMAIL";
    AuthFactors[AuthFactors["U2F"] = 3] = "U2F";
    AuthFactors[AuthFactors["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(AuthFactors || (AuthFactors = {}));
export function authFactorsFromJSON(object) {
    switch (object) {
        case 0:
        case "OTP":
            return AuthFactors.OTP;
        case 1:
        case "OTP_SMS":
            return AuthFactors.OTP_SMS;
        case 2:
        case "OTP_EMAIL":
            return AuthFactors.OTP_EMAIL;
        case 3:
        case "U2F":
            return AuthFactors.U2F;
        case -1:
        case "UNRECOGNIZED":
        default:
            return AuthFactors.UNRECOGNIZED;
    }
}
export function authFactorsToJSON(object) {
    switch (object) {
        case AuthFactors.OTP:
            return "OTP";
        case AuthFactors.OTP_SMS:
            return "OTP_SMS";
        case AuthFactors.OTP_EMAIL:
            return "OTP_EMAIL";
        case AuthFactors.U2F:
            return "U2F";
        case AuthFactors.UNRECOGNIZED:
        default:
            return "UNRECOGNIZED";
    }
}
function createBaseAddHumanUserRequest() {
    return {
        userId: undefined,
        username: undefined,
        organization: undefined,
        profile: undefined,
        email: undefined,
        phone: undefined,
        metadata: [],
        password: undefined,
        hashedPassword: undefined,
        idpLinks: [],
        totpSecret: undefined,
    };
}
export const AddHumanUserRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== undefined) {
            writer.uint32(10).string(message.userId);
        }
        if (message.username !== undefined) {
            writer.uint32(18).string(message.username);
        }
        if (message.organization !== undefined) {
            Organization.encode(message.organization, writer.uint32(90).fork()).join();
        }
        if (message.profile !== undefined) {
            SetHumanProfile.encode(message.profile, writer.uint32(34).fork()).join();
        }
        if (message.email !== undefined) {
            SetHumanEmail.encode(message.email, writer.uint32(42).fork()).join();
        }
        if (message.phone !== undefined) {
            SetHumanPhone.encode(message.phone, writer.uint32(82).fork()).join();
        }
        for (const v of message.metadata) {
            SetMetadataEntry.encode(v, writer.uint32(50).fork()).join();
        }
        if (message.password !== undefined) {
            Password.encode(message.password, writer.uint32(58).fork()).join();
        }
        if (message.hashedPassword !== undefined) {
            HashedPassword.encode(message.hashedPassword, writer.uint32(66).fork()).join();
        }
        for (const v of message.idpLinks) {
            IDPLink.encode(v, writer.uint32(74).fork()).join();
        }
        if (message.totpSecret !== undefined) {
            writer.uint32(98).string(message.totpSecret);
        }
        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 = createBaseAddHumanUserRequest();
        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.username = reader.string();
                    continue;
                }
                case 11: {
                    if (tag !== 90) {
                        break;
                    }
                    message.organization = Organization.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.profile = SetHumanProfile.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.email = SetHumanEmail.decode(reader, reader.uint32());
                    continue;
                }
                case 10: {
                    if (tag !== 82) {
                        break;
                    }
                    message.phone = SetHumanPhone.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.metadata.push(SetMetadataEntry.decode(reader, reader.uint32()));
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.password = Password.decode(reader, reader.uint32());
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.hashedPassword = HashedPassword.decode(reader, reader.uint32());
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        break;
                    }
                    message.idpLinks.push(IDPLink.decode(reader, reader.uint32()));
                    continue;
                }
                case 12: {
                    if (tag !== 98) {
                        break;
                    }
                    message.totpSecret = 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,
            username: isSet(object.username) ? globalThis.String(object.username) : undefined,
            organization: isSet(object.organization) ? Organization.fromJSON(object.organization) : undefined,
            profile: isSet(object.profile) ? SetHumanProfile.fromJSON(object.profile) : undefined,
            email: isSet(object.email) ? SetHumanEmail.fromJSON(object.email) : undefined,
            phone: isSet(object.phone) ? SetHumanPhone.fromJSON(object.phone) : undefined,
            metadata: globalThis.Array.isArray(object?.metadata)
                ? object.metadata.map((e) => SetMetadataEntry.fromJSON(e))
                : [],
            password: isSet(object.password) ? Password.fromJSON(object.password) : undefined,
            hashedPassword: isSet(object.hashedPassword) ? HashedPassword.fromJSON(object.hashedPassword) : undefined,
            idpLinks: globalThis.Array.isArray(object?.idpLinks) ? object.idpLinks.map((e) => IDPLink.fromJSON(e)) : [],
            totpSecret: isSet(object.totpSecret) ? globalThis.String(object.totpSecret) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== undefined) {
            obj.userId = message.userId;
        }
        if (message.username !== undefined) {
            obj.username = message.username;
        }
        if (message.organization !== undefined) {
            obj.organization = Organization.toJSON(message.organization);
        }
        if (message.profile !== undefined) {
            obj.profile = SetHumanProfile.toJSON(message.profile);
        }
        if (message.email !== undefined) {
            obj.email = SetHumanEmail.toJSON(message.email);
        }
        if (message.phone !== undefined) {
            obj.phone = SetHumanPhone.toJSON(message.phone);
        }
        if (message.metadata?.length) {
            obj.metadata = message.metadata.map((e) => SetMetadataEntry.toJSON(e));
        }
        if (message.password !== undefined) {
            obj.password = Password.toJSON(message.password);
        }
        if (message.hashedPassword !== undefined) {
            obj.hashedPassword = HashedPassword.toJSON(message.hashedPassword);
        }
        if (message.idpLinks?.length) {
            obj.idpLinks = message.idpLinks.map((e) => IDPLink.toJSON(e));
        }
        if (message.totpSecret !== undefined) {
            obj.totpSecret = message.totpSecret;
        }
        return obj;
    },
    create(base) {
        return AddHumanUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddHumanUserRequest();
        message.userId = object.userId ?? undefined;
        message.username = object.username ?? undefined;
        message.organization = (object.organization !== undefined && object.organization !== null)
            ? Organization.fromPartial(object.organization)
            : undefined;
        message.profile = (object.profile !== undefined && object.profile !== null)
            ? SetHumanProfile.fromPartial(object.profile)
            : undefined;
        message.email = (object.email !== undefined && object.email !== null)
            ? SetHumanEmail.fromPartial(object.email)
            : undefined;
        message.phone = (object.phone !== undefined && object.phone !== null)
            ? SetHumanPhone.fromPartial(object.phone)
            : undefined;
        message.metadata = object.metadata?.map((e) => SetMetadataEntry.fromPartial(e)) || [];
        message.password = (object.password !== undefined && object.password !== null)
            ? Password.fromPartial(object.password)
            : undefined;
        message.hashedPassword = (object.hashedPassword !== undefined && object.hashedPassword !== null)
            ? HashedPassword.fromPartial(object.hashedPassword)
            : undefined;
        message.idpLinks = object.idpLinks?.map((e) => IDPLink.fromPartial(e)) || [];
        message.totpSecret = object.totpSecret ?? undefined;
        return message;
    },
};
function createBaseAddHumanUserResponse() {
    return { userId: "", details: undefined, emailCode: undefined, phoneCode: undefined };
}
export const AddHumanUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(18).fork()).join();
        }
        if (message.emailCode !== undefined) {
            writer.uint32(26).string(message.emailCode);
        }
        if (message.phoneCode !== undefined) {
            writer.uint32(34).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 = createBaseAddHumanUserResponse();
        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.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.emailCode = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        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) : "",
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            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.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.emailCode !== undefined) {
            obj.emailCode = message.emailCode;
        }
        if (message.phoneCode !== undefined) {
            obj.phoneCode = message.phoneCode;
        }
        return obj;
    },
    create(base) {
        return AddHumanUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddHumanUserResponse();
        message.userId = object.userId ?? "";
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.emailCode = object.emailCode ?? undefined;
        message.phoneCode = object.phoneCode ?? undefined;
        return message;
    },
};
function createBaseCreateUserRequest() {
    return { organizationId: "", userId: undefined, username: undefined, human: undefined, machine: undefined };
}
export const CreateUserRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.organizationId !== "") {
            writer.uint32(10).string(message.organizationId);
        }
        if (message.userId !== undefined) {
            writer.uint32(18).string(message.userId);
        }
        if (message.username !== undefined) {
            writer.uint32(26).string(message.username);
        }
        if (message.human !== undefined) {
            CreateUserRequest_Human.encode(message.human, writer.uint32(34).fork()).join();
        }
        if (message.machine !== undefined) {
            CreateUserRequest_Machine.encode(message.machine, writer.uint32(42).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 = createBaseCreateUserRequest();
        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.userId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.username = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.human = CreateUserRequest_Human.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.machine = CreateUserRequest_Machine.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) : "",
            userId: isSet(object.userId) ? globalThis.String(object.userId) : undefined,
            username: isSet(object.username) ? globalThis.String(object.username) : undefined,
            human: isSet(object.human) ? CreateUserRequest_Human.fromJSON(object.human) : undefined,
            machine: isSet(object.machine) ? CreateUserRequest_Machine.fromJSON(object.machine) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.organizationId !== "") {
            obj.organizationId = message.organizationId;
        }
        if (message.userId !== undefined) {
            obj.userId = message.userId;
        }
        if (message.username !== undefined) {
            obj.username = message.username;
        }
        if (message.human !== undefined) {
            obj.human = CreateUserRequest_Human.toJSON(message.human);
        }
        if (message.machine !== undefined) {
            obj.machine = CreateUserRequest_Machine.toJSON(message.machine);
        }
        return obj;
    },
    create(base) {
        return CreateUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserRequest();
        message.organizationId = object.organizationId ?? "";
        message.userId = object.userId ?? undefined;
        message.username = object.username ?? undefined;
        message.human = (object.human !== undefined && object.human !== null)
            ? CreateUserRequest_Human.fromPartial(object.human)
            : undefined;
        message.machine = (object.machine !== undefined && object.machine !== null)
            ? CreateUserRequest_Machine.fromPartial(object.machine)
            : undefined;
        return message;
    },
};
function createBaseCreateUserRequest_Human() {
    return {
        profile: undefined,
        email: undefined,
        phone: undefined,
        password: undefined,
        hashedPassword: undefined,
        idpLinks: [],
        totpSecret: undefined,
        metadata: [],
    };
}
export const CreateUserRequest_Human = {
    encode(message, writer = new BinaryWriter()) {
        if (message.profile !== undefined) {
            SetHumanProfile.encode(message.profile, writer.uint32(10).fork()).join();
        }
        if (message.email !== undefined) {
            SetHumanEmail.encode(message.email, writer.uint32(18).fork()).join();
        }
        if (message.phone !== undefined) {
            SetHumanPhone.encode(message.phone, writer.uint32(26).fork()).join();
        }
        if (message.password !== undefined) {
            Password.encode(message.password, writer.uint32(34).fork()).join();
        }
        if (message.hashedPassword !== undefined) {
            HashedPassword.encode(message.hashedPassword, writer.uint32(42).fork()).join();
        }
        for (const v of message.idpLinks) {
            IDPLink.encode(v, writer.uint32(58).fork()).join();
        }
        if (message.totpSecret !== undefined) {
            writer.uint32(66).string(message.totpSecret);
        }
        for (const v of message.metadata) {
            Metadata.encode(v, writer.uint32(74).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 = createBaseCreateUserRequest_Human();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.profile = SetHumanProfile.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.email = SetHumanEmail.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.phone = SetHumanPhone.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.password = Password.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.hashedPassword = HashedPassword.decode(reader, reader.uint32());
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.idpLinks.push(IDPLink.decode(reader, reader.uint32()));
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.totpSecret = reader.string();
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        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 {
            profile: isSet(object.profile) ? SetHumanProfile.fromJSON(object.profile) : undefined,
            email: isSet(object.email) ? SetHumanEmail.fromJSON(object.email) : undefined,
            phone: isSet(object.phone) ? SetHumanPhone.fromJSON(object.phone) : undefined,
            password: isSet(object.password) ? Password.fromJSON(object.password) : undefined,
            hashedPassword: isSet(object.hashedPassword) ? HashedPassword.fromJSON(object.hashedPassword) : undefined,
            idpLinks: globalThis.Array.isArray(object?.idpLinks) ? object.idpLinks.map((e) => IDPLink.fromJSON(e)) : [],
            totpSecret: isSet(object.totpSecret) ? globalThis.String(object.totpSecret) : undefined,
            metadata: globalThis.Array.isArray(object?.metadata) ? object.metadata.map((e) => Metadata.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.profile !== undefined) {
            obj.profile = SetHumanProfile.toJSON(message.profile);
        }
        if (message.email !== undefined) {
            obj.email = SetHumanEmail.toJSON(message.email);
        }
        if (message.phone !== undefined) {
            obj.phone = SetHumanPhone.toJSON(message.phone);
        }
        if (message.password !== undefined) {
            obj.password = Password.toJSON(message.password);
        }
        if (message.hashedPassword !== undefined) {
            obj.hashedPassword = HashedPassword.toJSON(message.hashedPassword);
        }
        if (message.idpLinks?.length) {
            obj.idpLinks = message.idpLinks.map((e) => IDPLink.toJSON(e));
        }
        if (message.totpSecret !== undefined) {
            obj.totpSecret = message.totpSecret;
        }
        if (message.metadata?.length) {
            obj.metadata = message.metadata.map((e) => Metadata.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return CreateUserRequest_Human.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserRequest_Human();
        message.profile = (object.profile !== undefined && object.profile !== null)
            ? SetHumanProfile.fromPartial(object.profile)
            : undefined;
        message.email = (object.email !== undefined && object.email !== null)
            ? SetHumanEmail.fromPartial(object.email)
            : undefined;
        message.phone = (object.phone !== undefined && object.phone !== null)
            ? SetHumanPhone.fromPartial(object.phone)
            : undefined;
        message.password = (object.password !== undefined && object.password !== null)
            ? Password.fromPartial(object.password)
            : undefined;
        message.hashedPassword = (object.hashedPassword !== undefined && object.hashedPassword !== null)
            ? HashedPassword.fromPartial(object.hashedPassword)
            : undefined;
        message.idpLinks = object.idpLinks?.map((e) => IDPLink.fromPartial(e)) || [];
        message.totpSecret = object.totpSecret ?? undefined;
        message.metadata = object.metadata?.map((e) => Metadata.fromPartial(e)) || [];
        return message;
    },
};
function createBaseCreateUserRequest_Machine() {
    return { name: "", description: undefined };
}
export const CreateUserRequest_Machine = {
    encode(message, writer = new BinaryWriter()) {
        if (message.name !== "") {
            writer.uint32(10).string(message.name);
        }
        if (message.description !== undefined) {
            writer.uint32(18).string(message.description);
        }
        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 = createBaseCreateUserRequest_Machine();
        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.description = reader.string();
                    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) : "",
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== "") {
            obj.name = message.name;
        }
        if (message.description !== undefined) {
            obj.description = message.description;
        }
        return obj;
    },
    create(base) {
        return CreateUserRequest_Machine.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserRequest_Machine();
        message.name = object.name ?? "";
        message.description = object.description ?? undefined;
        return message;
    },
};
function createBaseCreateUserResponse() {
    return { id: "", creationDate: undefined, emailCode: undefined, phoneCode: undefined };
}
export const CreateUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(18).fork()).join();
        }
        if (message.emailCode !== undefined) {
            writer.uint32(26).string(message.emailCode);
        }
        if (message.phoneCode !== undefined) {
            writer.uint32(34).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 = createBaseCreateUserResponse();
        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.creationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.emailCode = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.phoneCode = 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) : "",
            creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : undefined,
            emailCode: isSet(object.emailCode) ? globalThis.String(object.emailCode) : undefined,
            phoneCode: isSet(object.phoneCode) ? globalThis.String(object.phoneCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        if (message.emailCode !== undefined) {
            obj.emailCode = message.emailCode;
        }
        if (message.phoneCode !== undefined) {
            obj.phoneCode = message.phoneCode;
        }
        return obj;
    },
    create(base) {
        return CreateUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserResponse();
        message.id = object.id ?? "";
        message.creationDate = object.creationDate ?? undefined;
        message.emailCode = object.emailCode ?? undefined;
        message.phoneCode = object.phoneCode ?? undefined;
        return message;
    },
};
function createBaseGetUserByIDRequest() {
    return { userId: "" };
}
export const GetUserByIDRequest = {
    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 = createBaseGetUserByIDRequest();
        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 GetUserByIDRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetUserByIDRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseGetUserByIDResponse() {
    return { details: undefined, user: undefined };
}
export const GetUserByIDResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.user !== undefined) {
            User.encode(message.user, 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 = createBaseGetUserByIDResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.user = User.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.user !== undefined) {
            obj.user = User.toJSON(message.user);
        }
        return obj;
    },
    create(base) {
        return GetUserByIDResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetUserByIDResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
        return message;
    },
};
function createBaseListUsersRequest() {
    return { query: undefined, sortingColumn: 0, queries: [] };
}
export const ListUsersRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.query !== undefined) {
            ListQuery.encode(message.query, writer.uint32(10).fork()).join();
        }
        if (message.sortingColumn !== 0) {
            writer.uint32(16).int32(message.sortingColumn);
        }
        for (const v of message.queries) {
            SearchQuery.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 = createBaseListUsersRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.query = ListQuery.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.queries.push(SearchQuery.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            query: isSet(object.query) ? ListQuery.fromJSON(object.query) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? userFieldNameFromJSON(object.sortingColumn) : 0,
            queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => SearchQuery.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.query !== undefined) {
            obj.query = ListQuery.toJSON(message.query);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = userFieldNameToJSON(message.sortingColumn);
        }
        if (message.queries?.length) {
            obj.queries = message.queries.map((e) => SearchQuery.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListUsersRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListUsersRequest();
        message.query = (object.query !== undefined && object.query !== null)
            ? ListQuery.fromPartial(object.query)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.queries = object.queries?.map((e) => SearchQuery.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListUsersResponse() {
    return { details: undefined, sortingColumn: 0, result: [] };
}
export const ListUsersResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            ListDetails.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.sortingColumn !== 0) {
            writer.uint32(16).int32(message.sortingColumn);
        }
        for (const v of message.result) {
            User.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 = createBaseListUsersResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = ListDetails.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.result.push(User.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? ListDetails.fromJSON(object.details) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? userFieldNameFromJSON(object.sortingColumn) : 0,
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => User.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = ListDetails.toJSON(message.details);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = userFieldNameToJSON(message.sortingColumn);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => User.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListUsersResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListUsersResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? ListDetails.fromPartial(object.details)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.result = object.result?.map((e) => User.fromPartial(e)) || [];
        return message;
    },
};
function createBaseSetEmailRequest() {
    return { userId: "", email: "", sendCode: undefined, returnCode: undefined, isVerified: undefined };
}
export const SetEmailRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.email !== "") {
            writer.uint32(18).string(message.email);
        }
        if (message.sendCode !== undefined) {
            SendEmailVerificationCode.encode(message.sendCode, writer.uint32(26).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnEmailVerificationCode.encode(message.returnCode, writer.uint32(34).fork()).join();
        }
        if (message.isVerified !== undefined) {
            writer.uint32(40).bool(message.isVerified);
        }
        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 = createBaseSetEmailRequest();
        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.email = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.sendCode = SendEmailVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.returnCode = ReturnEmailVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.isVerified = reader.bool();
                    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) : "",
            email: isSet(object.email) ? globalThis.String(object.email) : "",
            sendCode: isSet(object.sendCode) ? SendEmailVerificationCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnEmailVerificationCode.fromJSON(object.returnCode) : undefined,
            isVerified: isSet(object.isVerified) ? globalThis.Boolean(object.isVerified) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.email !== "") {
            obj.email = message.email;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendEmailVerificationCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnEmailVerificationCode.toJSON(message.returnCode);
        }
        if (message.isVerified !== undefined) {
            obj.isVerified = message.isVerified;
        }
        return obj;
    },
    create(base) {
        return SetEmailRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetEmailRequest();
        message.userId = object.userId ?? "";
        message.email = object.email ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendEmailVerificationCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnEmailVerificationCode.fromPartial(object.returnCode)
            : undefined;
        message.isVerified = object.isVerified ?? undefined;
        return message;
    },
};
function createBaseSetEmailResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const SetEmailResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseSetEmailResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return SetEmailResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetEmailResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseResendEmailCodeRequest() {
    return { userId: "", sendCode: undefined, returnCode: undefined };
}
export const ResendEmailCodeRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendCode !== undefined) {
            SendEmailVerificationCode.encode(message.sendCode, writer.uint32(18).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnEmailVerificationCode.encode(message.returnCode, 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 = createBaseResendEmailCodeRequest();
        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.sendCode = SendEmailVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.returnCode = ReturnEmailVerificationCode.decode(reader, reader.uint32());
                    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) : "",
            sendCode: isSet(object.sendCode) ? SendEmailVerificationCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnEmailVerificationCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendEmailVerificationCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnEmailVerificationCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return ResendEmailCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendEmailCodeRequest();
        message.userId = object.userId ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendEmailVerificationCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnEmailVerificationCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBaseResendEmailCodeResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const ResendEmailCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseResendEmailCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return ResendEmailCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendEmailCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseSendEmailCodeRequest() {
    return { userId: "", sendCode: undefined, returnCode: undefined };
}
export const SendEmailCodeRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendCode !== undefined) {
            SendEmailVerificationCode.encode(message.sendCode, writer.uint32(18).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnEmailVerificationCode.encode(message.returnCode, 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 = createBaseSendEmailCodeRequest();
        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.sendCode = SendEmailVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.returnCode = ReturnEmailVerificationCode.decode(reader, reader.uint32());
                    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) : "",
            sendCode: isSet(object.sendCode) ? SendEmailVerificationCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnEmailVerificationCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendEmailVerificationCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnEmailVerificationCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return SendEmailCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSendEmailCodeRequest();
        message.userId = object.userId ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendEmailVerificationCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnEmailVerificationCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBaseSendEmailCodeResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const SendEmailCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseSendEmailCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return SendEmailCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSendEmailCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseVerifyEmailRequest() {
    return { userId: "", verificationCode: "" };
}
export const VerifyEmailRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.verificationCode !== "") {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseVerifyEmailRequest();
        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.verificationCode = 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) : "",
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.verificationCode !== "") {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return VerifyEmailRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyEmailRequest();
        message.userId = object.userId ?? "";
        message.verificationCode = object.verificationCode ?? "";
        return message;
    },
};
function createBaseVerifyEmailResponse() {
    return { details: undefined };
}
export const VerifyEmailResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyEmailResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyEmailResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyEmailResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseSetPhoneRequest() {
    return { userId: "", phone: "", sendCode: undefined, returnCode: undefined, isVerified: undefined };
}
export const SetPhoneRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.phone !== "") {
            writer.uint32(18).string(message.phone);
        }
        if (message.sendCode !== undefined) {
            SendPhoneVerificationCode.encode(message.sendCode, writer.uint32(26).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnPhoneVerificationCode.encode(message.returnCode, writer.uint32(34).fork()).join();
        }
        if (message.isVerified !== undefined) {
            writer.uint32(40).bool(message.isVerified);
        }
        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 = createBaseSetPhoneRequest();
        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.phone = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.sendCode = SendPhoneVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.returnCode = ReturnPhoneVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 40) {
                        break;
                    }
                    message.isVerified = reader.bool();
                    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) : "",
            phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
            sendCode: isSet(object.sendCode) ? SendPhoneVerificationCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnPhoneVerificationCode.fromJSON(object.returnCode) : undefined,
            isVerified: isSet(object.isVerified) ? globalThis.Boolean(object.isVerified) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.phone !== "") {
            obj.phone = message.phone;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendPhoneVerificationCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnPhoneVerificationCode.toJSON(message.returnCode);
        }
        if (message.isVerified !== undefined) {
            obj.isVerified = message.isVerified;
        }
        return obj;
    },
    create(base) {
        return SetPhoneRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetPhoneRequest();
        message.userId = object.userId ?? "";
        message.phone = object.phone ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendPhoneVerificationCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnPhoneVerificationCode.fromPartial(object.returnCode)
            : undefined;
        message.isVerified = object.isVerified ?? undefined;
        return message;
    },
};
function createBaseSetPhoneResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const SetPhoneResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseSetPhoneResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return SetPhoneResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetPhoneResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseRemovePhoneRequest() {
    return { userId: "" };
}
export const RemovePhoneRequest = {
    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 = createBaseRemovePhoneRequest();
        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 RemovePhoneRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePhoneRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRemovePhoneResponse() {
    return { details: undefined };
}
export const RemovePhoneResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemovePhoneResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemovePhoneResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePhoneResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseResendPhoneCodeRequest() {
    return { userId: "", sendCode: undefined, returnCode: undefined };
}
export const ResendPhoneCodeRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendCode !== undefined) {
            SendPhoneVerificationCode.encode(message.sendCode, writer.uint32(26).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnPhoneVerificationCode.encode(message.returnCode, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseResendPhoneCodeRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.sendCode = SendPhoneVerificationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.returnCode = ReturnPhoneVerificationCode.decode(reader, reader.uint32());
                    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) : "",
            sendCode: isSet(object.sendCode) ? SendPhoneVerificationCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnPhoneVerificationCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendPhoneVerificationCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnPhoneVerificationCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return ResendPhoneCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendPhoneCodeRequest();
        message.userId = object.userId ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendPhoneVerificationCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnPhoneVerificationCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBaseResendPhoneCodeResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const ResendPhoneCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseResendPhoneCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return ResendPhoneCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendPhoneCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseVerifyPhoneRequest() {
    return { userId: "", verificationCode: "" };
}
export const VerifyPhoneRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.verificationCode !== "") {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseVerifyPhoneRequest();
        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.verificationCode = 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) : "",
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.verificationCode !== "") {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return VerifyPhoneRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyPhoneRequest();
        message.userId = object.userId ?? "";
        message.verificationCode = object.verificationCode ?? "";
        return message;
    },
};
function createBaseVerifyPhoneResponse() {
    return { details: undefined };
}
export const VerifyPhoneResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyPhoneResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyPhoneResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyPhoneResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseDeleteUserRequest() {
    return { userId: "" };
}
export const DeleteUserRequest = {
    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 = createBaseDeleteUserRequest();
        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 DeleteUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseDeleteUserResponse() {
    return { details: undefined };
}
export const DeleteUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseDeleteUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return DeleteUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseUpdateUserRequest() {
    return { userId: "", username: undefined, human: undefined, machine: undefined };
}
export const UpdateUserRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.username !== undefined) {
            writer.uint32(18).string(message.username);
        }
        if (message.human !== undefined) {
            UpdateUserRequest_Human.encode(message.human, writer.uint32(26).fork()).join();
        }
        if (message.machine !== undefined) {
            UpdateUserRequest_Machine.encode(message.machine, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseUpdateUserRequest();
        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.username = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.human = UpdateUserRequest_Human.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.machine = UpdateUserRequest_Machine.decode(reader, reader.uint32());
                    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) : "",
            username: isSet(object.username) ? globalThis.String(object.username) : undefined,
            human: isSet(object.human) ? UpdateUserRequest_Human.fromJSON(object.human) : undefined,
            machine: isSet(object.machine) ? UpdateUserRequest_Machine.fromJSON(object.machine) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.username !== undefined) {
            obj.username = message.username;
        }
        if (message.human !== undefined) {
            obj.human = UpdateUserRequest_Human.toJSON(message.human);
        }
        if (message.machine !== undefined) {
            obj.machine = UpdateUserRequest_Machine.toJSON(message.machine);
        }
        return obj;
    },
    create(base) {
        return UpdateUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateUserRequest();
        message.userId = object.userId ?? "";
        message.username = object.username ?? undefined;
        message.human = (object.human !== undefined && object.human !== null)
            ? UpdateUserRequest_Human.fromPartial(object.human)
            : undefined;
        message.machine = (object.machine !== undefined && object.machine !== null)
            ? UpdateUserRequest_Machine.fromPartial(object.machine)
            : undefined;
        return message;
    },
};
function createBaseUpdateUserRequest_Human() {
    return { profile: undefined, email: undefined, phone: undefined, password: undefined };
}
export const UpdateUserRequest_Human = {
    encode(message, writer = new BinaryWriter()) {
        if (message.profile !== undefined) {
            UpdateUserRequest_Human_Profile.encode(message.profile, writer.uint32(10).fork()).join();
        }
        if (message.email !== undefined) {
            SetHumanEmail.encode(message.email, writer.uint32(18).fork()).join();
        }
        if (message.phone !== undefined) {
            SetHumanPhone.encode(message.phone, writer.uint32(26).fork()).join();
        }
        if (message.password !== undefined) {
            SetPassword.encode(message.password, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseUpdateUserRequest_Human();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.profile = UpdateUserRequest_Human_Profile.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.email = SetHumanEmail.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.phone = SetHumanPhone.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.password = SetPassword.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            profile: isSet(object.profile) ? UpdateUserRequest_Human_Profile.fromJSON(object.profile) : undefined,
            email: isSet(object.email) ? SetHumanEmail.fromJSON(object.email) : undefined,
            phone: isSet(object.phone) ? SetHumanPhone.fromJSON(object.phone) : undefined,
            password: isSet(object.password) ? SetPassword.fromJSON(object.password) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.profile !== undefined) {
            obj.profile = UpdateUserRequest_Human_Profile.toJSON(message.profile);
        }
        if (message.email !== undefined) {
            obj.email = SetHumanEmail.toJSON(message.email);
        }
        if (message.phone !== undefined) {
            obj.phone = SetHumanPhone.toJSON(message.phone);
        }
        if (message.password !== undefined) {
            obj.password = SetPassword.toJSON(message.password);
        }
        return obj;
    },
    create(base) {
        return UpdateUserRequest_Human.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateUserRequest_Human();
        message.profile = (object.profile !== undefined && object.profile !== null)
            ? UpdateUserRequest_Human_Profile.fromPartial(object.profile)
            : undefined;
        message.email = (object.email !== undefined && object.email !== null)
            ? SetHumanEmail.fromPartial(object.email)
            : undefined;
        message.phone = (object.phone !== undefined && object.phone !== null)
            ? SetHumanPhone.fromPartial(object.phone)
            : undefined;
        message.password = (object.password !== undefined && object.password !== null)
            ? SetPassword.fromPartial(object.password)
            : undefined;
        return message;
    },
};
function createBaseUpdateUserRequest_Human_Profile() {
    return {
        givenName: undefined,
        familyName: undefined,
        nickName: undefined,
        displayName: undefined,
        preferredLanguage: undefined,
        gender: undefined,
    };
}
export const UpdateUserRequest_Human_Profile = {
    encode(message, writer = new BinaryWriter()) {
        if (message.givenName !== undefined) {
            writer.uint32(10).string(message.givenName);
        }
        if (message.familyName !== undefined) {
            writer.uint32(18).string(message.familyName);
        }
        if (message.nickName !== undefined) {
            writer.uint32(26).string(message.nickName);
        }
        if (message.displayName !== undefined) {
            writer.uint32(34).string(message.displayName);
        }
        if (message.preferredLanguage !== undefined) {
            writer.uint32(42).string(message.preferredLanguage);
        }
        if (message.gender !== undefined) {
            writer.uint32(48).int32(message.gender);
        }
        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 = createBaseUpdateUserRequest_Human_Profile();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.givenName = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.familyName = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.nickName = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.displayName = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.preferredLanguage = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 48) {
                        break;
                    }
                    message.gender = reader.int32();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            givenName: isSet(object.givenName) ? globalThis.String(object.givenName) : undefined,
            familyName: isSet(object.familyName) ? globalThis.String(object.familyName) : undefined,
            nickName: isSet(object.nickName) ? globalThis.String(object.nickName) : undefined,
            displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : undefined,
            preferredLanguage: isSet(object.preferredLanguage) ? globalThis.String(object.preferredLanguage) : undefined,
            gender: isSet(object.gender) ? genderFromJSON(object.gender) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.givenName !== undefined) {
            obj.givenName = message.givenName;
        }
        if (message.familyName !== undefined) {
            obj.familyName = message.familyName;
        }
        if (message.nickName !== undefined) {
            obj.nickName = message.nickName;
        }
        if (message.displayName !== undefined) {
            obj.displayName = message.displayName;
        }
        if (message.preferredLanguage !== undefined) {
            obj.preferredLanguage = message.preferredLanguage;
        }
        if (message.gender !== undefined) {
            obj.gender = genderToJSON(message.gender);
        }
        return obj;
    },
    create(base) {
        return UpdateUserRequest_Human_Profile.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateUserRequest_Human_Profile();
        message.givenName = object.givenName ?? undefined;
        message.familyName = object.familyName ?? undefined;
        message.nickName = object.nickName ?? undefined;
        message.displayName = object.displayName ?? undefined;
        message.preferredLanguage = object.preferredLanguage ?? undefined;
        message.gender = object.gender ?? undefined;
        return message;
    },
};
function createBaseUpdateUserRequest_Machine() {
    return { name: undefined, description: undefined };
}
export const UpdateUserRequest_Machine = {
    encode(message, writer = new BinaryWriter()) {
        if (message.name !== undefined) {
            writer.uint32(10).string(message.name);
        }
        if (message.description !== undefined) {
            writer.uint32(18).string(message.description);
        }
        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 = createBaseUpdateUserRequest_Machine();
        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.description = reader.string();
                    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) : undefined,
            description: isSet(object.description) ? globalThis.String(object.description) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        if (message.description !== undefined) {
            obj.description = message.description;
        }
        return obj;
    },
    create(base) {
        return UpdateUserRequest_Machine.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateUserRequest_Machine();
        message.name = object.name ?? undefined;
        message.description = object.description ?? undefined;
        return message;
    },
};
function createBaseUpdateUserResponse() {
    return { changeDate: undefined, emailCode: undefined, phoneCode: undefined };
}
export const UpdateUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.changeDate !== undefined) {
            Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
        }
        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 = createBaseUpdateUserResponse();
        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;
                }
                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 {
            changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : undefined,
            emailCode: isSet(object.emailCode) ? globalThis.String(object.emailCode) : undefined,
            phoneCode: isSet(object.phoneCode) ? globalThis.String(object.phoneCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.changeDate !== undefined) {
            obj.changeDate = message.changeDate.toISOString();
        }
        if (message.emailCode !== undefined) {
            obj.emailCode = message.emailCode;
        }
        if (message.phoneCode !== undefined) {
            obj.phoneCode = message.phoneCode;
        }
        return obj;
    },
    create(base) {
        return UpdateUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateUserResponse();
        message.changeDate = object.changeDate ?? undefined;
        message.emailCode = object.emailCode ?? undefined;
        message.phoneCode = object.phoneCode ?? undefined;
        return message;
    },
};
function createBaseUpdateHumanUserRequest() {
    return {
        userId: "",
        username: undefined,
        profile: undefined,
        email: undefined,
        phone: undefined,
        password: undefined,
    };
}
export const UpdateHumanUserRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.username !== undefined) {
            writer.uint32(18).string(message.username);
        }
        if (message.profile !== undefined) {
            SetHumanProfile.encode(message.profile, writer.uint32(26).fork()).join();
        }
        if (message.email !== undefined) {
            SetHumanEmail.encode(message.email, writer.uint32(34).fork()).join();
        }
        if (message.phone !== undefined) {
            SetHumanPhone.encode(message.phone, writer.uint32(42).fork()).join();
        }
        if (message.password !== undefined) {
            SetPassword.encode(message.password, writer.uint32(50).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 = createBaseUpdateHumanUserRequest();
        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.username = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.profile = SetHumanProfile.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.email = SetHumanEmail.decode(reader, reader.uint32());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.phone = SetHumanPhone.decode(reader, reader.uint32());
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.password = SetPassword.decode(reader, reader.uint32());
                    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) : "",
            username: isSet(object.username) ? globalThis.String(object.username) : undefined,
            profile: isSet(object.profile) ? SetHumanProfile.fromJSON(object.profile) : undefined,
            email: isSet(object.email) ? SetHumanEmail.fromJSON(object.email) : undefined,
            phone: isSet(object.phone) ? SetHumanPhone.fromJSON(object.phone) : undefined,
            password: isSet(object.password) ? SetPassword.fromJSON(object.password) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.username !== undefined) {
            obj.username = message.username;
        }
        if (message.profile !== undefined) {
            obj.profile = SetHumanProfile.toJSON(message.profile);
        }
        if (message.email !== undefined) {
            obj.email = SetHumanEmail.toJSON(message.email);
        }
        if (message.phone !== undefined) {
            obj.phone = SetHumanPhone.toJSON(message.phone);
        }
        if (message.password !== undefined) {
            obj.password = SetPassword.toJSON(message.password);
        }
        return obj;
    },
    create(base) {
        return UpdateHumanUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateHumanUserRequest();
        message.userId = object.userId ?? "";
        message.username = object.username ?? undefined;
        message.profile = (object.profile !== undefined && object.profile !== null)
            ? SetHumanProfile.fromPartial(object.profile)
            : undefined;
        message.email = (object.email !== undefined && object.email !== null)
            ? SetHumanEmail.fromPartial(object.email)
            : undefined;
        message.phone = (object.phone !== undefined && object.phone !== null)
            ? SetHumanPhone.fromPartial(object.phone)
            : undefined;
        message.password = (object.password !== undefined && object.password !== null)
            ? SetPassword.fromPartial(object.password)
            : undefined;
        return message;
    },
};
function createBaseUpdateHumanUserResponse() {
    return { details: undefined, emailCode: undefined, phoneCode: undefined };
}
export const UpdateHumanUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        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 = createBaseUpdateHumanUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    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 {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            emailCode: isSet(object.emailCode) ? globalThis.String(object.emailCode) : undefined,
            phoneCode: isSet(object.phoneCode) ? globalThis.String(object.phoneCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.emailCode !== undefined) {
            obj.emailCode = message.emailCode;
        }
        if (message.phoneCode !== undefined) {
            obj.phoneCode = message.phoneCode;
        }
        return obj;
    },
    create(base) {
        return UpdateHumanUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUpdateHumanUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.emailCode = object.emailCode ?? undefined;
        message.phoneCode = object.phoneCode ?? undefined;
        return message;
    },
};
function createBaseDeactivateUserRequest() {
    return { userId: "" };
}
export const DeactivateUserRequest = {
    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 = createBaseDeactivateUserRequest();
        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 DeactivateUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateUserRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseDeactivateUserResponse() {
    return { details: undefined };
}
export const DeactivateUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseDeactivateUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return DeactivateUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseReactivateUserRequest() {
    return { userId: "" };
}
export const ReactivateUserRequest = {
    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 = createBaseReactivateUserRequest();
        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 ReactivateUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseReactivateUserRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseReactivateUserResponse() {
    return { details: undefined };
}
export const ReactivateUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseReactivateUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return ReactivateUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseReactivateUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseLockUserRequest() {
    return { userId: "" };
}
export const LockUserRequest = {
    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 = createBaseLockUserRequest();
        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 LockUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseLockUserRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseLockUserResponse() {
    return { details: undefined };
}
export const LockUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseLockUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return LockUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseLockUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseUnlockUserRequest() {
    return { userId: "" };
}
export const UnlockUserRequest = {
    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 = createBaseUnlockUserRequest();
        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 UnlockUserRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUnlockUserRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseUnlockUserResponse() {
    return { details: undefined };
}
export const UnlockUserResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseUnlockUserResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return UnlockUserResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseUnlockUserResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRegisterPasskeyRequest() {
    return { userId: "", code: undefined, authenticator: 0, domain: "" };
}
export const RegisterPasskeyRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.code !== undefined) {
            PasskeyRegistrationCode.encode(message.code, writer.uint32(18).fork()).join();
        }
        if (message.authenticator !== 0) {
            writer.uint32(24).int32(message.authenticator);
        }
        if (message.domain !== "") {
            writer.uint32(34).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 = createBaseRegisterPasskeyRequest();
        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.code = PasskeyRegistrationCode.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.authenticator = reader.int32();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.domain = 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) : "",
            code: isSet(object.code) ? PasskeyRegistrationCode.fromJSON(object.code) : undefined,
            authenticator: isSet(object.authenticator) ? passkeyAuthenticatorFromJSON(object.authenticator) : 0,
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.code !== undefined) {
            obj.code = PasskeyRegistrationCode.toJSON(message.code);
        }
        if (message.authenticator !== 0) {
            obj.authenticator = passkeyAuthenticatorToJSON(message.authenticator);
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return RegisterPasskeyRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterPasskeyRequest();
        message.userId = object.userId ?? "";
        message.code = (object.code !== undefined && object.code !== null)
            ? PasskeyRegistrationCode.fromPartial(object.code)
            : undefined;
        message.authenticator = object.authenticator ?? 0;
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseRegisterPasskeyResponse() {
    return { details: undefined, passkeyId: "", publicKeyCredentialCreationOptions: undefined };
}
export const RegisterPasskeyResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.passkeyId !== "") {
            writer.uint32(18).string(message.passkeyId);
        }
        if (message.publicKeyCredentialCreationOptions !== undefined) {
            Struct.encode(Struct.wrap(message.publicKeyCredentialCreationOptions), 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 = createBaseRegisterPasskeyResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.passkeyId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.publicKeyCredentialCreationOptions = Struct.unwrap(Struct.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            passkeyId: isSet(object.passkeyId) ? globalThis.String(object.passkeyId) : "",
            publicKeyCredentialCreationOptions: isObject(object.publicKeyCredentialCreationOptions)
                ? object.publicKeyCredentialCreationOptions
                : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.passkeyId !== "") {
            obj.passkeyId = message.passkeyId;
        }
        if (message.publicKeyCredentialCreationOptions !== undefined) {
            obj.publicKeyCredentialCreationOptions = message.publicKeyCredentialCreationOptions;
        }
        return obj;
    },
    create(base) {
        return RegisterPasskeyResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterPasskeyResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.passkeyId = object.passkeyId ?? "";
        message.publicKeyCredentialCreationOptions = object.publicKeyCredentialCreationOptions ?? undefined;
        return message;
    },
};
function createBaseVerifyPasskeyRegistrationRequest() {
    return { userId: "", passkeyId: "", publicKeyCredential: undefined, passkeyName: "" };
}
export const VerifyPasskeyRegistrationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.passkeyId !== "") {
            writer.uint32(18).string(message.passkeyId);
        }
        if (message.publicKeyCredential !== undefined) {
            Struct.encode(Struct.wrap(message.publicKeyCredential), writer.uint32(26).fork()).join();
        }
        if (message.passkeyName !== "") {
            writer.uint32(34).string(message.passkeyName);
        }
        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 = createBaseVerifyPasskeyRegistrationRequest();
        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.passkeyId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.publicKeyCredential = Struct.unwrap(Struct.decode(reader, reader.uint32()));
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.passkeyName = 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) : "",
            passkeyId: isSet(object.passkeyId) ? globalThis.String(object.passkeyId) : "",
            publicKeyCredential: isObject(object.publicKeyCredential) ? object.publicKeyCredential : undefined,
            passkeyName: isSet(object.passkeyName) ? globalThis.String(object.passkeyName) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.passkeyId !== "") {
            obj.passkeyId = message.passkeyId;
        }
        if (message.publicKeyCredential !== undefined) {
            obj.publicKeyCredential = message.publicKeyCredential;
        }
        if (message.passkeyName !== "") {
            obj.passkeyName = message.passkeyName;
        }
        return obj;
    },
    create(base) {
        return VerifyPasskeyRegistrationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyPasskeyRegistrationRequest();
        message.userId = object.userId ?? "";
        message.passkeyId = object.passkeyId ?? "";
        message.publicKeyCredential = object.publicKeyCredential ?? undefined;
        message.passkeyName = object.passkeyName ?? "";
        return message;
    },
};
function createBaseVerifyPasskeyRegistrationResponse() {
    return { details: undefined };
}
export const VerifyPasskeyRegistrationResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyPasskeyRegistrationResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyPasskeyRegistrationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyPasskeyRegistrationResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRegisterU2FRequest() {
    return { userId: "", domain: "" };
}
export const RegisterU2FRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        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 = createBaseRegisterU2FRequest();
        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.domain = 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) : "",
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return RegisterU2FRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterU2FRequest();
        message.userId = object.userId ?? "";
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseRegisterU2FResponse() {
    return { details: undefined, u2fId: "", publicKeyCredentialCreationOptions: undefined };
}
export const RegisterU2FResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.u2fId !== "") {
            writer.uint32(18).string(message.u2fId);
        }
        if (message.publicKeyCredentialCreationOptions !== undefined) {
            Struct.encode(Struct.wrap(message.publicKeyCredentialCreationOptions), 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 = createBaseRegisterU2FResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.u2fId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.publicKeyCredentialCreationOptions = Struct.unwrap(Struct.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            u2fId: isSet(object.u2fId) ? globalThis.String(object.u2fId) : "",
            publicKeyCredentialCreationOptions: isObject(object.publicKeyCredentialCreationOptions)
                ? object.publicKeyCredentialCreationOptions
                : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.u2fId !== "") {
            obj.u2fId = message.u2fId;
        }
        if (message.publicKeyCredentialCreationOptions !== undefined) {
            obj.publicKeyCredentialCreationOptions = message.publicKeyCredentialCreationOptions;
        }
        return obj;
    },
    create(base) {
        return RegisterU2FResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterU2FResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.u2fId = object.u2fId ?? "";
        message.publicKeyCredentialCreationOptions = object.publicKeyCredentialCreationOptions ?? undefined;
        return message;
    },
};
function createBaseVerifyU2FRegistrationRequest() {
    return { userId: "", u2fId: "", publicKeyCredential: undefined, tokenName: "" };
}
export const VerifyU2FRegistrationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.u2fId !== "") {
            writer.uint32(18).string(message.u2fId);
        }
        if (message.publicKeyCredential !== undefined) {
            Struct.encode(Struct.wrap(message.publicKeyCredential), writer.uint32(26).fork()).join();
        }
        if (message.tokenName !== "") {
            writer.uint32(34).string(message.tokenName);
        }
        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 = createBaseVerifyU2FRegistrationRequest();
        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.u2fId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.publicKeyCredential = Struct.unwrap(Struct.decode(reader, reader.uint32()));
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.tokenName = 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) : "",
            u2fId: isSet(object.u2fId) ? globalThis.String(object.u2fId) : "",
            publicKeyCredential: isObject(object.publicKeyCredential) ? object.publicKeyCredential : undefined,
            tokenName: isSet(object.tokenName) ? globalThis.String(object.tokenName) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.u2fId !== "") {
            obj.u2fId = message.u2fId;
        }
        if (message.publicKeyCredential !== undefined) {
            obj.publicKeyCredential = message.publicKeyCredential;
        }
        if (message.tokenName !== "") {
            obj.tokenName = message.tokenName;
        }
        return obj;
    },
    create(base) {
        return VerifyU2FRegistrationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyU2FRegistrationRequest();
        message.userId = object.userId ?? "";
        message.u2fId = object.u2fId ?? "";
        message.publicKeyCredential = object.publicKeyCredential ?? undefined;
        message.tokenName = object.tokenName ?? "";
        return message;
    },
};
function createBaseVerifyU2FRegistrationResponse() {
    return { details: undefined };
}
export const VerifyU2FRegistrationResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyU2FRegistrationResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyU2FRegistrationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyU2FRegistrationResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRemoveU2FRequest() {
    return { userId: "", u2fId: "" };
}
export const RemoveU2FRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.u2fId !== "") {
            writer.uint32(18).string(message.u2fId);
        }
        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 = createBaseRemoveU2FRequest();
        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.u2fId = 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) : "",
            u2fId: isSet(object.u2fId) ? globalThis.String(object.u2fId) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.u2fId !== "") {
            obj.u2fId = message.u2fId;
        }
        return obj;
    },
    create(base) {
        return RemoveU2FRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveU2FRequest();
        message.userId = object.userId ?? "";
        message.u2fId = object.u2fId ?? "";
        return message;
    },
};
function createBaseRemoveU2FResponse() {
    return { details: undefined };
}
export const RemoveU2FResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemoveU2FResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemoveU2FResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveU2FResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRegisterTOTPRequest() {
    return { userId: "" };
}
export const RegisterTOTPRequest = {
    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 = createBaseRegisterTOTPRequest();
        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 RegisterTOTPRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterTOTPRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRegisterTOTPResponse() {
    return { details: undefined, uri: "", secret: "" };
}
export const RegisterTOTPResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.uri !== "") {
            writer.uint32(18).string(message.uri);
        }
        if (message.secret !== "") {
            writer.uint32(26).string(message.secret);
        }
        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 = createBaseRegisterTOTPResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.uri = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.secret = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            uri: isSet(object.uri) ? globalThis.String(object.uri) : "",
            secret: isSet(object.secret) ? globalThis.String(object.secret) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.uri !== "") {
            obj.uri = message.uri;
        }
        if (message.secret !== "") {
            obj.secret = message.secret;
        }
        return obj;
    },
    create(base) {
        return RegisterTOTPResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRegisterTOTPResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.uri = object.uri ?? "";
        message.secret = object.secret ?? "";
        return message;
    },
};
function createBaseVerifyTOTPRegistrationRequest() {
    return { userId: "", code: "" };
}
export const VerifyTOTPRegistrationRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.code !== "") {
            writer.uint32(18).string(message.code);
        }
        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 = createBaseVerifyTOTPRegistrationRequest();
        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.code = 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) : "",
            code: isSet(object.code) ? globalThis.String(object.code) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.code !== "") {
            obj.code = message.code;
        }
        return obj;
    },
    create(base) {
        return VerifyTOTPRegistrationRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyTOTPRegistrationRequest();
        message.userId = object.userId ?? "";
        message.code = object.code ?? "";
        return message;
    },
};
function createBaseVerifyTOTPRegistrationResponse() {
    return { details: undefined };
}
export const VerifyTOTPRegistrationResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyTOTPRegistrationResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyTOTPRegistrationResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyTOTPRegistrationResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRemoveTOTPRequest() {
    return { userId: "" };
}
export const RemoveTOTPRequest = {
    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 = createBaseRemoveTOTPRequest();
        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 RemoveTOTPRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveTOTPRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRemoveTOTPResponse() {
    return { details: undefined };
}
export const RemoveTOTPResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemoveTOTPResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemoveTOTPResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveTOTPResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseAddOTPSMSRequest() {
    return { userId: "" };
}
export const AddOTPSMSRequest = {
    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 = createBaseAddOTPSMSRequest();
        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 AddOTPSMSRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOTPSMSRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseAddOTPSMSResponse() {
    return { details: undefined };
}
export const AddOTPSMSResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseAddOTPSMSResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return AddOTPSMSResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOTPSMSResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRemoveOTPSMSRequest() {
    return { userId: "" };
}
export const RemoveOTPSMSRequest = {
    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 = createBaseRemoveOTPSMSRequest();
        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 RemoveOTPSMSRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveOTPSMSRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRemoveOTPSMSResponse() {
    return { details: undefined };
}
export const RemoveOTPSMSResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemoveOTPSMSResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemoveOTPSMSResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveOTPSMSResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseAddOTPEmailRequest() {
    return { userId: "" };
}
export const AddOTPEmailRequest = {
    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 = createBaseAddOTPEmailRequest();
        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 AddOTPEmailRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOTPEmailRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseAddOTPEmailResponse() {
    return { details: undefined };
}
export const AddOTPEmailResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseAddOTPEmailResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return AddOTPEmailResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddOTPEmailResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseRemoveOTPEmailRequest() {
    return { userId: "" };
}
export const RemoveOTPEmailRequest = {
    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 = createBaseRemoveOTPEmailRequest();
        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 RemoveOTPEmailRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveOTPEmailRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRemoveOTPEmailResponse() {
    return { details: undefined };
}
export const RemoveOTPEmailResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemoveOTPEmailResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemoveOTPEmailResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveOTPEmailResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseCreatePasskeyRegistrationLinkRequest() {
    return { userId: "", sendLink: undefined, returnCode: undefined };
}
export const CreatePasskeyRegistrationLinkRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendLink !== undefined) {
            SendPasskeyRegistrationLink.encode(message.sendLink, writer.uint32(18).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnPasskeyRegistrationCode.encode(message.returnCode, 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 = createBaseCreatePasskeyRegistrationLinkRequest();
        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.sendLink = SendPasskeyRegistrationLink.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.returnCode = ReturnPasskeyRegistrationCode.decode(reader, reader.uint32());
                    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) : "",
            sendLink: isSet(object.sendLink) ? SendPasskeyRegistrationLink.fromJSON(object.sendLink) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnPasskeyRegistrationCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendLink !== undefined) {
            obj.sendLink = SendPasskeyRegistrationLink.toJSON(message.sendLink);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnPasskeyRegistrationCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return CreatePasskeyRegistrationLinkRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreatePasskeyRegistrationLinkRequest();
        message.userId = object.userId ?? "";
        message.sendLink = (object.sendLink !== undefined && object.sendLink !== null)
            ? SendPasskeyRegistrationLink.fromPartial(object.sendLink)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnPasskeyRegistrationCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBaseCreatePasskeyRegistrationLinkResponse() {
    return { details: undefined, code: undefined };
}
export const CreatePasskeyRegistrationLinkResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.code !== undefined) {
            PasskeyRegistrationCode.encode(message.code, 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 = createBaseCreatePasskeyRegistrationLinkResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.code = PasskeyRegistrationCode.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            code: isSet(object.code) ? PasskeyRegistrationCode.fromJSON(object.code) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.code !== undefined) {
            obj.code = PasskeyRegistrationCode.toJSON(message.code);
        }
        return obj;
    },
    create(base) {
        return CreatePasskeyRegistrationLinkResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreatePasskeyRegistrationLinkResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.code = (object.code !== undefined && object.code !== null)
            ? PasskeyRegistrationCode.fromPartial(object.code)
            : undefined;
        return message;
    },
};
function createBaseListPasskeysRequest() {
    return { userId: "" };
}
export const ListPasskeysRequest = {
    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 = createBaseListPasskeysRequest();
        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 ListPasskeysRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListPasskeysRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseListPasskeysResponse() {
    return { details: undefined, result: [] };
}
export const ListPasskeysResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            ListDetails.encode(message.details, writer.uint32(10).fork()).join();
        }
        for (const v of message.result) {
            Passkey.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 = createBaseListPasskeysResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = ListDetails.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.result.push(Passkey.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? ListDetails.fromJSON(object.details) : undefined,
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => Passkey.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = ListDetails.toJSON(message.details);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => Passkey.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListPasskeysResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListPasskeysResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? ListDetails.fromPartial(object.details)
            : undefined;
        message.result = object.result?.map((e) => Passkey.fromPartial(e)) || [];
        return message;
    },
};
function createBaseRemovePasskeyRequest() {
    return { userId: "", passkeyId: "" };
}
export const RemovePasskeyRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.passkeyId !== "") {
            writer.uint32(18).string(message.passkeyId);
        }
        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 = createBaseRemovePasskeyRequest();
        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.passkeyId = 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) : "",
            passkeyId: isSet(object.passkeyId) ? globalThis.String(object.passkeyId) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.passkeyId !== "") {
            obj.passkeyId = message.passkeyId;
        }
        return obj;
    },
    create(base) {
        return RemovePasskeyRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePasskeyRequest();
        message.userId = object.userId ?? "";
        message.passkeyId = object.passkeyId ?? "";
        return message;
    },
};
function createBaseRemovePasskeyResponse() {
    return { details: undefined };
}
export const RemovePasskeyResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemovePasskeyResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemovePasskeyResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePasskeyResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseStartIdentityProviderIntentRequest() {
    return { idpId: "", urls: undefined, ldap: undefined };
}
export const StartIdentityProviderIntentRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.idpId !== "") {
            writer.uint32(10).string(message.idpId);
        }
        if (message.urls !== undefined) {
            RedirectURLs.encode(message.urls, writer.uint32(18).fork()).join();
        }
        if (message.ldap !== undefined) {
            LDAPCredentials.encode(message.ldap, 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 = createBaseStartIdentityProviderIntentRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.idpId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.urls = RedirectURLs.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.ldap = LDAPCredentials.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            idpId: isSet(object.idpId) ? globalThis.String(object.idpId) : "",
            urls: isSet(object.urls) ? RedirectURLs.fromJSON(object.urls) : undefined,
            ldap: isSet(object.ldap) ? LDAPCredentials.fromJSON(object.ldap) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.idpId !== "") {
            obj.idpId = message.idpId;
        }
        if (message.urls !== undefined) {
            obj.urls = RedirectURLs.toJSON(message.urls);
        }
        if (message.ldap !== undefined) {
            obj.ldap = LDAPCredentials.toJSON(message.ldap);
        }
        return obj;
    },
    create(base) {
        return StartIdentityProviderIntentRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseStartIdentityProviderIntentRequest();
        message.idpId = object.idpId ?? "";
        message.urls = (object.urls !== undefined && object.urls !== null)
            ? RedirectURLs.fromPartial(object.urls)
            : undefined;
        message.ldap = (object.ldap !== undefined && object.ldap !== null)
            ? LDAPCredentials.fromPartial(object.ldap)
            : undefined;
        return message;
    },
};
function createBaseStartIdentityProviderIntentResponse() {
    return { details: undefined, authUrl: undefined, idpIntent: undefined, postForm: undefined, formData: undefined };
}
export const StartIdentityProviderIntentResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.authUrl !== undefined) {
            writer.uint32(18).string(message.authUrl);
        }
        if (message.idpIntent !== undefined) {
            IDPIntent.encode(message.idpIntent, writer.uint32(26).fork()).join();
        }
        if (message.postForm !== undefined) {
            writer.uint32(34).bytes(message.postForm);
        }
        if (message.formData !== undefined) {
            FormData.encode(message.formData, writer.uint32(42).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 = createBaseStartIdentityProviderIntentResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.authUrl = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.idpIntent = IDPIntent.decode(reader, reader.uint32());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.postForm = Buffer.from(reader.bytes());
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.formData = FormData.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            authUrl: isSet(object.authUrl) ? globalThis.String(object.authUrl) : undefined,
            idpIntent: isSet(object.idpIntent) ? IDPIntent.fromJSON(object.idpIntent) : undefined,
            postForm: isSet(object.postForm) ? Buffer.from(bytesFromBase64(object.postForm)) : undefined,
            formData: isSet(object.formData) ? FormData.fromJSON(object.formData) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.authUrl !== undefined) {
            obj.authUrl = message.authUrl;
        }
        if (message.idpIntent !== undefined) {
            obj.idpIntent = IDPIntent.toJSON(message.idpIntent);
        }
        if (message.postForm !== undefined) {
            obj.postForm = base64FromBytes(message.postForm);
        }
        if (message.formData !== undefined) {
            obj.formData = FormData.toJSON(message.formData);
        }
        return obj;
    },
    create(base) {
        return StartIdentityProviderIntentResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseStartIdentityProviderIntentResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.authUrl = object.authUrl ?? undefined;
        message.idpIntent = (object.idpIntent !== undefined && object.idpIntent !== null)
            ? IDPIntent.fromPartial(object.idpIntent)
            : undefined;
        message.postForm = object.postForm ?? undefined;
        message.formData = (object.formData !== undefined && object.formData !== null)
            ? FormData.fromPartial(object.formData)
            : undefined;
        return message;
    },
};
function createBaseRetrieveIdentityProviderIntentRequest() {
    return { idpIntentId: "", idpIntentToken: "" };
}
export const RetrieveIdentityProviderIntentRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.idpIntentId !== "") {
            writer.uint32(10).string(message.idpIntentId);
        }
        if (message.idpIntentToken !== "") {
            writer.uint32(18).string(message.idpIntentToken);
        }
        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 = createBaseRetrieveIdentityProviderIntentRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.idpIntentId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.idpIntentToken = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            idpIntentId: isSet(object.idpIntentId) ? globalThis.String(object.idpIntentId) : "",
            idpIntentToken: isSet(object.idpIntentToken) ? globalThis.String(object.idpIntentToken) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.idpIntentId !== "") {
            obj.idpIntentId = message.idpIntentId;
        }
        if (message.idpIntentToken !== "") {
            obj.idpIntentToken = message.idpIntentToken;
        }
        return obj;
    },
    create(base) {
        return RetrieveIdentityProviderIntentRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRetrieveIdentityProviderIntentRequest();
        message.idpIntentId = object.idpIntentId ?? "";
        message.idpIntentToken = object.idpIntentToken ?? "";
        return message;
    },
};
function createBaseRetrieveIdentityProviderIntentResponse() {
    return { details: undefined, idpInformation: undefined, userId: "", addHumanUser: undefined };
}
export const RetrieveIdentityProviderIntentResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.idpInformation !== undefined) {
            IDPInformation.encode(message.idpInformation, writer.uint32(18).fork()).join();
        }
        if (message.userId !== "") {
            writer.uint32(26).string(message.userId);
        }
        if (message.addHumanUser !== undefined) {
            AddHumanUserRequest.encode(message.addHumanUser, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseRetrieveIdentityProviderIntentResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.idpInformation = IDPInformation.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.userId = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.addHumanUser = AddHumanUserRequest.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            idpInformation: isSet(object.idpInformation) ? IDPInformation.fromJSON(object.idpInformation) : undefined,
            userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
            addHumanUser: isSet(object.addHumanUser) ? AddHumanUserRequest.fromJSON(object.addHumanUser) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.idpInformation !== undefined) {
            obj.idpInformation = IDPInformation.toJSON(message.idpInformation);
        }
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.addHumanUser !== undefined) {
            obj.addHumanUser = AddHumanUserRequest.toJSON(message.addHumanUser);
        }
        return obj;
    },
    create(base) {
        return RetrieveIdentityProviderIntentResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRetrieveIdentityProviderIntentResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.idpInformation = (object.idpInformation !== undefined && object.idpInformation !== null)
            ? IDPInformation.fromPartial(object.idpInformation)
            : undefined;
        message.userId = object.userId ?? "";
        message.addHumanUser = (object.addHumanUser !== undefined && object.addHumanUser !== null)
            ? AddHumanUserRequest.fromPartial(object.addHumanUser)
            : undefined;
        return message;
    },
};
function createBaseAddIDPLinkRequest() {
    return { userId: "", idpLink: undefined };
}
export const AddIDPLinkRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.idpLink !== undefined) {
            IDPLink.encode(message.idpLink, 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 = createBaseAddIDPLinkRequest();
        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.idpLink = IDPLink.decode(reader, reader.uint32());
                    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) : "",
            idpLink: isSet(object.idpLink) ? IDPLink.fromJSON(object.idpLink) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.idpLink !== undefined) {
            obj.idpLink = IDPLink.toJSON(message.idpLink);
        }
        return obj;
    },
    create(base) {
        return AddIDPLinkRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddIDPLinkRequest();
        message.userId = object.userId ?? "";
        message.idpLink = (object.idpLink !== undefined && object.idpLink !== null)
            ? IDPLink.fromPartial(object.idpLink)
            : undefined;
        return message;
    },
};
function createBaseAddIDPLinkResponse() {
    return { details: undefined };
}
export const AddIDPLinkResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseAddIDPLinkResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return AddIDPLinkResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddIDPLinkResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseListIDPLinksRequest() {
    return { userId: "", query: undefined };
}
export const ListIDPLinksRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.query !== undefined) {
            ListQuery.encode(message.query, 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 = createBaseListIDPLinksRequest();
        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.query = ListQuery.decode(reader, reader.uint32());
                    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) : "",
            query: isSet(object.query) ? ListQuery.fromJSON(object.query) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.query !== undefined) {
            obj.query = ListQuery.toJSON(message.query);
        }
        return obj;
    },
    create(base) {
        return ListIDPLinksRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListIDPLinksRequest();
        message.userId = object.userId ?? "";
        message.query = (object.query !== undefined && object.query !== null)
            ? ListQuery.fromPartial(object.query)
            : undefined;
        return message;
    },
};
function createBaseListIDPLinksResponse() {
    return { details: undefined, result: [] };
}
export const ListIDPLinksResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            ListDetails.encode(message.details, writer.uint32(10).fork()).join();
        }
        for (const v of message.result) {
            IDPLink.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 = createBaseListIDPLinksResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = ListDetails.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.result.push(IDPLink.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? ListDetails.fromJSON(object.details) : undefined,
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => IDPLink.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = ListDetails.toJSON(message.details);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => IDPLink.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListIDPLinksResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListIDPLinksResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? ListDetails.fromPartial(object.details)
            : undefined;
        message.result = object.result?.map((e) => IDPLink.fromPartial(e)) || [];
        return message;
    },
};
function createBaseRemoveIDPLinkRequest() {
    return { userId: "", idpId: "", linkedUserId: "" };
}
export const RemoveIDPLinkRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.idpId !== "") {
            writer.uint32(18).string(message.idpId);
        }
        if (message.linkedUserId !== "") {
            writer.uint32(26).string(message.linkedUserId);
        }
        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 = createBaseRemoveIDPLinkRequest();
        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.idpId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.linkedUserId = 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) : "",
            idpId: isSet(object.idpId) ? globalThis.String(object.idpId) : "",
            linkedUserId: isSet(object.linkedUserId) ? globalThis.String(object.linkedUserId) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.idpId !== "") {
            obj.idpId = message.idpId;
        }
        if (message.linkedUserId !== "") {
            obj.linkedUserId = message.linkedUserId;
        }
        return obj;
    },
    create(base) {
        return RemoveIDPLinkRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveIDPLinkRequest();
        message.userId = object.userId ?? "";
        message.idpId = object.idpId ?? "";
        message.linkedUserId = object.linkedUserId ?? "";
        return message;
    },
};
function createBaseRemoveIDPLinkResponse() {
    return { details: undefined };
}
export const RemoveIDPLinkResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseRemoveIDPLinkResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return RemoveIDPLinkResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveIDPLinkResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBasePasswordResetRequest() {
    return { userId: "", sendLink: undefined, returnCode: undefined };
}
export const PasswordResetRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendLink !== undefined) {
            SendPasswordResetLink.encode(message.sendLink, writer.uint32(18).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnPasswordResetCode.encode(message.returnCode, 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 = createBasePasswordResetRequest();
        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.sendLink = SendPasswordResetLink.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.returnCode = ReturnPasswordResetCode.decode(reader, reader.uint32());
                    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) : "",
            sendLink: isSet(object.sendLink) ? SendPasswordResetLink.fromJSON(object.sendLink) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnPasswordResetCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendLink !== undefined) {
            obj.sendLink = SendPasswordResetLink.toJSON(message.sendLink);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnPasswordResetCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return PasswordResetRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePasswordResetRequest();
        message.userId = object.userId ?? "";
        message.sendLink = (object.sendLink !== undefined && object.sendLink !== null)
            ? SendPasswordResetLink.fromPartial(object.sendLink)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnPasswordResetCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBasePasswordResetResponse() {
    return { details: undefined, verificationCode: undefined };
}
export const PasswordResetResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBasePasswordResetResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.verificationCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return PasswordResetResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePasswordResetResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseSetPasswordRequest() {
    return { userId: "", newPassword: undefined, currentPassword: undefined, verificationCode: undefined };
}
export const SetPasswordRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.newPassword !== undefined) {
            Password.encode(message.newPassword, writer.uint32(18).fork()).join();
        }
        if (message.currentPassword !== undefined) {
            writer.uint32(26).string(message.currentPassword);
        }
        if (message.verificationCode !== undefined) {
            writer.uint32(34).string(message.verificationCode);
        }
        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 = createBaseSetPasswordRequest();
        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.newPassword = Password.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.currentPassword = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.verificationCode = 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) : "",
            newPassword: isSet(object.newPassword) ? Password.fromJSON(object.newPassword) : undefined,
            currentPassword: isSet(object.currentPassword) ? globalThis.String(object.currentPassword) : undefined,
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.newPassword !== undefined) {
            obj.newPassword = Password.toJSON(message.newPassword);
        }
        if (message.currentPassword !== undefined) {
            obj.currentPassword = message.currentPassword;
        }
        if (message.verificationCode !== undefined) {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return SetPasswordRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetPasswordRequest();
        message.userId = object.userId ?? "";
        message.newPassword = (object.newPassword !== undefined && object.newPassword !== null)
            ? Password.fromPartial(object.newPassword)
            : undefined;
        message.currentPassword = object.currentPassword ?? undefined;
        message.verificationCode = object.verificationCode ?? undefined;
        return message;
    },
};
function createBaseSetPasswordResponse() {
    return { details: undefined };
}
export const SetPasswordResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseSetPasswordResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return SetPasswordResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetPasswordResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseListAuthenticationMethodTypesRequest() {
    return { userId: "", domainQuery: undefined };
}
export const ListAuthenticationMethodTypesRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.domainQuery !== undefined) {
            DomainQuery.encode(message.domainQuery, 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 = createBaseListAuthenticationMethodTypesRequest();
        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.domainQuery = DomainQuery.decode(reader, reader.uint32());
                    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) : "",
            domainQuery: isSet(object.domainQuery) ? DomainQuery.fromJSON(object.domainQuery) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.domainQuery !== undefined) {
            obj.domainQuery = DomainQuery.toJSON(message.domainQuery);
        }
        return obj;
    },
    create(base) {
        return ListAuthenticationMethodTypesRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListAuthenticationMethodTypesRequest();
        message.userId = object.userId ?? "";
        message.domainQuery = (object.domainQuery !== undefined && object.domainQuery !== null)
            ? DomainQuery.fromPartial(object.domainQuery)
            : undefined;
        return message;
    },
};
function createBaseDomainQuery() {
    return { includeWithoutDomain: false, domain: "" };
}
export const DomainQuery = {
    encode(message, writer = new BinaryWriter()) {
        if (message.includeWithoutDomain !== false) {
            writer.uint32(8).bool(message.includeWithoutDomain);
        }
        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 = createBaseDomainQuery();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.includeWithoutDomain = reader.bool();
                    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 {
            includeWithoutDomain: isSet(object.includeWithoutDomain)
                ? globalThis.Boolean(object.includeWithoutDomain)
                : false,
            domain: isSet(object.domain) ? globalThis.String(object.domain) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.includeWithoutDomain !== false) {
            obj.includeWithoutDomain = message.includeWithoutDomain;
        }
        if (message.domain !== "") {
            obj.domain = message.domain;
        }
        return obj;
    },
    create(base) {
        return DomainQuery.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDomainQuery();
        message.includeWithoutDomain = object.includeWithoutDomain ?? false;
        message.domain = object.domain ?? "";
        return message;
    },
};
function createBaseListAuthenticationMethodTypesResponse() {
    return { details: undefined, authMethodTypes: [] };
}
export const ListAuthenticationMethodTypesResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            ListDetails.encode(message.details, writer.uint32(10).fork()).join();
        }
        writer.uint32(18).fork();
        for (const v of message.authMethodTypes) {
            writer.int32(v);
        }
        writer.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 = createBaseListAuthenticationMethodTypesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = ListDetails.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag === 16) {
                        message.authMethodTypes.push(reader.int32());
                        continue;
                    }
                    if (tag === 18) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.authMethodTypes.push(reader.int32());
                        }
                        continue;
                    }
                    break;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? ListDetails.fromJSON(object.details) : undefined,
            authMethodTypes: globalThis.Array.isArray(object?.authMethodTypes)
                ? object.authMethodTypes.map((e) => authenticationMethodTypeFromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = ListDetails.toJSON(message.details);
        }
        if (message.authMethodTypes?.length) {
            obj.authMethodTypes = message.authMethodTypes.map((e) => authenticationMethodTypeToJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListAuthenticationMethodTypesResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListAuthenticationMethodTypesResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? ListDetails.fromPartial(object.details)
            : undefined;
        message.authMethodTypes = object.authMethodTypes?.map((e) => e) || [];
        return message;
    },
};
function createBaseListAuthenticationFactorsRequest() {
    return { userId: "", authFactors: [], states: [] };
}
export const ListAuthenticationFactorsRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        writer.uint32(18).fork();
        for (const v of message.authFactors) {
            writer.int32(v);
        }
        writer.join();
        writer.uint32(26).fork();
        for (const v of message.states) {
            writer.int32(v);
        }
        writer.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 = createBaseListAuthenticationFactorsRequest();
        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 === 16) {
                        message.authFactors.push(reader.int32());
                        continue;
                    }
                    if (tag === 18) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.authFactors.push(reader.int32());
                        }
                        continue;
                    }
                    break;
                }
                case 3: {
                    if (tag === 24) {
                        message.states.push(reader.int32());
                        continue;
                    }
                    if (tag === 26) {
                        const end2 = reader.uint32() + reader.pos;
                        while (reader.pos < end2) {
                            message.states.push(reader.int32());
                        }
                        continue;
                    }
                    break;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
            authFactors: globalThis.Array.isArray(object?.authFactors)
                ? object.authFactors.map((e) => authFactorsFromJSON(e))
                : [],
            states: globalThis.Array.isArray(object?.states) ? object.states.map((e) => authFactorStateFromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.authFactors?.length) {
            obj.authFactors = message.authFactors.map((e) => authFactorsToJSON(e));
        }
        if (message.states?.length) {
            obj.states = message.states.map((e) => authFactorStateToJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListAuthenticationFactorsRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListAuthenticationFactorsRequest();
        message.userId = object.userId ?? "";
        message.authFactors = object.authFactors?.map((e) => e) || [];
        message.states = object.states?.map((e) => e) || [];
        return message;
    },
};
function createBaseListAuthenticationFactorsResponse() {
    return { result: [] };
}
export const ListAuthenticationFactorsResponse = {
    encode(message, writer = new BinaryWriter()) {
        for (const v of message.result) {
            AuthFactor.encode(v, 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 = createBaseListAuthenticationFactorsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.result.push(AuthFactor.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => AuthFactor.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.result?.length) {
            obj.result = message.result.map((e) => AuthFactor.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListAuthenticationFactorsResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListAuthenticationFactorsResponse();
        message.result = object.result?.map((e) => AuthFactor.fromPartial(e)) || [];
        return message;
    },
};
function createBaseCreateInviteCodeRequest() {
    return { userId: "", sendCode: undefined, returnCode: undefined };
}
export const CreateInviteCodeRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.sendCode !== undefined) {
            SendInviteCode.encode(message.sendCode, writer.uint32(18).fork()).join();
        }
        if (message.returnCode !== undefined) {
            ReturnInviteCode.encode(message.returnCode, 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 = createBaseCreateInviteCodeRequest();
        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.sendCode = SendInviteCode.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.returnCode = ReturnInviteCode.decode(reader, reader.uint32());
                    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) : "",
            sendCode: isSet(object.sendCode) ? SendInviteCode.fromJSON(object.sendCode) : undefined,
            returnCode: isSet(object.returnCode) ? ReturnInviteCode.fromJSON(object.returnCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.sendCode !== undefined) {
            obj.sendCode = SendInviteCode.toJSON(message.sendCode);
        }
        if (message.returnCode !== undefined) {
            obj.returnCode = ReturnInviteCode.toJSON(message.returnCode);
        }
        return obj;
    },
    create(base) {
        return CreateInviteCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateInviteCodeRequest();
        message.userId = object.userId ?? "";
        message.sendCode = (object.sendCode !== undefined && object.sendCode !== null)
            ? SendInviteCode.fromPartial(object.sendCode)
            : undefined;
        message.returnCode = (object.returnCode !== undefined && object.returnCode !== null)
            ? ReturnInviteCode.fromPartial(object.returnCode)
            : undefined;
        return message;
    },
};
function createBaseCreateInviteCodeResponse() {
    return { details: undefined, inviteCode: undefined };
}
export const CreateInviteCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, writer.uint32(10).fork()).join();
        }
        if (message.inviteCode !== undefined) {
            writer.uint32(18).string(message.inviteCode);
        }
        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 = createBaseCreateInviteCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.inviteCode = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            details: isSet(object.details) ? Details.fromJSON(object.details) : undefined,
            inviteCode: isSet(object.inviteCode) ? globalThis.String(object.inviteCode) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        if (message.inviteCode !== undefined) {
            obj.inviteCode = message.inviteCode;
        }
        return obj;
    },
    create(base) {
        return CreateInviteCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateInviteCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        message.inviteCode = object.inviteCode ?? undefined;
        return message;
    },
};
function createBaseResendInviteCodeRequest() {
    return { userId: "" };
}
export const ResendInviteCodeRequest = {
    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 = createBaseResendInviteCodeRequest();
        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 ResendInviteCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendInviteCodeRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseResendInviteCodeResponse() {
    return { details: undefined };
}
export const ResendInviteCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseResendInviteCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return ResendInviteCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResendInviteCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseVerifyInviteCodeRequest() {
    return { userId: "", verificationCode: "" };
}
export const VerifyInviteCodeRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.verificationCode !== "") {
            writer.uint32(18).string(message.verificationCode);
        }
        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 = createBaseVerifyInviteCodeRequest();
        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.verificationCode = 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) : "",
            verificationCode: isSet(object.verificationCode) ? globalThis.String(object.verificationCode) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.verificationCode !== "") {
            obj.verificationCode = message.verificationCode;
        }
        return obj;
    },
    create(base) {
        return VerifyInviteCodeRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyInviteCodeRequest();
        message.userId = object.userId ?? "";
        message.verificationCode = object.verificationCode ?? "";
        return message;
    },
};
function createBaseVerifyInviteCodeResponse() {
    return { details: undefined };
}
export const VerifyInviteCodeResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseVerifyInviteCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return VerifyInviteCodeResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVerifyInviteCodeResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseHumanMFAInitSkippedRequest() {
    return { userId: "" };
}
export const HumanMFAInitSkippedRequest = {
    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 = createBaseHumanMFAInitSkippedRequest();
        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 HumanMFAInitSkippedRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseHumanMFAInitSkippedRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseHumanMFAInitSkippedResponse() {
    return { details: undefined };
}
export const HumanMFAInitSkippedResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseHumanMFAInitSkippedResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.details = Details.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = Details.toJSON(message.details);
        }
        return obj;
    },
    create(base) {
        return HumanMFAInitSkippedResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseHumanMFAInitSkippedResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseAddSecretRequest() {
    return { userId: "" };
}
export const AddSecretRequest = {
    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 = createBaseAddSecretRequest();
        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 AddSecretRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddSecretRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseAddSecretResponse() {
    return { creationDate: undefined, clientSecret: "" };
}
export const AddSecretResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        if (message.clientSecret !== "") {
            writer.uint32(18).string(message.clientSecret);
        }
        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 = createBaseAddSecretResponse();
        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.clientSecret = reader.string();
                    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,
            clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        if (message.clientSecret !== "") {
            obj.clientSecret = message.clientSecret;
        }
        return obj;
    },
    create(base) {
        return AddSecretResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddSecretResponse();
        message.creationDate = object.creationDate ?? undefined;
        message.clientSecret = object.clientSecret ?? "";
        return message;
    },
};
function createBaseRemoveSecretRequest() {
    return { userId: "" };
}
export const RemoveSecretRequest = {
    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 = createBaseRemoveSecretRequest();
        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 RemoveSecretRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveSecretRequest();
        message.userId = object.userId ?? "";
        return message;
    },
};
function createBaseRemoveSecretResponse() {
    return { deletionDate: undefined };
}
export const RemoveSecretResponse = {
    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 = createBaseRemoveSecretResponse();
        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 RemoveSecretResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveSecretResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseAddKeyRequest() {
    return { userId: "", expirationDate: undefined, publicKey: Buffer.alloc(0) };
}
export const AddKeyRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.expirationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.expirationDate), writer.uint32(18).fork()).join();
        }
        if (message.publicKey.length !== 0) {
            writer.uint32(26).bytes(message.publicKey);
        }
        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 = createBaseAddKeyRequest();
        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.expirationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.publicKey = Buffer.from(reader.bytes());
                    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) : "",
            expirationDate: isSet(object.expirationDate) ? fromJsonTimestamp(object.expirationDate) : undefined,
            publicKey: isSet(object.publicKey) ? Buffer.from(bytesFromBase64(object.publicKey)) : Buffer.alloc(0),
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.expirationDate !== undefined) {
            obj.expirationDate = message.expirationDate.toISOString();
        }
        if (message.publicKey.length !== 0) {
            obj.publicKey = base64FromBytes(message.publicKey);
        }
        return obj;
    },
    create(base) {
        return AddKeyRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddKeyRequest();
        message.userId = object.userId ?? "";
        message.expirationDate = object.expirationDate ?? undefined;
        message.publicKey = object.publicKey ?? Buffer.alloc(0);
        return message;
    },
};
function createBaseAddKeyResponse() {
    return { creationDate: undefined, keyId: "", keyContent: Buffer.alloc(0) };
}
export const AddKeyResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        if (message.keyId !== "") {
            writer.uint32(18).string(message.keyId);
        }
        if (message.keyContent.length !== 0) {
            writer.uint32(26).bytes(message.keyContent);
        }
        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 = createBaseAddKeyResponse();
        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.keyId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.keyContent = Buffer.from(reader.bytes());
                    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,
            keyId: isSet(object.keyId) ? globalThis.String(object.keyId) : "",
            keyContent: isSet(object.keyContent) ? Buffer.from(bytesFromBase64(object.keyContent)) : Buffer.alloc(0),
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        if (message.keyId !== "") {
            obj.keyId = message.keyId;
        }
        if (message.keyContent.length !== 0) {
            obj.keyContent = base64FromBytes(message.keyContent);
        }
        return obj;
    },
    create(base) {
        return AddKeyResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddKeyResponse();
        message.creationDate = object.creationDate ?? undefined;
        message.keyId = object.keyId ?? "";
        message.keyContent = object.keyContent ?? Buffer.alloc(0);
        return message;
    },
};
function createBaseRemoveKeyRequest() {
    return { userId: "", keyId: "" };
}
export const RemoveKeyRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.keyId !== "") {
            writer.uint32(18).string(message.keyId);
        }
        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 = createBaseRemoveKeyRequest();
        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.keyId = 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) : "",
            keyId: isSet(object.keyId) ? globalThis.String(object.keyId) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.keyId !== "") {
            obj.keyId = message.keyId;
        }
        return obj;
    },
    create(base) {
        return RemoveKeyRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveKeyRequest();
        message.userId = object.userId ?? "";
        message.keyId = object.keyId ?? "";
        return message;
    },
};
function createBaseRemoveKeyResponse() {
    return { deletionDate: undefined };
}
export const RemoveKeyResponse = {
    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 = createBaseRemoveKeyResponse();
        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 RemoveKeyResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemoveKeyResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseListKeysRequest() {
    return { pagination: undefined, sortingColumn: undefined, filters: [] };
}
export const ListKeysRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        if (message.sortingColumn !== undefined) {
            writer.uint32(16).int32(message.sortingColumn);
        }
        for (const v of message.filters) {
            KeysSearchFilter.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 = createBaseListKeysRequest();
        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.filters.push(KeysSearchFilter.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) ? keyFieldNameFromJSON(object.sortingColumn) : undefined,
            filters: globalThis.Array.isArray(object?.filters)
                ? object.filters.map((e) => KeysSearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== undefined) {
            obj.sortingColumn = keyFieldNameToJSON(message.sortingColumn);
        }
        if (message.filters?.length) {
            obj.filters = message.filters.map((e) => KeysSearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListKeysRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListKeysRequest();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? undefined;
        message.filters = object.filters?.map((e) => KeysSearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListKeysResponse() {
    return { pagination: undefined, result: [] };
}
export const ListKeysResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        for (const v of message.result) {
            Key.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 = createBaseListKeysResponse();
        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.result.push(Key.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,
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => Key.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => Key.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListKeysResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListKeysResponse();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        message.result = object.result?.map((e) => Key.fromPartial(e)) || [];
        return message;
    },
};
function createBaseAddPersonalAccessTokenRequest() {
    return { userId: "", expirationDate: undefined };
}
export const AddPersonalAccessTokenRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.expirationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.expirationDate), 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 = createBaseAddPersonalAccessTokenRequest();
        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.expirationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
                    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) : "",
            expirationDate: isSet(object.expirationDate) ? fromJsonTimestamp(object.expirationDate) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.expirationDate !== undefined) {
            obj.expirationDate = message.expirationDate.toISOString();
        }
        return obj;
    },
    create(base) {
        return AddPersonalAccessTokenRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddPersonalAccessTokenRequest();
        message.userId = object.userId ?? "";
        message.expirationDate = object.expirationDate ?? undefined;
        return message;
    },
};
function createBaseAddPersonalAccessTokenResponse() {
    return { creationDate: undefined, tokenId: "", token: "" };
}
export const AddPersonalAccessTokenResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.creationDate !== undefined) {
            Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
        }
        if (message.tokenId !== "") {
            writer.uint32(18).string(message.tokenId);
        }
        if (message.token !== "") {
            writer.uint32(26).string(message.token);
        }
        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 = createBaseAddPersonalAccessTokenResponse();
        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.tokenId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.token = reader.string();
                    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,
            tokenId: isSet(object.tokenId) ? globalThis.String(object.tokenId) : "",
            token: isSet(object.token) ? globalThis.String(object.token) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.creationDate !== undefined) {
            obj.creationDate = message.creationDate.toISOString();
        }
        if (message.tokenId !== "") {
            obj.tokenId = message.tokenId;
        }
        if (message.token !== "") {
            obj.token = message.token;
        }
        return obj;
    },
    create(base) {
        return AddPersonalAccessTokenResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddPersonalAccessTokenResponse();
        message.creationDate = object.creationDate ?? undefined;
        message.tokenId = object.tokenId ?? "";
        message.token = object.token ?? "";
        return message;
    },
};
function createBaseRemovePersonalAccessTokenRequest() {
    return { userId: "", tokenId: "" };
}
export const RemovePersonalAccessTokenRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.tokenId !== "") {
            writer.uint32(18).string(message.tokenId);
        }
        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 = createBaseRemovePersonalAccessTokenRequest();
        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.tokenId = 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) : "",
            tokenId: isSet(object.tokenId) ? globalThis.String(object.tokenId) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.tokenId !== "") {
            obj.tokenId = message.tokenId;
        }
        return obj;
    },
    create(base) {
        return RemovePersonalAccessTokenRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePersonalAccessTokenRequest();
        message.userId = object.userId ?? "";
        message.tokenId = object.tokenId ?? "";
        return message;
    },
};
function createBaseRemovePersonalAccessTokenResponse() {
    return { deletionDate: undefined };
}
export const RemovePersonalAccessTokenResponse = {
    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 = createBaseRemovePersonalAccessTokenResponse();
        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 RemovePersonalAccessTokenResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseRemovePersonalAccessTokenResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
function createBaseListPersonalAccessTokensRequest() {
    return { pagination: undefined, sortingColumn: undefined, filters: [] };
}
export const ListPersonalAccessTokensRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        if (message.sortingColumn !== undefined) {
            writer.uint32(16).int32(message.sortingColumn);
        }
        for (const v of message.filters) {
            PersonalAccessTokensSearchFilter.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 = createBaseListPersonalAccessTokensRequest();
        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.filters.push(PersonalAccessTokensSearchFilter.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)
                ? personalAccessTokenFieldNameFromJSON(object.sortingColumn)
                : undefined,
            filters: globalThis.Array.isArray(object?.filters)
                ? object.filters.map((e) => PersonalAccessTokensSearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.sortingColumn !== undefined) {
            obj.sortingColumn = personalAccessTokenFieldNameToJSON(message.sortingColumn);
        }
        if (message.filters?.length) {
            obj.filters = message.filters.map((e) => PersonalAccessTokensSearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListPersonalAccessTokensRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListPersonalAccessTokensRequest();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? undefined;
        message.filters = object.filters?.map((e) => PersonalAccessTokensSearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListPersonalAccessTokensResponse() {
    return { pagination: undefined, result: [] };
}
export const ListPersonalAccessTokensResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.pagination !== undefined) {
            PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        for (const v of message.result) {
            PersonalAccessToken.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 = createBaseListPersonalAccessTokensResponse();
        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.result.push(PersonalAccessToken.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,
            result: globalThis.Array.isArray(object?.result)
                ? object.result.map((e) => PersonalAccessToken.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = PaginationResponse.toJSON(message.pagination);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => PersonalAccessToken.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListPersonalAccessTokensResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListPersonalAccessTokensResponse();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationResponse.fromPartial(object.pagination)
            : undefined;
        message.result = object.result?.map((e) => PersonalAccessToken.fromPartial(e)) || [];
        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 createBaseSetUserMetadataRequest() {
    return { userId: "", metadata: [] };
}
export const SetUserMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        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 = createBaseSetUserMetadataRequest();
        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.metadata.push(Metadata.decode(reader, reader.uint32()));
                    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) : "",
            metadata: globalThis.Array.isArray(object?.metadata) ? object.metadata.map((e) => Metadata.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.metadata?.length) {
            obj.metadata = message.metadata.map((e) => Metadata.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return SetUserMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetUserMetadataRequest();
        message.userId = object.userId ?? "";
        message.metadata = object.metadata?.map((e) => Metadata.fromPartial(e)) || [];
        return message;
    },
};
function createBaseSetUserMetadataResponse() {
    return { setDate: undefined };
}
export const SetUserMetadataResponse = {
    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 = createBaseSetUserMetadataResponse();
        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 SetUserMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSetUserMetadataResponse();
        message.setDate = object.setDate ?? undefined;
        return message;
    },
};
function createBaseListUserMetadataRequest() {
    return { userId: "", pagination: undefined, filters: [] };
}
export const ListUserMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        if (message.pagination !== undefined) {
            PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        for (const v of message.filters) {
            MetadataSearchFilter.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 = createBaseListUserMetadataRequest();
        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.pagination = PaginationRequest.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.filters.push(MetadataSearchFilter.decode(reader, reader.uint32()));
                    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) : "",
            pagination: isSet(object.pagination) ? PaginationRequest.fromJSON(object.pagination) : undefined,
            filters: globalThis.Array.isArray(object?.filters)
                ? object.filters.map((e) => MetadataSearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.pagination !== undefined) {
            obj.pagination = PaginationRequest.toJSON(message.pagination);
        }
        if (message.filters?.length) {
            obj.filters = message.filters.map((e) => MetadataSearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return ListUserMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListUserMetadataRequest();
        message.userId = object.userId ?? "";
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? PaginationRequest.fromPartial(object.pagination)
            : undefined;
        message.filters = object.filters?.map((e) => MetadataSearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseListUserMetadataResponse() {
    return { pagination: undefined, metadata: [] };
}
export const ListUserMetadataResponse = {
    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 = createBaseListUserMetadataResponse();
        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 ListUserMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseListUserMetadataResponse();
        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 createBaseDeleteUserMetadataRequest() {
    return { userId: "", keys: [] };
}
export const DeleteUserMetadataRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userId !== "") {
            writer.uint32(10).string(message.userId);
        }
        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 = createBaseDeleteUserMetadataRequest();
        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.keys.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) : "",
            keys: globalThis.Array.isArray(object?.keys) ? object.keys.map((e) => globalThis.String(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.userId !== "") {
            obj.userId = message.userId;
        }
        if (message.keys?.length) {
            obj.keys = message.keys;
        }
        return obj;
    },
    create(base) {
        return DeleteUserMetadataRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserMetadataRequest();
        message.userId = object.userId ?? "";
        message.keys = object.keys?.map((e) => e) || [];
        return message;
    },
};
function createBaseDeleteUserMetadataResponse() {
    return { deletionDate: undefined };
}
export const DeleteUserMetadataResponse = {
    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 = createBaseDeleteUserMetadataResponse();
        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 DeleteUserMetadataResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserMetadataResponse();
        message.deletionDate = object.deletionDate ?? undefined;
        return message;
    },
};
export const UserServiceDefinition = {
    name: "UserService",
    fullName: "zitadel.user.v2.UserService",
    methods: {
        /**
         * Create a User
         *
         * Create a new human or machine user in the specified organization.
         *
         * Required permission:
         *   - user.write
         */
        createUser: {
            name: "CreateUser",
            requestType: CreateUserRequest,
            requestStream: false,
            responseType: CreateUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            77,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            62,
                            10,
                            3,
                            52,
                            48,
                            57,
                            18,
                            55,
                            10,
                            24,
                            84,
                            104,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            97,
                            108,
                            114,
                            101,
                            97,
                            100,
                            121,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            115,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Create a new human user
         *
         * Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned.
         */
        addHumanUser: {
            name: "AddHumanUser",
            requestType: AddHumanUserRequest,
            requestStream: false,
            responseType: AddHumanUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [
                        Buffer.from([
                            33,
                            10,
                            26,
                            10,
                            10,
                            117,
                            115,
                            101,
                            114,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                            26,
                            12,
                            111,
                            114,
                            103,
                            97,
                            110,
                            105,
                            122,
                            97,
                            116,
                            105,
                            111,
                            110,
                            18,
                            3,
                            8,
                            200,
                            1,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([20, 58, 1, 42, 34, 15, 47, 118, 50, 47, 117, 115, 101, 114, 115, 47, 104, 117, 109, 97, 110]),
                    ],
                },
            },
        },
        /**
         * User by ID
         *
         * Returns the full user object (human or machine) including the profile, email, etc..
         */
        getUserByID: {
            name: "GetUserByID",
            requestType: GetUserByIDRequest,
            requestStream: false,
            responseType: GetUserByIDResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            22,
                            10,
                            15,
                            10,
                            13,
                            97,
                            117,
                            116,
                            104,
                            101,
                            110,
                            116,
                            105,
                            99,
                            97,
                            116,
                            101,
                            100,
                            18,
                            3,
                            8,
                            200,
                            1,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            21,
                            18,
                            19,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Search Users
         *
         * Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination.
         */
        listUsers: {
            name: "ListUsers",
            requestType: ListUsersRequest,
            requestStream: false,
            responseType: ListUsersResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            107,
                            74,
                            47,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            40,
                            10,
                            38,
                            65,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            97,
                            108,
                            108,
                            32,
                            117,
                            115,
                            101,
                            114,
                            115,
                            32,
                            109,
                            97,
                            116,
                            99,
                            104,
                            105,
                            110,
                            103,
                            32,
                            116,
                            104,
                            101,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                            74,
                            56,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            49,
                            10,
                            18,
                            105,
                            110,
                            118,
                            97,
                            108,
                            105,
                            100,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [Buffer.from([14, 58, 1, 42, 34, 9, 47, 118, 50, 47, 117, 115, 101, 114, 115])],
                },
            },
        },
        /**
         * Change the user email
         *
         * Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email..
         */
        setEmail: {
            name: "SetEmail",
            requestType: SetEmailRequest,
            requestStream: false,
            responseType: SetEmailResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            58,
                            1,
                            42,
                            34,
                            25,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            101,
                            109,
                            97,
                            105,
                            108,
                        ]),
                    ],
                },
            },
        },
        /** Resend code to verify user email */
        resendEmailCode: {
            name: "ResendEmailCode",
            requestType: ResendEmailCodeRequest,
            requestStream: false,
            responseType: ResendEmailCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            37,
                            58,
                            1,
                            42,
                            34,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            101,
                            109,
                            97,
                            105,
                            108,
                            47,
                            114,
                            101,
                            115,
                            101,
                            110,
                            100,
                        ]),
                    ],
                },
            },
        },
        /** Send code to verify user email */
        sendEmailCode: {
            name: "SendEmailCode",
            requestType: SendEmailCodeRequest,
            requestStream: false,
            responseType: SendEmailCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            35,
                            58,
                            1,
                            42,
                            34,
                            30,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            101,
                            109,
                            97,
                            105,
                            108,
                            47,
                            115,
                            101,
                            110,
                            100,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify the email
         *
         * Verify the email with the generated code.
         */
        verifyEmail: {
            name: "VerifyEmail",
            requestType: VerifyEmailRequest,
            requestStream: false,
            responseType: VerifyEmailResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            37,
                            58,
                            1,
                            42,
                            34,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            101,
                            109,
                            97,
                            105,
                            108,
                            47,
                            118,
                            101,
                            114,
                            105,
                            102,
                            121,
                        ]),
                    ],
                },
            },
        },
        /**
         * Set the user phone
         *
         * Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms..
         */
        setPhone: {
            name: "SetPhone",
            requestType: SetPhoneRequest,
            requestStream: false,
            responseType: SetPhoneResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            58,
                            1,
                            42,
                            34,
                            25,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            104,
                            111,
                            110,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete the user phone
         *
         * Delete the phone number of a user.
         */
        removePhone: {
            name: "RemovePhone",
            requestType: RemovePhoneRequest,
            requestStream: false,
            responseType: RemovePhoneResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            58,
                            1,
                            42,
                            42,
                            25,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            104,
                            111,
                            110,
                            101,
                        ]),
                    ],
                },
            },
        },
        /** Resend code to verify user phone */
        resendPhoneCode: {
            name: "ResendPhoneCode",
            requestType: ResendPhoneCodeRequest,
            requestStream: false,
            responseType: ResendPhoneCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            37,
                            58,
                            1,
                            42,
                            34,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            104,
                            111,
                            110,
                            101,
                            47,
                            114,
                            101,
                            115,
                            101,
                            110,
                            100,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify the phone
         *
         * Verify the phone with the generated code..
         */
        verifyPhone: {
            name: "VerifyPhone",
            requestType: VerifyPhoneRequest,
            requestStream: false,
            responseType: VerifyPhoneResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            37,
                            58,
                            1,
                            42,
                            34,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            104,
                            111,
                            110,
                            101,
                            47,
                            118,
                            101,
                            114,
                            105,
                            102,
                            121,
                        ]),
                    ],
                },
            },
        },
        /**
         * Update a User
         *
         * Partially update an existing user.
         * If you change the users email or phone, you can specify how the ownership should be verified.
         * If you change the users password, you can specify if the password should be changed again on the users next login.
         *
         * Required permission:
         *   - user.write
         */
        updateUser: {
            name: "UpdateUser",
            requestType: UpdateUserRequest,
            requestStream: false,
            responseType: UpdateUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            140,
                            1,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            61,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            54,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                            74,
                            62,
                            10,
                            3,
                            52,
                            48,
                            57,
                            18,
                            55,
                            10,
                            24,
                            84,
                            104,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            97,
                            108,
                            114,
                            101,
                            97,
                            100,
                            121,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            115,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Update Human User
         *
         * Update all information from a user..
         */
        updateHumanUser: {
            name: "UpdateHumanUser",
            requestType: UpdateHumanUserRequest,
            requestStream: false,
            responseType: UpdateHumanUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            58,
                            1,
                            42,
                            26,
                            25,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            104,
                            117,
                            109,
                            97,
                            110,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Deactivate user
         *
         * The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data..
         */
        deactivateUser: {
            name: "DeactivateUser",
            requestType: DeactivateUserRequest,
            requestStream: false,
            responseType: DeactivateUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            35,
                            58,
                            1,
                            42,
                            34,
                            30,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            100,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Reactivate user
         *
         * Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'..
         */
        reactivateUser: {
            name: "ReactivateUser",
            requestType: ReactivateUserRequest,
            requestStream: false,
            responseType: ReactivateUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            35,
                            58,
                            1,
                            42,
                            34,
                            30,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            114,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Lock user
         *
         * The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.)..
         */
        lockUser: {
            name: "LockUser",
            requestType: LockUserRequest,
            requestStream: false,
            responseType: LockUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            29,
                            58,
                            1,
                            42,
                            34,
                            24,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            108,
                            111,
                            99,
                            107,
                        ]),
                    ],
                },
            },
        },
        /**
         * Unlock user
         *
         * The state of the user will be changed to 'active'. The user will be able to log in again. The endpoint returns an error if the user is not in the state 'locked'.
         */
        unlockUser: {
            name: "UnlockUser",
            requestType: UnlockUserRequest,
            requestStream: false,
            responseType: UnlockUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            31,
                            58,
                            1,
                            42,
                            34,
                            26,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            117,
                            110,
                            108,
                            111,
                            99,
                            107,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete user
         *
         * The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found..
         */
        deleteUser: {
            name: "DeleteUser",
            requestType: DeleteUserRequest,
            requestStream: false,
            responseType: DeleteUserResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            21,
                            42,
                            19,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Start the registration of passkey for a user
         *
         * Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey..
         */
        registerPasskey: {
            name: "RegisterPasskey",
            requestType: RegisterPasskeyRequest,
            requestStream: false,
            responseType: RegisterPasskeyResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            33,
                            58,
                            1,
                            42,
                            34,
                            28,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify a passkey for a user
         *
         * Verify the passkey registration with the public key credential..
         */
        verifyPasskeyRegistration: {
            name: "VerifyPasskeyRegistration",
            requestType: VerifyPasskeyRegistrationRequest,
            requestStream: false,
            responseType: VerifyPasskeyRegistrationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            46,
                            58,
                            1,
                            42,
                            34,
                            41,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            115,
                            47,
                            123,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Create a passkey registration link for a user
         *
         * Create a passkey registration link which includes a code and either return it or send it to the user..
         */
        createPasskeyRegistrationLink: {
            name: "CreatePasskeyRegistrationLink",
            requestType: CreatePasskeyRegistrationLinkRequest,
            requestStream: false,
            responseType: CreatePasskeyRegistrationLinkResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            22,
                            10,
                            20,
                            10,
                            18,
                            117,
                            115,
                            101,
                            114,
                            46,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            51,
                            58,
                            1,
                            42,
                            34,
                            46,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            115,
                            47,
                            114,
                            101,
                            103,
                            105,
                            115,
                            116,
                            114,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            108,
                            105,
                            110,
                            107,
                        ]),
                    ],
                },
            },
        },
        /**
         * List passkeys of an user
         *
         * List passkeys of an user
         */
        listPasskeys: {
            name: "ListPasskeys",
            requestType: ListPasskeysRequest,
            requestStream: false,
            responseType: ListPasskeysResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            41,
                            58,
                            1,
                            42,
                            34,
                            36,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            115,
                            47,
                            95,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove passkey from a user
         *
         * Remove passkey from a user.
         */
        removePasskey: {
            name: "RemovePasskey",
            requestType: RemovePasskeyRequest,
            requestStream: false,
            responseType: RemovePasskeyResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            43,
                            42,
                            41,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            115,
                            47,
                            123,
                            112,
                            97,
                            115,
                            115,
                            107,
                            101,
                            121,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Start the registration of a u2f token for a user
         *
         * Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token..
         */
        registerU2F: {
            name: "RegisterU2F",
            requestType: RegisterU2FRequest,
            requestStream: false,
            responseType: RegisterU2FResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            28,
                            58,
                            1,
                            42,
                            34,
                            23,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            117,
                            50,
                            102,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify a u2f token for a user
         *
         * Verify the u2f token registration with the public key credential..
         */
        verifyU2FRegistration: {
            name: "VerifyU2FRegistration",
            requestType: VerifyU2FRegistrationRequest,
            requestStream: false,
            responseType: VerifyU2FRegistrationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            37,
                            58,
                            1,
                            42,
                            34,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            117,
                            50,
                            102,
                            47,
                            123,
                            117,
                            50,
                            102,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove u2f token from a user
         *
         * Remove u2f token from a user.
         */
        removeU2F: {
            name: "RemoveU2F",
            requestType: RemoveU2FRequest,
            requestStream: false,
            responseType: RemoveU2FResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            107,
                            18,
                            28,
                            82,
                            101,
                            109,
                            111,
                            118,
                            101,
                            32,
                            117,
                            50,
                            102,
                            32,
                            116,
                            111,
                            107,
                            101,
                            110,
                            32,
                            102,
                            114,
                            111,
                            109,
                            32,
                            97,
                            32,
                            117,
                            115,
                            101,
                            114,
                            26,
                            28,
                            82,
                            101,
                            109,
                            111,
                            118,
                            101,
                            32,
                            117,
                            50,
                            102,
                            32,
                            116,
                            111,
                            107,
                            101,
                            110,
                            32,
                            102,
                            114,
                            111,
                            109,
                            32,
                            97,
                            32,
                            117,
                            115,
                            101,
                            114,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            34,
                            42,
                            32,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            117,
                            50,
                            102,
                            47,
                            123,
                            117,
                            50,
                            102,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Start the registration of a TOTP generator for a user
         *
         * Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device..
         */
        registerTOTP: {
            name: "RegisterTOTP",
            requestType: RegisterTOTPRequest,
            requestStream: false,
            responseType: RegisterTOTPResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            29,
                            58,
                            1,
                            42,
                            34,
                            24,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            111,
                            116,
                            112,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify a TOTP generator for a user
         *
         * Verify the TOTP registration with a generated code..
         */
        verifyTOTPRegistration: {
            name: "VerifyTOTPRegistration",
            requestType: VerifyTOTPRegistrationRequest,
            requestStream: false,
            responseType: VerifyTOTPRegistrationResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            36,
                            58,
                            1,
                            42,
                            34,
                            31,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            111,
                            116,
                            112,
                            47,
                            118,
                            101,
                            114,
                            105,
                            102,
                            121,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove TOTP generator from a user
         *
         * Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward.
         */
        removeTOTP: {
            name: "RemoveTOTP",
            requestType: RemoveTOTPRequest,
            requestStream: false,
            responseType: RemoveTOTPResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            26,
                            42,
                            24,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            116,
                            111,
                            116,
                            112,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add OTP SMS for a user
         *
         * Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor..
         */
        addOTPSMS: {
            name: "AddOTPSMS",
            requestType: AddOTPSMSRequest,
            requestStream: false,
            responseType: AddOTPSMSResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            32,
                            58,
                            1,
                            42,
                            34,
                            27,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            111,
                            116,
                            112,
                            95,
                            115,
                            109,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove One-Time Password (OTP) SMS from a user
         *
         * Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward.
         */
        removeOTPSMS: {
            name: "RemoveOTPSMS",
            requestType: RemoveOTPSMSRequest,
            requestStream: false,
            responseType: RemoveOTPSMSResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            29,
                            42,
                            27,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            111,
                            116,
                            112,
                            95,
                            115,
                            109,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add OTP Email for a user
         *
         * Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor..
         */
        addOTPEmail: {
            name: "AddOTPEmail",
            requestType: AddOTPEmailRequest,
            requestStream: false,
            responseType: AddOTPEmailResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            34,
                            58,
                            1,
                            42,
                            34,
                            29,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            111,
                            116,
                            112,
                            95,
                            101,
                            109,
                            97,
                            105,
                            108,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove One-Time Password (OTP) Email from a user
         *
         * Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward.
         */
        removeOTPEmail: {
            name: "RemoveOTPEmail",
            requestType: RemoveOTPEmailRequest,
            requestStream: false,
            responseType: RemoveOTPEmailResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            31,
                            42,
                            29,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            111,
                            116,
                            112,
                            95,
                            101,
                            109,
                            97,
                            105,
                            108,
                        ]),
                    ],
                },
            },
        },
        /**
         * Start flow with an identity provider
         *
         * Start a flow with an identity provider, for external login, registration or linking..
         */
        startIdentityProviderIntent: {
            name: "StartIdentityProviderIntent",
            requestType: StartIdentityProviderIntentRequest,
            requestStream: false,
            responseType: StartIdentityProviderIntentResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([20, 58, 1, 42, 34, 15, 47, 118, 50, 47, 105, 100, 112, 95, 105, 110, 116, 101, 110, 116, 115]),
                    ],
                },
            },
        },
        /**
         * Retrieve the information returned by the identity provider
         *
         * Retrieve the information returned by the identity provider for registration or updating an existing user with new information..
         */
        retrieveIdentityProviderIntent: {
            name: "RetrieveIdentityProviderIntent",
            requestType: RetrieveIdentityProviderIntentRequest,
            requestStream: false,
            responseType: RetrieveIdentityProviderIntentResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            49,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            34,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            27,
                            10,
                            25,
                            73,
                            110,
                            116,
                            101,
                            110,
                            116,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            36,
                            58,
                            1,
                            42,
                            34,
                            31,
                            47,
                            118,
                            50,
                            47,
                            105,
                            100,
                            112,
                            95,
                            105,
                            110,
                            116,
                            101,
                            110,
                            116,
                            115,
                            47,
                            123,
                            105,
                            100,
                            112,
                            95,
                            105,
                            110,
                            116,
                            101,
                            110,
                            116,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add link to an identity provider to an user
         *
         * Add link to an identity provider to an user..
         */
        addIDPLink: {
            name: "AddIDPLink",
            requestType: AddIDPLinkRequest,
            requestStream: false,
            responseType: AddIDPLinkResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            58,
                            1,
                            42,
                            34,
                            25,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            108,
                            105,
                            110,
                            107,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * List links to an identity provider of an user
         *
         * List links to an identity provider of an user.
         */
        listIDPLinks: {
            name: "ListIDPLinks",
            requestType: ListIDPLinksRequest,
            requestStream: false,
            responseType: ListIDPLinksResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            38,
                            58,
                            1,
                            42,
                            34,
                            33,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            108,
                            105,
                            110,
                            107,
                            115,
                            47,
                            95,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Remove link of an identity provider to an user
         *
         * Remove link of an identity provider to an user.
         */
        removeIDPLink: {
            name: "RemoveIDPLink",
            requestType: RemoveIDPLinkRequest,
            requestStream: false,
            responseType: RemoveIDPLinkResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            56,
                            58,
                            1,
                            42,
                            42,
                            51,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            108,
                            105,
                            110,
                            107,
                            115,
                            47,
                            123,
                            105,
                            100,
                            112,
                            95,
                            105,
                            100,
                            125,
                            47,
                            123,
                            108,
                            105,
                            110,
                            107,
                            101,
                            100,
                            95,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Request a code to reset a password
         *
         * Request a code to reset a password..
         */
        passwordReset: {
            name: "PasswordReset",
            requestType: PasswordResetRequest,
            requestStream: false,
            responseType: PasswordResetResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            39,
                            58,
                            1,
                            42,
                            34,
                            34,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            119,
                            111,
                            114,
                            100,
                            95,
                            114,
                            101,
                            115,
                            101,
                            116,
                        ]),
                    ],
                },
            },
        },
        /**
         * Change password
         *
         * Change the password of a user with either a verification code or the current password..
         */
        setPassword: {
            name: "SetPassword",
            requestType: SetPasswordRequest,
            requestStream: false,
            responseType: SetPasswordResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            33,
                            58,
                            1,
                            42,
                            34,
                            28,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            112,
                            97,
                            115,
                            115,
                            119,
                            111,
                            114,
                            100,
                        ]),
                    ],
                },
            },
        },
        /**
         * Add a Users Secret
         *
         * Generates a client secret for the user.
         * The client id is the users username.
         * If the user already has a secret, it is overwritten.
         * Only users of type machine can have a secret.
         *
         * Required permission:
         *   - user.write
         */
        addSecret: {
            name: "AddSecret",
            requestType: AddSecretRequest,
            requestStream: false,
            responseType: AddSecretResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            116,
                            74,
                            47,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            40,
                            10,
                            38,
                            84,
                            104,
                            101,
                            32,
                            115,
                            101,
                            99,
                            114,
                            101,
                            116,
                            32,
                            119,
                            97,
                            115,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            103,
                            101,
                            110,
                            101,
                            114,
                            97,
                            116,
                            101,
                            100,
                            46,
                            74,
                            65,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            58,
                            10,
                            27,
                            84,
                            104,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Remove a Users Secret
         *
         * Remove the current client ID and client secret from a machine user.
         *
         * Required permission:
         *   - user.write
         */
        removeSecret: {
            name: "RemoveSecret",
            requestType: RemoveSecretRequest,
            requestStream: false,
            responseType: RemoveSecretResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            92,
                            74,
                            90,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            83,
                            10,
                            81,
                            84,
                            104,
                            101,
                            32,
                            115,
                            101,
                            99,
                            114,
                            101,
                            116,
                            32,
                            119,
                            97,
                            115,
                            32,
                            101,
                            105,
                            116,
                            104,
                            101,
                            114,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            114,
                            101,
                            109,
                            111,
                            118,
                            101,
                            100,
                            32,
                            111,
                            114,
                            32,
                            105,
                            116,
                            32,
                            100,
                            105,
                            100,
                            110,
                            39,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            32,
                            105,
                            110,
                            32,
                            116,
                            104,
                            101,
                            32,
                            102,
                            105,
                            114,
                            115,
                            116,
                            32,
                            112,
                            108,
                            97,
                            99,
                            101,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Add a Key
         *
         * Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens.
         * Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore.
         * Only users of type machine can have keys.
         *
         * Required permission:
         *   - user.write
         */
        addKey: {
            name: "AddKey",
            requestType: AddKeyRequest,
            requestStream: false,
            responseType: AddKeyResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            111,
                            74,
                            42,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            35,
                            10,
                            33,
                            84,
                            104,
                            101,
                            32,
                            107,
                            101,
                            121,
                            32,
                            119,
                            97,
                            115,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            46,
                            74,
                            65,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            58,
                            10,
                            27,
                            84,
                            104,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Remove a Key
         *
         * Remove a machine users key by the given key ID and an optionally given user ID.
         *
         * Required permission:
         *   - user.write
         */
        removeKey: {
            name: "RemoveKey",
            requestType: RemoveKeyRequest,
            requestStream: false,
            responseType: RemoveKeyResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            86,
                            74,
                            84,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            77,
                            10,
                            75,
                            84,
                            104,
                            101,
                            32,
                            107,
                            101,
                            121,
                            32,
                            119,
                            97,
                            115,
                            32,
                            101,
                            105,
                            116,
                            104,
                            101,
                            114,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            114,
                            101,
                            109,
                            111,
                            118,
                            101,
                            100,
                            32,
                            111,
                            114,
                            32,
                            105,
                            116,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                            32,
                            105,
                            110,
                            32,
                            116,
                            104,
                            101,
                            32,
                            102,
                            105,
                            114,
                            115,
                            116,
                            32,
                            112,
                            108,
                            97,
                            99,
                            101,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Search Keys
         *
         * List all matching keys. By default all keys of the instance on which the caller has permission to read the owning users are returned.
         * Make sure to include a limit and sorting for pagination.
         *
         * Required permission:
         *   - user.read
         */
        listKeys: {
            name: "ListKeys",
            requestType: ListKeysRequest,
            requestStream: false,
            responseType: ListKeysResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            90,
                            74,
                            59,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            52,
                            10,
                            50,
                            65,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            97,
                            108,
                            108,
                            32,
                            109,
                            97,
                            99,
                            104,
                            105,
                            110,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            107,
                            101,
                            121,
                            115,
                            32,
                            109,
                            97,
                            116,
                            99,
                            104,
                            105,
                            110,
                            103,
                            32,
                            116,
                            104,
                            101,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                            74,
                            27,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            20,
                            10,
                            18,
                            105,
                            110,
                            118,
                            97,
                            108,
                            105,
                            100,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Add a Personal Access Token
         *
         * Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs.
         * Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore.
         * Only users of type machine can have personal access tokens.
         *
         * Required permission:
         *   - user.write
         */
        addPersonalAccessToken: {
            name: "AddPersonalAccessToken",
            requestType: AddPersonalAccessTokenRequest,
            requestStream: false,
            responseType: AddPersonalAccessTokenResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            129,
                            1,
                            74,
                            60,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            53,
                            10,
                            51,
                            84,
                            104,
                            101,
                            32,
                            112,
                            101,
                            114,
                            115,
                            111,
                            110,
                            97,
                            108,
                            32,
                            97,
                            99,
                            99,
                            101,
                            115,
                            115,
                            32,
                            116,
                            111,
                            107,
                            101,
                            110,
                            32,
                            119,
                            97,
                            115,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            46,
                            74,
                            65,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            58,
                            10,
                            27,
                            84,
                            104,
                            101,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                            18,
                            27,
                            10,
                            25,
                            26,
                            23,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            114,
                            112,
                            99,
                            83,
                            116,
                            97,
                            116,
                            117,
                            115,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Remove a Personal Access Token
         *
         * Removes a machine users personal access token by the given token ID and an optionally given user ID.
         *
         * Required permission:
         *   - user.write
         */
        removePersonalAccessToken: {
            name: "RemovePersonalAccessToken",
            requestType: RemovePersonalAccessTokenRequest,
            requestStream: false,
            responseType: RemovePersonalAccessTokenResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            108,
                            74,
                            106,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            99,
                            10,
                            97,
                            84,
                            104,
                            101,
                            32,
                            112,
                            101,
                            114,
                            115,
                            111,
                            110,
                            97,
                            108,
                            32,
                            97,
                            99,
                            99,
                            101,
                            115,
                            115,
                            32,
                            116,
                            111,
                            107,
                            101,
                            110,
                            32,
                            119,
                            97,
                            115,
                            32,
                            101,
                            105,
                            116,
                            104,
                            101,
                            114,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            114,
                            101,
                            109,
                            111,
                            118,
                            101,
                            100,
                            32,
                            111,
                            114,
                            32,
                            105,
                            116,
                            32,
                            119,
                            97,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                            32,
                            105,
                            110,
                            32,
                            116,
                            104,
                            101,
                            32,
                            102,
                            105,
                            114,
                            115,
                            116,
                            32,
                            112,
                            108,
                            97,
                            99,
                            101,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * Search Personal Access Tokens
         *
         * List all personal access tokens. By default all personal access tokens of the instance on which the caller has permission to read the owning users are returned.
         * Make sure to include a limit and sorting for pagination.
         *
         * Required permission:
         *   - user.read
         */
        listPersonalAccessTokens: {
            name: "ListPersonalAccessTokens",
            requestType: ListPersonalAccessTokensRequest,
            requestStream: false,
            responseType: ListPersonalAccessTokensResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            95,
                            74,
                            64,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            57,
                            10,
                            55,
                            65,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            97,
                            108,
                            108,
                            32,
                            112,
                            101,
                            114,
                            115,
                            111,
                            110,
                            97,
                            108,
                            32,
                            97,
                            99,
                            99,
                            101,
                            115,
                            115,
                            32,
                            116,
                            111,
                            107,
                            101,
                            110,
                            115,
                            32,
                            109,
                            97,
                            116,
                            99,
                            104,
                            105,
                            110,
                            103,
                            32,
                            116,
                            104,
                            101,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                            74,
                            27,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            20,
                            10,
                            18,
                            105,
                            110,
                            118,
                            97,
                            108,
                            105,
                            100,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            113,
                            117,
                            101,
                            114,
                            121,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                },
            },
        },
        /**
         * List all possible authentication methods of a user
         *
         * List all possible authentication methods of a user like password, passwordless, (T)OTP and more..
         */
        listAuthenticationMethodTypes: {
            name: "ListAuthenticationMethodTypes",
            requestType: ListAuthenticationMethodTypesRequest,
            requestStream: false,
            responseType: ListAuthenticationMethodTypesResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            44,
                            18,
                            42,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            97,
                            117,
                            116,
                            104,
                            101,
                            110,
                            116,
                            105,
                            99,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            109,
                            101,
                            116,
                            104,
                            111,
                            100,
                            115,
                        ]),
                    ],
                },
            },
        },
        listAuthenticationFactors: {
            name: "ListAuthenticationFactors",
            requestType: ListAuthenticationFactorsRequest,
            requestStream: false,
            responseType: ListAuthenticationFactorsResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            52,
                            34,
                            50,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            97,
                            117,
                            116,
                            104,
                            101,
                            110,
                            116,
                            105,
                            99,
                            97,
                            116,
                            105,
                            111,
                            110,
                            95,
                            102,
                            97,
                            99,
                            116,
                            111,
                            114,
                            115,
                            47,
                            95,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Create an invite code for a user
         *
         * Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods.
         * If an invite code has been created previously, it's url template and application name will be used as defaults for the new code.
         * The new code will overwrite the previous one and make it invalid.
         */
        createInviteCode: {
            name: "CreateInviteCode",
            requestType: CreateInviteCodeRequest,
            requestStream: false,
            responseType: CreateInviteCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            36,
                            58,
                            1,
                            42,
                            34,
                            31,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            105,
                            110,
                            118,
                            105,
                            116,
                            101,
                            95,
                            99,
                            111,
                            100,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Resend an invite code for a user
         *
         * Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead.
         *
         * Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods.
         * A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned.
         */
        resendInviteCode: {
            name: "ResendInviteCode",
            requestType: ResendInviteCodeRequest,
            requestStream: false,
            responseType: ResendInviteCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            49,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                            88,
                            1,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            40,
                            34,
                            38,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            105,
                            110,
                            118,
                            105,
                            116,
                            101,
                            95,
                            99,
                            111,
                            100,
                            101,
                            47,
                            114,
                            101,
                            115,
                            101,
                            110,
                            100,
                        ]),
                    ],
                },
            },
        },
        /**
         * Verify an invite code for a user
         *
         * Verify the invite code of a user previously issued. This will set their email to a verified state and
         * allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods.
         */
        verifyInviteCode: {
            name: "VerifyInviteCode",
            requestType: VerifyInviteCodeRequest,
            requestStream: false,
            responseType: VerifyInviteCodeResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            43,
                            58,
                            1,
                            42,
                            34,
                            38,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            105,
                            110,
                            118,
                            105,
                            116,
                            101,
                            95,
                            99,
                            111,
                            100,
                            101,
                            47,
                            118,
                            101,
                            114,
                            105,
                            102,
                            121,
                        ]),
                    ],
                },
            },
        },
        /**
         * MFA Init Skipped
         *
         * Update the last time the user has skipped MFA initialization. The server timestamp is used.
         */
        humanMFAInitSkipped: {
            name: "HumanMFAInitSkipped",
            requestType: HumanMFAInitSkippedRequest,
            requestStream: false,
            responseType: HumanMFAInitSkippedResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            47,
                            74,
                            11,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            4,
                            10,
                            2,
                            79,
                            75,
                            74,
                            32,
                            10,
                            3,
                            52,
                            48,
                            52,
                            18,
                            25,
                            10,
                            23,
                            85,
                            115,
                            101,
                            114,
                            32,
                            73,
                            68,
                            32,
                            100,
                            111,
                            101,
                            115,
                            32,
                            110,
                            111,
                            116,
                            32,
                            101,
                            120,
                            105,
                            115,
                            116,
                            46,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            41,
                            58,
                            1,
                            42,
                            34,
                            36,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            102,
                            97,
                            95,
                            105,
                            110,
                            105,
                            116,
                            95,
                            115,
                            107,
                            105,
                            112,
                            112,
                            101,
                            100,
                        ]),
                    ],
                },
            },
        },
        /**
         * Set User Metadata
         *
         * Sets a list of key value pairs. Existing metadata entries with matching keys are overwritten. Existing metadata entries without matching keys are untouched. To remove metadata entries, use [DeleteUserMetadata](apis/resources/user_service_v2/user-service-delete-user-metadata.api.mdx). For HTTP requests, make sure the bytes array value is base64 encoded.
         *
         * Required permission:
         *  - `user.write`
         */
        setUserMetadata: {
            name: "SetUserMetadata",
            requestType: SetUserMetadataRequest,
            requestStream: false,
            responseType: SetUserMetadataResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            34,
                            74,
                            7,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            0,
                            74,
                            23,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            16,
                            10,
                            14,
                            85,
                            115,
                            101,
                            114,
                            32,
                            110,
                            111,
                            116,
                            32,
                            102,
                            111,
                            117,
                            110,
                            100,
                        ]),
                    ],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            33,
                            58,
                            1,
                            42,
                            34,
                            28,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                        ]),
                    ],
                },
            },
        },
        /**
         * List User Metadata
         *
         * List metadata of an user filtered by query.
         *
         * Required permission:
         *  - `user.read`
         */
        listUserMetadata: {
            name: "ListUserMetadata",
            requestType: ListUserMetadataRequest,
            requestStream: false,
            responseType: ListUserMetadataResponse,
            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, 117, 115, 101, 114, 46, 114, 101, 97, 100])],
                    578365826: [
                        Buffer.from([
                            40,
                            58,
                            1,
                            42,
                            34,
                            35,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                            47,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete User Metadata
         *
         * Delete metadata objects from an user with a specific key.
         *
         * Required permission:
         *  - `user.write`
         */
        deleteUserMetadata: {
            name: "DeleteUserMetadata",
            requestType: DeleteUserMetadataRequest,
            requestStream: false,
            responseType: DeleteUserMetadataResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [Buffer.from([9, 74, 7, 10, 3, 50, 48, 48, 18, 0])],
                    400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])],
                    578365826: [
                        Buffer.from([
                            30,
                            42,
                            28,
                            47,
                            118,
                            50,
                            47,
                            117,
                            115,
                            101,
                            114,
                            115,
                            47,
                            123,
                            117,
                            115,
                            101,
                            114,
                            95,
                            105,
                            100,
                            125,
                            47,
                            109,
                            101,
                            116,
                            97,
                            100,
                            97,
                            116,
                            97,
                        ]),
                    ],
                },
            },
        },
    },
};
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 isObject(value) {
    return typeof value === "object" && value !== null;
}
function isSet(value) {
    return value !== null && value !== undefined;
}