UNPKG

@zitadel/node

Version:

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

1,989 lines 67.5 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.7.5
//   protoc               unknown
// source: zitadel/resources/userschema/v3alpha/user_schema_service.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Instance } from "../../../object/v3alpha/object.js";
import { Details, ListDetails, SearchQuery } from "../../object/v3alpha/object.js";
import { fieldNameFromJSON, fieldNameToJSON, GetUserSchema, PatchUserSchema, SearchFilter, UserSchema, } from "./user_schema.js";
export const protobufPackage = "zitadel.resources.userschema.v3alpha";
function createBaseSearchUserSchemasRequest() {
    return { instance: undefined, query: undefined, sortingColumn: undefined, filters: [] };
}
export const SearchUserSchemasRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(10).fork()).join();
        }
        if (message.query !== undefined) {
            SearchQuery.encode(message.query, writer.uint32(18).fork()).join();
        }
        if (message.sortingColumn !== undefined) {
            writer.uint32(24).int32(message.sortingColumn);
        }
        for (const v of message.filters) {
            SearchFilter.encode(v, writer.uint32(34).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseSearchUserSchemasRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.query = SearchQuery.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.sortingColumn = reader.int32();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.filters.push(SearchFilter.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            query: isSet(object.query) ? SearchQuery.fromJSON(object.query) : undefined,
            sortingColumn: isSet(object.sortingColumn) ? fieldNameFromJSON(object.sortingColumn) : undefined,
            filters: globalThis.Array.isArray(object?.filters)
                ? object.filters.map((e) => SearchFilter.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.query !== undefined) {
            obj.query = SearchQuery.toJSON(message.query);
        }
        if (message.sortingColumn !== undefined) {
            obj.sortingColumn = fieldNameToJSON(message.sortingColumn);
        }
        if (message.filters?.length) {
            obj.filters = message.filters.map((e) => SearchFilter.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return SearchUserSchemasRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSearchUserSchemasRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.query = (object.query !== undefined && object.query !== null)
            ? SearchQuery.fromPartial(object.query)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? undefined;
        message.filters = object.filters?.map((e) => SearchFilter.fromPartial(e)) || [];
        return message;
    },
};
function createBaseSearchUserSchemasResponse() {
    return { details: undefined, sortingColumn: 0, result: [] };
}
export const SearchUserSchemasResponse = {
    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) {
            GetUserSchema.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 = createBaseSearchUserSchemasResponse();
        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(GetUserSchema.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) ? fieldNameFromJSON(object.sortingColumn) : 0,
            result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => GetUserSchema.fromJSON(e)) : [],
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.details !== undefined) {
            obj.details = ListDetails.toJSON(message.details);
        }
        if (message.sortingColumn !== 0) {
            obj.sortingColumn = fieldNameToJSON(message.sortingColumn);
        }
        if (message.result?.length) {
            obj.result = message.result.map((e) => GetUserSchema.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return SearchUserSchemasResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseSearchUserSchemasResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? ListDetails.fromPartial(object.details)
            : undefined;
        message.sortingColumn = object.sortingColumn ?? 0;
        message.result = object.result?.map((e) => GetUserSchema.fromPartial(e)) || [];
        return message;
    },
};
function createBaseGetUserSchemaRequest() {
    return { id: "" };
}
export const GetUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseGetUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return GetUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetUserSchemaRequest();
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseGetUserSchemaResponse() {
    return { userSchema: undefined };
}
export const GetUserSchemaResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.userSchema !== undefined) {
            GetUserSchema.encode(message.userSchema, 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 = createBaseGetUserSchemaResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.userSchema = GetUserSchema.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { userSchema: isSet(object.userSchema) ? GetUserSchema.fromJSON(object.userSchema) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.userSchema !== undefined) {
            obj.userSchema = GetUserSchema.toJSON(message.userSchema);
        }
        return obj;
    },
    create(base) {
        return GetUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGetUserSchemaResponse();
        message.userSchema = (object.userSchema !== undefined && object.userSchema !== null)
            ? GetUserSchema.fromPartial(object.userSchema)
            : undefined;
        return message;
    },
};
function createBaseCreateUserSchemaRequest() {
    return { instance: undefined, userSchema: undefined };
}
export const CreateUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(10).fork()).join();
        }
        if (message.userSchema !== undefined) {
            UserSchema.encode(message.userSchema, 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 = createBaseCreateUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.userSchema = UserSchema.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            userSchema: isSet(object.userSchema) ? UserSchema.fromJSON(object.userSchema) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.userSchema !== undefined) {
            obj.userSchema = UserSchema.toJSON(message.userSchema);
        }
        return obj;
    },
    create(base) {
        return CreateUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserSchemaRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.userSchema = (object.userSchema !== undefined && object.userSchema !== null)
            ? UserSchema.fromPartial(object.userSchema)
            : undefined;
        return message;
    },
};
function createBaseCreateUserSchemaResponse() {
    return { details: undefined };
}
export const CreateUserSchemaResponse = {
    encode(message, writer = new BinaryWriter()) {
        if (message.details !== undefined) {
            Details.encode(message.details, 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 = createBaseCreateUserSchemaResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 2: {
                    if (tag !== 18) {
                        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 CreateUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseCreateUserSchemaResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBasePatchUserSchemaRequest() {
    return { instance: undefined, id: "", userSchema: undefined };
}
export const PatchUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(10).fork()).join();
        }
        if (message.id !== "") {
            writer.uint32(18).string(message.id);
        }
        if (message.userSchema !== undefined) {
            PatchUserSchema.encode(message.userSchema, 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 = createBasePatchUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.userSchema = PatchUserSchema.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            id: isSet(object.id) ? globalThis.String(object.id) : "",
            userSchema: isSet(object.userSchema) ? PatchUserSchema.fromJSON(object.userSchema) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.id !== "") {
            obj.id = message.id;
        }
        if (message.userSchema !== undefined) {
            obj.userSchema = PatchUserSchema.toJSON(message.userSchema);
        }
        return obj;
    },
    create(base) {
        return PatchUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePatchUserSchemaRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.id = object.id ?? "";
        message.userSchema = (object.userSchema !== undefined && object.userSchema !== null)
            ? PatchUserSchema.fromPartial(object.userSchema)
            : undefined;
        return message;
    },
};
function createBasePatchUserSchemaResponse() {
    return { details: undefined };
}
export const PatchUserSchemaResponse = {
    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 = createBasePatchUserSchemaResponse();
        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 PatchUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePatchUserSchemaResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseDeactivateUserSchemaRequest() {
    return { instance: undefined, id: "" };
}
export const DeactivateUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(18).fork()).join();
        }
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseDeactivateUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            id: isSet(object.id) ? globalThis.String(object.id) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return DeactivateUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateUserSchemaRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseDeactivateUserSchemaResponse() {
    return { details: undefined };
}
export const DeactivateUserSchemaResponse = {
    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 = createBaseDeactivateUserSchemaResponse();
        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 DeactivateUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeactivateUserSchemaResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseReactivateUserSchemaRequest() {
    return { instance: undefined, id: "" };
}
export const ReactivateUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(18).fork()).join();
        }
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseReactivateUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            id: isSet(object.id) ? globalThis.String(object.id) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return ReactivateUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseReactivateUserSchemaRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseReactivateUserSchemaResponse() {
    return { details: undefined };
}
export const ReactivateUserSchemaResponse = {
    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 = createBaseReactivateUserSchemaResponse();
        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 ReactivateUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseReactivateUserSchemaResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
function createBaseDeleteUserSchemaRequest() {
    return { instance: undefined, id: "" };
}
export const DeleteUserSchemaRequest = {
    encode(message, writer = new BinaryWriter()) {
        if (message.instance !== undefined) {
            Instance.encode(message.instance, writer.uint32(18).fork()).join();
        }
        if (message.id !== "") {
            writer.uint32(10).string(message.id);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseDeleteUserSchemaRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.instance = Instance.decode(reader, reader.uint32());
                    continue;
                }
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            instance: isSet(object.instance) ? Instance.fromJSON(object.instance) : undefined,
            id: isSet(object.id) ? globalThis.String(object.id) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.instance !== undefined) {
            obj.instance = Instance.toJSON(message.instance);
        }
        if (message.id !== "") {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return DeleteUserSchemaRequest.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserSchemaRequest();
        message.instance = (object.instance !== undefined && object.instance !== null)
            ? Instance.fromPartial(object.instance)
            : undefined;
        message.id = object.id ?? "";
        return message;
    },
};
function createBaseDeleteUserSchemaResponse() {
    return { details: undefined };
}
export const DeleteUserSchemaResponse = {
    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 = createBaseDeleteUserSchemaResponse();
        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 DeleteUserSchemaResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleteUserSchemaResponse();
        message.details = (object.details !== undefined && object.details !== null)
            ? Details.fromPartial(object.details)
            : undefined;
        return message;
    },
};
export const ZITADELUserSchemasDefinition = {
    name: "ZITADELUserSchemas",
    fullName: "zitadel.resources.userschema.v3alpha.ZITADELUserSchemas",
    methods: {
        /**
         * Search user schemas
         *
         * Search all matching user schemas. By default, we will return all user schema of your instance. Make sure to include a limit and sorting for pagination.
         */
        searchUserSchemas: {
            name: "SearchUserSchemas",
            requestType: SearchUserSchemasRequest,
            requestStream: false,
            responseType: SearchUserSchemasResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            110,
                            74,
                            54,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            47,
                            10,
                            45,
                            65,
                            32,
                            108,
                            105,
                            115,
                            116,
                            32,
                            111,
                            102,
                            32,
                            97,
                            108,
                            108,
                            32,
                            117,
                            115,
                            101,
                            114,
                            32,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            109,
                            97,
                            116,
                            99,
                            104,
                            105,
                            110,
                            103,
                            32,
                            116,
                            104,
                            101,
                            32,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                            74,
                            52,
                            10,
                            3,
                            52,
                            48,
                            48,
                            18,
                            45,
                            10,
                            14,
                            105,
                            110,
                            118,
                            97,
                            108,
                            105,
                            100,
                            32,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                            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([19, 10, 17, 10, 15, 117, 115, 101, 114, 115, 99, 104, 101, 109, 97, 46, 114, 101, 97, 100]),
                    ],
                    578365826: [
                        Buffer.from([
                            50,
                            58,
                            7,
                            102,
                            105,
                            108,
                            116,
                            101,
                            114,
                            115,
                            34,
                            39,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            95,
                            115,
                            101,
                            97,
                            114,
                            99,
                            104,
                        ]),
                    ],
                },
            },
        },
        /**
         * User schema by ID
         *
         * Returns the user schema identified by the requested ID.
         */
        getUserSchema: {
            name: "GetUserSchema",
            requestType: GetUserSchemaRequest,
            requestStream: false,
            responseType: GetUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            40,
                            74,
                            38,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            31,
                            10,
                            29,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            114,
                            101,
                            116,
                            114,
                            105,
                            101,
                            118,
                            101,
                            100,
                        ]),
                    ],
                    400010: [
                        Buffer.from([19, 10, 17, 10, 15, 117, 115, 101, 114, 115, 99, 104, 101, 109, 97, 46, 114, 101, 97, 100]),
                    ],
                    578365826: [
                        Buffer.from([
                            38,
                            18,
                            36,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Create a user schema
         *
         * Create the first revision of a new user schema. The schema can then be used on users to store and validate their data.
         */
        createUserSchema: {
            name: "CreateUserSchema",
            requestType: CreateUserSchemaRequest,
            requestStream: false,
            responseType: CreateUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            89,
                            74,
                            87,
                            10,
                            3,
                            50,
                            48,
                            49,
                            18,
                            80,
                            10,
                            27,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            99,
                            114,
                            101,
                            97,
                            116,
                            101,
                            100,
                            18,
                            49,
                            10,
                            47,
                            26,
                            45,
                            35,
                            47,
                            100,
                            101,
                            102,
                            105,
                            110,
                            105,
                            116,
                            105,
                            111,
                            110,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            67,
                            114,
                            101,
                            97,
                            116,
                            101,
                            85,
                            115,
                            101,
                            114,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            82,
                            101,
                            115,
                            112,
                            111,
                            110,
                            115,
                            101,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            25,
                            10,
                            18,
                            10,
                            16,
                            117,
                            115,
                            101,
                            114,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                            18,
                            3,
                            8,
                            201,
                            1,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            46,
                            58,
                            11,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            34,
                            31,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                        ]),
                    ],
                },
            },
        },
        /**
         * Patch a user schema
         *
         * Patch an existing user schema to a new revision. Users based on the current revision will not be affected until they are updated.
         */
        patchUserSchema: {
            name: "PatchUserSchema",
            requestType: PatchUserSchemaRequest,
            requestStream: false,
            responseType: PatchUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            38,
                            74,
                            36,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            29,
                            10,
                            27,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            117,
                            112,
                            100,
                            97,
                            116,
                            101,
                            100,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            20,
                            10,
                            18,
                            10,
                            16,
                            117,
                            115,
                            101,
                            114,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            51,
                            58,
                            11,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            50,
                            36,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
        /**
         * Deactivate a user schema
         *
         * Deactivate an existing user schema and change it into a read-only state. Users based on this schema cannot be updated anymore, but are still able to authenticate.
         */
        deactivateUserSchema: {
            name: "DeactivateUserSchema",
            requestType: DeactivateUserSchemaRequest,
            requestStream: false,
            responseType: DeactivateUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            42,
                            74,
                            40,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            33,
                            10,
                            31,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            100,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                            100,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            20,
                            10,
                            18,
                            10,
                            16,
                            117,
                            115,
                            101,
                            114,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            50,
                            34,
                            48,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                            47,
                            95,
                            100,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Reactivate a user schema
         *
         * Reactivate an previously deactivated user schema and change it into an active state again.
         */
        reactivateUserSchema: {
            name: "ReactivateUserSchema",
            requestType: ReactivateUserSchemaRequest,
            requestStream: false,
            responseType: ReactivateUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            42,
                            74,
                            40,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            33,
                            10,
                            31,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            114,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                            100,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            20,
                            10,
                            18,
                            10,
                            16,
                            117,
                            115,
                            101,
                            114,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            46,
                            119,
                            114,
                            105,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            50,
                            34,
                            48,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                            47,
                            95,
                            114,
                            101,
                            97,
                            99,
                            116,
                            105,
                            118,
                            97,
                            116,
                            101,
                        ]),
                    ],
                },
            },
        },
        /**
         * Delete a user schema
         *
         * Delete an existing user schema. This operation is only allowed if there are no associated users to it.
         */
        deleteUserSchema: {
            name: "DeleteUserSchema",
            requestType: DeleteUserSchemaRequest,
            requestStream: false,
            responseType: DeleteUserSchemaResponse,
            responseStream: false,
            options: {
                _unknownFields: {
                    8338: [
                        Buffer.from([
                            38,
                            74,
                            36,
                            10,
                            3,
                            50,
                            48,
                            48,
                            18,
                            29,
                            10,
                            27,
                            83,
                            99,
                            104,
                            101,
                            109,
                            97,
                            32,
                            115,
                            117,
                            99,
                            99,
                            101,
                            115,
                            115,
                            102,
                            117,
                            108,
                            108,
                            121,
                            32,
                            100,
                            101,
                            108,
                            101,
                            116,
                            101,
                            100,
                        ]),
                    ],
                    400010: [
                        Buffer.from([
                            21,
                            10,
                            19,
                            10,
                            17,
                            117,
                            115,
                            101,
                            114,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            46,
                            100,
                            101,
                            108,
                            101,
                            116,
                            101,
                        ]),
                    ],
                    578365826: [
                        Buffer.from([
                            38,
                            42,
                            36,
                            47,
                            114,
                            101,
                            115,
                            111,
                            117,
                            114,
                            99,
                            101,
                            115,
                            47,
                            118,
                            51,
                            97,
                            108,
                            112,
                            104,
                            97,
                            47,
                            117,
                            115,
                            101,
                            114,
                            95,
                            115,
                            99,
                            104,
                            101,
                            109,
                            97,
                            115,
                            47,
                            123,
                            105,
                            100,
                            125,
                        ]),
                    ],
                },
            },
        },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}