From b8dc608073a4fdba188dde1dcf9364d5269da954 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 4 Sep 2025 14:05:21 +0000 Subject: [PATCH] feat: update generated APIs --- .../iam/src/v1alpha1/api.gen.ts | 61 ++++-------- .../iam/src/v1alpha1/index.gen.ts | 10 +- .../iam/src/v1alpha1/marshalling.gen.ts | 51 +++++----- .../iam/src/v1alpha1/types.gen.ts | 97 +++++++++---------- .../iam/src/v1alpha1/validation-rules.gen.ts | 21 ++-- 5 files changed, 102 insertions(+), 138 deletions(-) diff --git a/packages_generated/iam/src/v1alpha1/api.gen.ts b/packages_generated/iam/src/v1alpha1/api.gen.ts index 8818d9d4c..7ad301374 100644 --- a/packages_generated/iam/src/v1alpha1/api.gen.ts +++ b/packages_generated/iam/src/v1alpha1/api.gen.ts @@ -15,7 +15,6 @@ import { marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreateJWTRequest, - marshalCreateOrganizationSamlRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalCreateUserRequest, @@ -28,9 +27,9 @@ import { marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, - marshalUpdateOrganizationSamlRequest, marshalUpdateOrganizationSecuritySettingsRequest, marshalUpdatePolicyRequest, + marshalUpdateSamlRequest, marshalUpdateSSHKeyRequest, marshalUpdateUserPasswordRequest, marshalUpdateUserRequest, @@ -64,7 +63,6 @@ import { unmarshalQuotum, unmarshalSaml, unmarshalSamlCertificate, - unmarshalSamlInformation, unmarshalSetRulesResponse, unmarshalSSHKey, unmarshalUser, @@ -81,7 +79,6 @@ import type { CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, - CreateOrganizationSamlRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserMFAOTPRequest, @@ -90,12 +87,13 @@ import type { DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, - DeleteOrganizationSamlRequest, DeletePolicyRequest, DeleteSamlCertificateRequest, + DeleteSamlRequest, DeleteSSHKeyRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, + EnableOrganizationSamlRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, @@ -107,7 +105,6 @@ import type { GetOrganizationSecuritySettingsRequest, GetPolicyRequest, GetQuotumRequest, - GetSamlInformationRequest, GetSSHKeyRequest, GetUserConnectionsRequest, GetUserConnectionsResponse, @@ -155,7 +152,6 @@ import type { RemoveUserConnectionRequest, Saml, SamlCertificate, - SamlInformation, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, @@ -165,9 +161,9 @@ import type { UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, - UpdateOrganizationSamlRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, + UpdateSamlRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, @@ -1425,17 +1421,17 @@ export class API extends ParentAPI { ) /** - * Create a SAML Identity Provider configuration for an Organization. + * Enable SAML Identity Provider for an Organization. * - * @param request - The request {@link CreateOrganizationSamlRequest} + * @param request - The request {@link EnableOrganizationSamlRequest} * @returns A Promise of Saml */ - createOrganizationSaml = (request: Readonly) => + enableOrganizationSaml = ( + request: Readonly = {}, + ) => this.client.fetch( { - body: JSON.stringify( - marshalCreateOrganizationSamlRequest(request, this.client.settings), - ), + body: '{}', headers: jsonContentHeaders, method: 'POST', path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`, @@ -1444,37 +1440,33 @@ export class API extends ParentAPI { ) /** - * Update a SAML Identity Provider configuration for an Organization. + * Update SAML Identity Provider configuration. * - * @param request - The request {@link UpdateOrganizationSamlRequest} + * @param request - The request {@link UpdateSamlRequest} * @returns A Promise of Saml */ - updateOrganizationSaml = ( - request: Readonly = {}, - ) => + updateSaml = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalUpdateOrganizationSamlRequest(request, this.client.settings), + marshalUpdateSamlRequest(request, this.client.settings), ), headers: jsonContentHeaders, method: 'PATCH', - path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`, + path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}`, }, unmarshalSaml, ) /** - * Delete a SAML Identity Provider configuration for an Organization. + * Disable SAML Identity Provider for an Organization. * - * @param request - The request {@link DeleteOrganizationSamlRequest} + * @param request - The request {@link DeleteSamlRequest} */ - deleteOrganizationSaml = ( - request: Readonly = {}, - ) => + deleteSaml = (request: Readonly) => this.client.fetch({ method: 'DELETE', - path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`, + path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}`, }) /** @@ -1521,19 +1513,4 @@ export class API extends ParentAPI { method: 'DELETE', path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`, }) - - /** - * Get SAML information. - * - * @param request - The request {@link GetSamlInformationRequest} - * @returns A Promise of SamlInformation - */ - getSamlInformation = (request: Readonly = {}) => - this.client.fetch( - { - method: 'GET', - path: `/iam/v1alpha1/saml-information`, - }, - unmarshalSamlInformation, - ) } diff --git a/packages_generated/iam/src/v1alpha1/index.gen.ts b/packages_generated/iam/src/v1alpha1/index.gen.ts index a9d05e61c..a68e58893 100644 --- a/packages_generated/iam/src/v1alpha1/index.gen.ts +++ b/packages_generated/iam/src/v1alpha1/index.gen.ts @@ -17,7 +17,6 @@ export type { CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, - CreateOrganizationSamlRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserMFAOTPRequest, @@ -27,12 +26,13 @@ export type { DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, - DeleteOrganizationSamlRequest, DeletePolicyRequest, DeleteSamlCertificateRequest, + DeleteSamlRequest, DeleteSSHKeyRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, + EnableOrganizationSamlRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, @@ -44,7 +44,6 @@ export type { GetOrganizationSecuritySettingsRequest, GetPolicyRequest, GetQuotumRequest, - GetSamlInformationRequest, GetSSHKeyRequest, GetUserConnectionsRequest, GetUserConnectionsResponse, @@ -114,7 +113,8 @@ export type { SamlCertificate, SamlCertificateOrigin, SamlCertificateType, - SamlInformation, + SamlServiceProvider, + SamlStatus, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, @@ -124,9 +124,9 @@ export type { UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, - UpdateOrganizationSamlRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, + UpdateSamlRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, diff --git a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts index bedcd32a4..0a57feed3 100644 --- a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts @@ -21,7 +21,6 @@ import type { CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, - CreateOrganizationSamlRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, @@ -60,7 +59,7 @@ import type { RuleSpecs, Saml, SamlCertificate, - SamlInformation, + SamlServiceProvider, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, @@ -69,9 +68,9 @@ import type { UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, - UpdateOrganizationSamlRequest, UpdateOrganizationSecuritySettingsRequest, UpdatePolicyRequest, + UpdateSamlRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, @@ -698,31 +697,35 @@ export const unmarshalOrganizationSecuritySettings = ( } as OrganizationSecuritySettings } -export const unmarshalSaml = (data: unknown): Saml => { +const unmarshalSamlServiceProvider = (data: unknown): SamlServiceProvider => { if (!isJSONObject(data)) { throw new TypeError( - `Unmarshalling the type 'Saml' failed as data isn't a dictionary.`, + `Unmarshalling the type 'SamlServiceProvider' failed as data isn't a dictionary.`, ) } return { + assertionConsumerServiceUrl: data.assertion_consumer_service_url, entityId: data.entity_id, - id: data.id, - singleSignOnUrl: data.single_sign_on_url, - } as Saml + } as SamlServiceProvider } -export const unmarshalSamlInformation = (data: unknown): SamlInformation => { +export const unmarshalSaml = (data: unknown): Saml => { if (!isJSONObject(data)) { throw new TypeError( - `Unmarshalling the type 'SamlInformation' failed as data isn't a dictionary.`, + `Unmarshalling the type 'Saml' failed as data isn't a dictionary.`, ) } return { - assertionConsumerServiceUrl: data.assertion_consumer_service_url, entityId: data.entity_id, - } as SamlInformation + id: data.id, + serviceProvider: data.service_provider + ? unmarshalSamlServiceProvider(data.service_provider) + : undefined, + singleSignOnUrl: data.single_sign_on_url, + status: data.status, + } as Saml } export const unmarshalSetRulesResponse = (data: unknown): SetRulesResponse => { @@ -818,14 +821,6 @@ export const marshalCreateJWTRequest = ( user_id: request.userId, }) -export const marshalCreateOrganizationSamlRequest = ( - request: CreateOrganizationSamlRequest, - defaults: DefaultValues, -): Record => ({ - entity_id: request.entityId, - single_sign_on_url: request.singleSignOnUrl, -}) - const marshalRuleSpecs = ( request: RuleSpecs, defaults: DefaultValues, @@ -973,14 +968,6 @@ export const marshalUpdateGroupRequest = ( tags: request.tags, }) -export const marshalUpdateOrganizationSamlRequest = ( - request: UpdateOrganizationSamlRequest, - defaults: DefaultValues, -): Record => ({ - entity_id: request.entityId, - single_sign_on_url: request.singleSignOnUrl, -}) - export const marshalUpdateOrganizationSecuritySettingsRequest = ( request: UpdateOrganizationSecuritySettingsRequest, defaults: DefaultValues, @@ -1013,6 +1000,14 @@ export const marshalUpdateSSHKeyRequest = ( name: request.name, }) +export const marshalUpdateSamlRequest = ( + request: UpdateSamlRequest, + defaults: DefaultValues, +): Record => ({ + entity_id: request.entityId, + single_sign_on_url: request.singleSignOnUrl, +}) + export const marshalUpdateUserPasswordRequest = ( request: UpdateUserPasswordRequest, defaults: DefaultValues, diff --git a/packages_generated/iam/src/v1alpha1/types.gen.ts b/packages_generated/iam/src/v1alpha1/types.gen.ts index 4fbd0f141..254d5f331 100644 --- a/packages_generated/iam/src/v1alpha1/types.gen.ts +++ b/packages_generated/iam/src/v1alpha1/types.gen.ts @@ -105,6 +105,13 @@ export type SamlCertificateType = | 'signing' | 'encryption' +export type SamlStatus = + | 'unknown_saml_status' + | 'valid' + | 'missing_certificate' + | 'missing_entity_id' + | 'missing_single_sign_on_url' + export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated' export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member' @@ -792,6 +799,11 @@ export interface User { locked: boolean } +export interface SamlServiceProvider { + entityId: string + assertionConsumerServiceUrl: string +} + export type AddGroupMemberRequest = { /** * ID of the group. @@ -921,21 +933,6 @@ export type CreateJWTRequest = { referrer: string } -export type CreateOrganizationSamlRequest = { - /** - * ID of the Organization. - */ - organizationId?: string - /** - * Entity ID of the SAML Identity Provider. - */ - entityId: string - /** - * Single Sign-On URL of the SAML Identity Provider. - */ - singleSignOnUrl: string -} - export type CreatePolicyRequest = { /** * Name of the policy to create (max length is 64 characters). @@ -1056,13 +1053,6 @@ export type DeleteJWTRequest = { jti: string } -export type DeleteOrganizationSamlRequest = { - /** - * ID of the Organization. - */ - organizationId?: string -} - export type DeletePolicyRequest = { /** * Id of policy to delete. @@ -1081,6 +1071,13 @@ export type DeleteSamlCertificateRequest = { certificateId: string } +export type DeleteSamlRequest = { + /** + * ID of the SAML configuration. + */ + samlId: string +} + export type DeleteUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -1095,6 +1092,13 @@ export type DeleteUserRequest = { userId: string } +export type EnableOrganizationSamlRequest = { + /** + * ID of the Organization. + */ + organizationId?: string +} + export interface EncodedJWT { /** * The renewed JWT. @@ -1191,8 +1195,6 @@ export type GetSSHKeyRequest = { sshKeyId: string } -export type GetSamlInformationRequest = Record - export type GetUserConnectionsRequest = { /** * ID of the user to list connections for. @@ -1835,24 +1837,21 @@ export interface Saml { */ id: string /** - * Entity ID of the SAML Identity Provider. + * Status of the SAML configuration. */ - entityId: string + status: SamlStatus /** - * Single Sign-On URL of the SAML Identity Provider. + * Service Provider information. */ - singleSignOnUrl: string -} - -export interface SamlInformation { + serviceProvider?: SamlServiceProvider /** - * Entity ID. + * Entity ID of the SAML Identity Provider. */ entityId: string /** - * SAML Assertion Consumer Service url. + * Single Sign-On URL of the SAML Identity Provider. */ - assertionConsumerServiceUrl: string + singleSignOnUrl: string } export type SetGroupMembersRequest = { @@ -1950,21 +1949,6 @@ export type UpdateGroupRequest = { tags?: string[] } -export type UpdateOrganizationSamlRequest = { - /** - * ID of the Organization. - */ - organizationId?: string - /** - * Entity ID of the SAML Identity Provider. - */ - entityId?: string - /** - * Single Sign-On URL of the SAML Identity Provider. - */ - singleSignOnUrl?: string -} - export type UpdateOrganizationSecuritySettingsRequest = { /** * ID of the Organization. @@ -2039,6 +2023,21 @@ export type UpdateSSHKeyRequest = { disabled?: boolean } +export type UpdateSamlRequest = { + /** + * ID of the SAML configuration. + */ + samlId: string + /** + * Entity ID of the SAML Identity Provider. + */ + entityId?: string + /** + * Single Sign-On URL of the SAML Identity Provider. + */ + singleSignOnUrl?: string +} + export type UpdateUserPasswordRequest = { /** * ID of the user to update. diff --git a/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts b/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts index 7f16cae15..0591240d1 100644 --- a/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts @@ -39,13 +39,6 @@ export const CreateGroupRequest = { }, } -export const CreateOrganizationSamlRequest = { - entityId: { - maxLength: 1024, - minLength: 1, - }, -} - export const CreatePolicyRequest = { description: { ignoreEmpty: true, @@ -279,13 +272,6 @@ export const UpdateGroupRequest = { }, } -export const UpdateOrganizationSamlRequest = { - entityId: { - maxLength: 1024, - minLength: 1, - }, -} - export const UpdateOrganizationSecuritySettingsRequest = { loginAttemptsBeforeLocked: { greaterThanOrEqual: 1, @@ -310,6 +296,13 @@ export const UpdateSSHKeyRequest = { }, } +export const UpdateSamlRequest = { + entityId: { + maxLength: 1024, + minLength: 1, + }, +} + export const UpdateUserRequest = { firstName: { maxLength: 64,