diff --git a/packages_generated/iam/src/v1alpha1/api.gen.ts b/packages_generated/iam/src/v1alpha1/api.gen.ts index 8ccf82c2f..4d1318b47 100644 --- a/packages_generated/iam/src/v1alpha1/api.gen.ts +++ b/packages_generated/iam/src/v1alpha1/api.gen.ts @@ -39,6 +39,7 @@ import { marshalValidateUserMFAOTPRequest, unmarshalAPIKey, unmarshalApplication, + unmarshalCreateScimTokenResponse, unmarshalEncodedJWT, unmarshalGetUserConnectionsResponse, unmarshalGroup, @@ -56,6 +57,7 @@ import { unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListSamlCertificatesResponse, + unmarshalListScimTokensResponse, unmarshalListUsersResponse, unmarshalLog, unmarshalMFAOTP, @@ -67,6 +69,7 @@ import { unmarshalSSHKey, unmarshalSaml, unmarshalSamlCertificate, + unmarshalScim, unmarshalSetRulesResponse, unmarshalUser, unmarshalValidateUserMFAOTPResponse, @@ -84,6 +87,8 @@ import type { CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, + CreateScimTokenRequest, + CreateScimTokenResponse, CreateUserMFAOTPRequest, CreateUserRequest, DeleteAPIKeyRequest, @@ -94,9 +99,12 @@ import type { DeleteSSHKeyRequest, DeleteSamlCertificateRequest, DeleteSamlRequest, + DeleteScimRequest, + DeleteScimTokenRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, EnableOrganizationSamlRequest, + EnableOrganizationScimRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, @@ -141,6 +149,8 @@ import type { ListSSHKeysResponse, ListSamlCertificatesRequest, ListSamlCertificatesResponse, + ListScimTokensRequest, + ListScimTokensResponse, ListUsersRequest, ListUsersResponse, LockUserRequest, @@ -157,6 +167,7 @@ import type { SSHKey, Saml, SamlCertificate, + Scim, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, @@ -1548,4 +1559,58 @@ export class API extends ParentAPI { method: 'DELETE', path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`, }) + + enableOrganizationScim = ( + request: Readonly = {}, + ) => + this.client.fetch( + { + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`, + }, + unmarshalScim, + ) + + deleteScim = (request: Readonly) => + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}`, + }) + + protected pageOfListScimTokens = (request: Readonly) => + this.client.fetch( + { + method: 'GET', + path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}/tokens`, + urlParams: urlParams( + ['order_by', request.orderBy], + ['page', request.page], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ), + }, + unmarshalListScimTokensResponse, + ) + + listScimTokens = (request: Readonly) => + enrichForPagination('scimTokens', this.pageOfListScimTokens, request) + + createScimToken = (request: Readonly) => + this.client.fetch( + { + method: 'POST', + path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}/tokens`, + }, + unmarshalCreateScimTokenResponse, + ) + + deleteScimToken = (request: Readonly) => + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/scim-tokens/${validatePathParam('tokenId', request.tokenId)}`, + }) } diff --git a/packages_generated/iam/src/v1alpha1/index.gen.ts b/packages_generated/iam/src/v1alpha1/index.gen.ts index 417969aa9..6038f2c5e 100644 --- a/packages_generated/iam/src/v1alpha1/index.gen.ts +++ b/packages_generated/iam/src/v1alpha1/index.gen.ts @@ -19,6 +19,8 @@ export type { CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, + CreateScimTokenRequest, + CreateScimTokenResponse, CreateUserMFAOTPRequest, CreateUserRequest, CreateUserRequestMember, @@ -30,9 +32,12 @@ export type { DeleteSSHKeyRequest, DeleteSamlCertificateRequest, DeleteSamlRequest, + DeleteScimRequest, + DeleteScimTokenRequest, DeleteUserMFAOTPRequest, DeleteUserRequest, EnableOrganizationSamlRequest, + EnableOrganizationScimRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, @@ -88,6 +93,9 @@ export type { ListSSHKeysResponse, ListSamlCertificatesRequest, ListSamlCertificatesResponse, + ListScimTokensRequest, + ListScimTokensRequestOrderBy, + ListScimTokensResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, @@ -117,6 +125,8 @@ export type { SamlCertificateType, SamlServiceProvider, SamlStatus, + Scim, + ScimToken, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, diff --git a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts index 1e8121535..df51222ea 100644 --- a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts @@ -24,6 +24,7 @@ import type { CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, + CreateScimTokenResponse, CreateUserRequest, CreateUserRequestMember, EncodedJWT, @@ -45,6 +46,7 @@ import type { ListRulesResponse, ListSSHKeysResponse, ListSamlCertificatesResponse, + ListScimTokensResponse, ListUsersResponse, Log, MFAOTP, @@ -64,6 +66,8 @@ import type { Saml, SamlCertificate, SamlServiceProvider, + Scim, + ScimToken, SetGroupMembersRequest, SetOrganizationAliasRequest, SetRulesRequest, @@ -321,6 +325,36 @@ export const unmarshalUser = (data: unknown): User => { } as User } +const unmarshalScimToken = (data: unknown): ScimToken => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ScimToken' failed as data isn't a dictionary.`, + ) + } + + return { + createdAt: unmarshalDate(data.created_at), + expiresAt: unmarshalDate(data.expires_at), + id: data.id, + scimId: data.scim_id, + } as ScimToken +} + +export const unmarshalCreateScimTokenResponse = ( + data: unknown, +): CreateScimTokenResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateScimTokenResponse' failed as data isn't a dictionary.`, + ) + } + + return { + bearerToken: data.bearer_token, + token: data.token ? unmarshalScimToken(data.token) : undefined, + } as CreateScimTokenResponse +} + export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => { if (!isJSONObject(data)) { throw new TypeError( @@ -644,6 +678,21 @@ export const unmarshalListSamlCertificatesResponse = ( } as ListSamlCertificatesResponse } +export const unmarshalListScimTokensResponse = ( + data: unknown, +): ListScimTokensResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListScimTokensResponse' failed as data isn't a dictionary.`, + ) + } + + return { + scimTokens: unmarshalArrayOfObject(data.scim_tokens, unmarshalScimToken), + totalCount: data.total_count, + } as ListScimTokensResponse +} + export const unmarshalListUsersResponse = ( data: unknown, ): ListUsersResponse => { @@ -754,6 +803,19 @@ export const unmarshalSaml = (data: unknown): Saml => { } as Saml } +export const unmarshalScim = (data: unknown): Scim => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Scim' failed as data isn't a dictionary.`, + ) + } + + return { + createdAt: unmarshalDate(data.created_at), + id: data.id, + } as Scim +} + export const unmarshalSetRulesResponse = (data: unknown): SetRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( diff --git a/packages_generated/iam/src/v1alpha1/types.gen.ts b/packages_generated/iam/src/v1alpha1/types.gen.ts index 55a476027..ac46be38c 100644 --- a/packages_generated/iam/src/v1alpha1/types.gen.ts +++ b/packages_generated/iam/src/v1alpha1/types.gen.ts @@ -65,6 +65,8 @@ export type ListSSHKeysRequestOrderBy = | 'name_asc' | 'name_desc' +export type ListScimTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' + export type ListUsersRequestOrderBy = | 'created_at_asc' | 'created_at_desc' @@ -219,6 +221,13 @@ export interface RuleSpecs { organizationId?: string } +export interface ScimToken { + id: string + scimId: string + createdAt?: Date + expiresAt?: Date +} + export interface CreateUserRequestMember { /** * Email of the user to create. @@ -995,6 +1004,24 @@ export type CreateSSHKeyRequest = { projectId?: string } +export type CreateScimTokenRequest = { + /** + * ID of the SCIM configuration. + */ + scimId: string +} + +export interface CreateScimTokenResponse { + /** + * The SCIM token metadata. + */ + token?: ScimToken + /** + * The Bearer Token to use to authenticate to SCIM endpoints. + */ + bearerToken: string +} + export type CreateUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -1078,6 +1105,20 @@ export type DeleteSamlRequest = { samlId: string } +export type DeleteScimRequest = { + /** + * ID of the SCIM configuration. + */ + scimId: string +} + +export type DeleteScimTokenRequest = { + /** + * The SCIM token ID. + */ + tokenId: string +} + export type DeleteUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -1099,6 +1140,13 @@ export type EnableOrganizationSamlRequest = { organizationId?: string } +export type EnableOrganizationScimRequest = { + /** + * ID of the Organization. + */ + organizationId?: string +} + export interface EncodedJWT { /** * The renewed JWT. @@ -1707,6 +1755,36 @@ export interface ListSamlCertificatesResponse { certificates: SamlCertificate[] } +export type ListScimTokensRequest = { + /** + * ID of the SCIM configuration. + */ + scimId: string + /** + * Sort order of SCIM tokens. + */ + orderBy?: ListScimTokensRequestOrderBy + /** + * Requested page number. Value must be greater or equal to 1. + */ + page?: number + /** + * Number of items per page. Value must be between 1 and 100. + */ + pageSize?: number +} + +export interface ListScimTokensResponse { + /** + * List of SCIM tokens. + */ + scimTokens: ScimToken[] + /** + * Total count of SCIM tokens. + */ + totalCount: number +} + export type ListUsersRequest = { /** * Criteria for sorting results. @@ -1881,6 +1959,17 @@ export interface Saml { singleSignOnUrl: string } +export interface Scim { + /** + * ID of the SCIM configuration. + */ + id: string + /** + * Date and time of SCIM configuration creation. + */ + createdAt?: Date +} + export type SetGroupMembersRequest = { groupId: string userIds: string[] diff --git a/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts b/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts index 0591240d1..bc954ec1f 100644 --- a/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/iam/src/v1alpha1/validation-rules.gen.ts @@ -219,6 +219,17 @@ export const ListSSHKeysRequest = { }, } +export const ListScimTokensRequest = { + page: { + greaterThanOrEqual: 1, + lessThanOrEqual: 10000, + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100, + }, +} + export const ListUsersRequest = { page: { greaterThanOrEqual: 1,