Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '../../../bridge'
import {
marshalAddGroupMemberRequest,
marshalAddGroupMembersRequest,
marshalCreateAPIKeyRequest,
marshalCreateApplicationRequest,
marshalCreateGroupRequest,
Expand Down Expand Up @@ -45,6 +46,7 @@ import {
import type {
APIKey,
AddGroupMemberRequest,
AddGroupMembersRequest,
Application,
ClonePolicyRequest,
CreateAPIKeyRequest,
Expand Down Expand Up @@ -565,6 +567,33 @@ export class API extends ParentAPI {
unmarshalGroup,
)

/**
* Add multiple users and applications to a group. Add multiple users and
* applications to a group in a single call. You can specify an array of
* `user_id`s and `application_id`s. Note that any existing users and
* applications in the group will remain. To add new users/applications and
* delete pre-existing ones, use the [Overwrite users and applications of a
* group](#path-groups-overwrite-users-and-applications-of-a-group) method.
*
* @param request - The request {@link AddGroupMembersRequest}
* @returns A Promise of Group
*/
addGroupMembers = (request: Readonly<AddGroupMembersRequest>) =>
this.client.fetch<Group>(
{
body: JSON.stringify(
marshalAddGroupMembersRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/iam/v1alpha1/groups/${validatePathParam(
'groupId',
request.groupId,
)}/add-members`,
},
unmarshalGroup,
)

/**
* Remove a user or an application from a group. Remove a user or an
* application from a group. You can specify a `user_id` and and
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/iam/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { API } from './api.gen'
export type {
APIKey,
AddGroupMemberRequest,
AddGroupMembersRequest,
Application,
BearerType,
ClonePolicyRequest,
Expand Down
9 changes: 9 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { DefaultValues } from '../../../bridge'
import type {
APIKey,
AddGroupMemberRequest,
AddGroupMembersRequest,
Application,
CreateAPIKeyRequest,
CreateApplicationRequest,
Expand Down Expand Up @@ -422,6 +423,14 @@ export const marshalAddGroupMemberRequest = (
]),
})

export const marshalAddGroupMembersRequest = (
request: AddGroupMembersRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
application_ids: request.applicationIds,
user_ids: request.userIds,
})

export const marshalCreateAPIKeyRequest = (
request: CreateAPIKeyRequest,
defaults: DefaultValues,
Expand Down
9 changes: 9 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,15 @@ export type AddGroupMemberRequest = {
applicationId?: string
}

export type AddGroupMembersRequest = {
/** ID of the group. */
groupId: string
/** IDs of the users to add. */
userIds?: string[]
/** IDs of the applications to add. */
applicationIds?: string[]
}

export type RemoveGroupMemberRequest = {
/** ID of the group. */
groupId: string
Expand Down