import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { PaginationRequest, PaginationResponse } from "../../filter/v2/filter.js"; import { FieldName, Group, GroupsSearchFilter, GroupUser, GroupUserFieldName, GroupUsersSearchFilter } from "./group.js"; export declare const protobufPackage = "zitadel.group.v2"; export interface CreateGroupRequest { /** The ID of the Organization where the group should be created. */ organizationId: string; /** Name of the group. This must be unique inside the corresponding organization. */ name: string; /** Optionally, provide a description of the group that could help others identify its purpose. */ description: string; /** * In case you need to specify the unique identifier of the group, such as to recreate a previously existing group, you can provide the ID. * If omitted, the system will generate an ID for you. * This is the preferred way. The generated ID will be returned in the response. */ id?: string | undefined; } export interface CreateGroupResponse { /** ID is the unique identifier of the newly created user group. */ id: string; /** CreationDate is the timestamp when the user group was created. */ creationDate: Date | undefined; } export interface ListGroupsRequest { /** Criteria to list the user groups. */ filters: GroupsSearchFilter[]; /** Pagination and sorting. */ pagination: PaginationRequest | undefined; /** The field the result is sorted by. */ sortingColumn?: FieldName | undefined; } export interface ListGroupsResponse { /** The list of groups. */ groups: Group[]; /** Contains the total number of groups matching the query and the applied limit. */ pagination: PaginationResponse | undefined; } export interface GetGroupRequest { /** The ID of the group to be retrieved. */ id: string; } export interface GetGroupResponse { group: Group | undefined; } export interface UpdateGroupRequest { /** The ID of the user group to be updated. */ id: string; /** * Name of the group. The name must be unique inside the corresponding organization. * If omitted, the name will be unchanged. */ name?: string | undefined; /** * Optionally, provide a new description of the group that could help others identify its purpose. * If omitted, the description will be unchanged. */ description?: string | undefined; } export interface UpdateGroupResponse { changeDate: Date | undefined; } export interface DeleteGroupRequest { /** ID of the user group to be deleted. */ id: string; } export interface DeleteGroupResponse { deletionDate: Date | undefined; } export interface AddUsersToGroupRequest { /** ID of the group to which the users should be added. */ id: string; /** UserIds is a list of IDs of the users who should be added to the group. */ userIds: string[]; } export interface AddUsersToGroupResponse { /** ChangeDate is the timestamp when the users are added. */ changeDate: Date | undefined; } export interface RemoveUsersFromGroupRequest { /** ID of the group from which the users should be removed. */ id: string; /** UserIds is a list of IDs of the users who should be removed the group. */ userIds: string[]; } export interface RemoveUsersFromGroupResponse { /** ChangeDate is the timestamp when the users are removed. */ changeDate: Date | undefined; } export interface ListGroupUsersRequest { /** GroupUsersSearchFilter defines the criteria to list the user groups. */ filters: GroupUsersSearchFilter[]; /** Pagination and sorting. */ pagination: PaginationRequest | undefined; /** SortingColumn defines the field the result is sorted by. */ sortingColumn?: GroupUserFieldName | undefined; } export interface ListGroupUsersResponse { /** GroupUsers is the list of users present in the requested group, matching the search criteria */ groupUsers: GroupUser[]; /** Contains the total number of users matching the query and the applied limit. */ pagination: PaginationResponse | undefined; } export declare const CreateGroupRequest: MessageFns; export declare const CreateGroupResponse: MessageFns; export declare const ListGroupsRequest: MessageFns; export declare const ListGroupsResponse: MessageFns; export declare const GetGroupRequest: MessageFns; export declare const GetGroupResponse: MessageFns; export declare const UpdateGroupRequest: MessageFns; export declare const UpdateGroupResponse: MessageFns; export declare const DeleteGroupRequest: MessageFns; export declare const DeleteGroupResponse: MessageFns; export declare const AddUsersToGroupRequest: MessageFns; export declare const AddUsersToGroupResponse: MessageFns; export declare const RemoveUsersFromGroupRequest: MessageFns; export declare const RemoveUsersFromGroupResponse: MessageFns; export declare const ListGroupUsersRequest: MessageFns; export declare const ListGroupUsersResponse: MessageFns; /** * GroupService is used to manage user groups. * This service provides methods to create, retrieve, update, and delete user groups in an organization. */ export type GroupServiceDefinition = typeof GroupServiceDefinition; export declare const GroupServiceDefinition: { readonly name: "GroupService"; readonly fullName: "zitadel.group.v2.GroupService"; readonly methods: { /** * Create Group * * CreateGroup creates a new user group in an organization. * * Required permissions: * - group.create */ readonly createGroup: { readonly name: "CreateGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; }; }; }; /** * Get Group * * Retrieves a group based on its ID. * * Required permission: * - group.read */ readonly getGroup: { readonly name: "GetGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; }; }; }; /** * List Groups * * ListGroups returns all groups matching the request and necessary permissions from an organization. * * Required permissions: * - group.read */ readonly listGroups: { readonly name: "ListGroups"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; }; }; }; /** * Update Group * * UpdateGroup updates the user group. * * In case there aren't any changes, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the group was updated by the request. * * Required permissions: * - group.write */ readonly updateGroup: { readonly name: "UpdateGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; }; }; }; /** * Delete Group * * DeleteGroup deletes the group. * * In case the group is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the group was deleted by the request. * * Required permissions: * - group.delete */ readonly deleteGroup: { readonly name: "DeleteGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; }; }; }; /** * Add Users * * Adds one or more users to a group. * The users should be in the same organization as the group. * The request will not fail if some of the users could not be added to the group, * and a list of failed user IDs is available in the response. * * Required permissions: * - group.user.write */ readonly addUsersToGroup: { readonly name: "AddUsersToGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; /** * Remove Users * * Removes one or more users from a group. * If some of the users are not in the group, the request will still return a successful response as * the desired state is already achieved. * * Required permissions: * - group.user.delete */ readonly removeUsersFromGroup: { readonly name: "RemoveUsersFromGroup"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; /** * List Group Users * * Allows searching for groups based on user IDs, or retrieving users based on group IDs * * Required permissions: * - group.user.read */ readonly listGroupUsers: { readonly name: "ListGroupUsers"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 400010: readonly [Buffer]; }; }; }; }; }; export interface GroupServiceImplementation { /** * Create Group * * CreateGroup creates a new user group in an organization. * * Required permissions: * - group.create */ createGroup(request: CreateGroupRequest, context: CallContext & CallContextExt): Promise>; /** * Get Group * * Retrieves a group based on its ID. * * Required permission: * - group.read */ getGroup(request: GetGroupRequest, context: CallContext & CallContextExt): Promise>; /** * List Groups * * ListGroups returns all groups matching the request and necessary permissions from an organization. * * Required permissions: * - group.read */ listGroups(request: ListGroupsRequest, context: CallContext & CallContextExt): Promise>; /** * Update Group * * UpdateGroup updates the user group. * * In case there aren't any changes, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the group was updated by the request. * * Required permissions: * - group.write */ updateGroup(request: UpdateGroupRequest, context: CallContext & CallContextExt): Promise>; /** * Delete Group * * DeleteGroup deletes the group. * * In case the group is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the group was deleted by the request. * * Required permissions: * - group.delete */ deleteGroup(request: DeleteGroupRequest, context: CallContext & CallContextExt): Promise>; /** * Add Users * * Adds one or more users to a group. * The users should be in the same organization as the group. * The request will not fail if some of the users could not be added to the group, * and a list of failed user IDs is available in the response. * * Required permissions: * - group.user.write */ addUsersToGroup(request: AddUsersToGroupRequest, context: CallContext & CallContextExt): Promise>; /** * Remove Users * * Removes one or more users from a group. * If some of the users are not in the group, the request will still return a successful response as * the desired state is already achieved. * * Required permissions: * - group.user.delete */ removeUsersFromGroup(request: RemoveUsersFromGroupRequest, context: CallContext & CallContextExt): Promise>; /** * List Group Users * * Allows searching for groups based on user IDs, or retrieving users based on group IDs * * Required permissions: * - group.user.read */ listGroupUsers(request: ListGroupUsersRequest, context: CallContext & CallContextExt): Promise>; } export interface GroupServiceClient { /** * Create Group * * CreateGroup creates a new user group in an organization. * * Required permissions: * - group.create */ createGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Get Group * * Retrieves a group based on its ID. * * Required permission: * - group.read */ getGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * List Groups * * ListGroups returns all groups matching the request and necessary permissions from an organization. * * Required permissions: * - group.read */ listGroups(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Update Group * * UpdateGroup updates the user group. * * In case there aren't any changes, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the group was updated by the request. * * Required permissions: * - group.write */ updateGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Delete Group * * DeleteGroup deletes the group. * * In case the group is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the group was deleted by the request. * * Required permissions: * - group.delete */ deleteGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Add Users * * Adds one or more users to a group. * The users should be in the same organization as the group. * The request will not fail if some of the users could not be added to the group, * and a list of failed user IDs is available in the response. * * Required permissions: * - group.user.write */ addUsersToGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Remove Users * * Removes one or more users from a group. * If some of the users are not in the group, the request will still return a successful response as * the desired state is already achieved. * * Required permissions: * - group.user.delete */ removeUsersFromGroup(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * List Group Users * * Allows searching for groups based on user IDs, or retrieving users based on group IDs * * Required permissions: * - group.user.read */ listGroupUsers(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {};