From 77e249d42672430dd4ee508957279e4d43e87254 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Mon, 21 Oct 2024 14:43:19 +0000 Subject: [PATCH] feat: update generated APIs --- .../clients/src/api/iam/v1alpha1/api.gen.ts | 15 +++++++ .../clients/src/api/iam/v1alpha1/index.gen.ts | 1 + .../src/api/iam/v1alpha1/marshalling.gen.ts | 9 ++++ .../clients/src/api/iam/v1alpha1/types.gen.ts | 44 +++++++++++-------- .../api/iam/v1alpha1/validation-rules.gen.ts | 7 +++ 5 files changed, 57 insertions(+), 19 deletions(-) diff --git a/packages/clients/src/api/iam/v1alpha1/api.gen.ts b/packages/clients/src/api/iam/v1alpha1/api.gen.ts index 66f74d150..0b7018b31 100644 --- a/packages/clients/src/api/iam/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/api.gen.ts @@ -25,6 +25,7 @@ import { marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, + marshalUpdateUserPasswordRequest, marshalUpdateUserRequest, unmarshalAPIKey, unmarshalApplication, @@ -116,6 +117,7 @@ import type { UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, + UpdateUserPasswordRequest, UpdateUserRequest, User, } from './types.gen' @@ -343,6 +345,19 @@ export class API extends ParentAPI { unmarshalUser, ) + updateUserPassword = (request: Readonly) => + this.client.fetch( + { + body: JSON.stringify( + marshalUpdateUserPasswordRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/update-password`, + }, + unmarshalUser, + ) + protected pageOfListApplications = ( request: Readonly = {}, ) => diff --git a/packages/clients/src/api/iam/v1alpha1/index.gen.ts b/packages/clients/src/api/iam/v1alpha1/index.gen.ts index 7fc9601d4..f7145a67b 100644 --- a/packages/clients/src/api/iam/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/index.gen.ts @@ -86,6 +86,7 @@ export type { UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, + UpdateUserPasswordRequest, UpdateUserRequest, User, UserStatus, diff --git a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts index 711dc84db..0a677c4a8 100644 --- a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts @@ -51,6 +51,7 @@ import type { UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, + UpdateUserPasswordRequest, UpdateUserRequest, User, } from './types.gen' @@ -684,6 +685,14 @@ export const marshalUpdateSSHKeyRequest = ( name: request.name, }) +export const marshalUpdateUserPasswordRequest = ( + request: UpdateUserPasswordRequest, + defaults: DefaultValues, +): Record => ({ + password: request.password, + send_email: request.sendEmail, +}) + export const marshalUpdateUserRequest = ( request: UpdateUserRequest, defaults: DefaultValues, diff --git a/packages/clients/src/api/iam/v1alpha1/types.gen.ts b/packages/clients/src/api/iam/v1alpha1/types.gen.ts index 8d648097f..90be242bd 100644 --- a/packages/clients/src/api/iam/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/types.gen.ts @@ -89,6 +89,25 @@ export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated' export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member' +export interface JWT { + /** JWT ID. */ + jti: string + /** ID of the user who issued the JWT. */ + issuerId: string + /** ID of the user targeted by the JWT. */ + audienceId: string + /** Creation date of the JWT. */ + createdAt?: Date + /** Last update date of the JWT. */ + updatedAt?: Date + /** Expiration date of the JWT. */ + expiresAt?: Date + /** IP address used during the creation of the JWT. */ + ip: string + /** User-agent used during the creation of the JWT. */ + userAgent: string +} + export interface RuleSpecs { /** Names of permission sets bound to the rule. */ permissionSetNames?: string[] @@ -121,25 +140,6 @@ export interface CreateUserRequestMember { password: string } -export interface JWT { - /** JWT ID. */ - jti: string - /** ID of the user who issued the JWT. */ - issuerId: string - /** ID of the user targeted by the JWT. */ - audienceId: string - /** Creation date of the JWT. */ - createdAt?: Date - /** Last update date of the JWT. */ - updatedAt?: Date - /** Expiration date of the JWT. */ - expiresAt?: Date - /** IP address used during the creation of the JWT. */ - ip: string - /** User-agent used during the creation of the JWT. */ - userAgent: string -} - export interface APIKey { /** Access key of the API key. */ accessKey: string @@ -1070,6 +1070,12 @@ export type UpdateSSHKeyRequest = { disabled?: boolean } +export type UpdateUserPasswordRequest = { + userId: string + password: string + sendEmail: boolean +} + export type UpdateUserRequest = { /** ID of the user to update. */ userId: string diff --git a/packages/clients/src/api/iam/v1alpha1/validation-rules.gen.ts b/packages/clients/src/api/iam/v1alpha1/validation-rules.gen.ts index 6f7af9fa6..faffb8884 100644 --- a/packages/clients/src/api/iam/v1alpha1/validation-rules.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/validation-rules.gen.ts @@ -254,3 +254,10 @@ export const UpdateSSHKeyRequest = { maxLength: 1000, }, } + +export const UpdateUserPasswordRequest = { + password: { + maxLength: 72, + minLength: 1, + }, +}