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
65 changes: 65 additions & 0 deletions packages_generated/iam/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
marshalValidateUserMFAOTPRequest,
unmarshalAPIKey,
unmarshalApplication,
unmarshalCreateScimTokenResponse,
unmarshalEncodedJWT,
unmarshalGetUserConnectionsResponse,
unmarshalGroup,
Expand All @@ -56,6 +57,7 @@ import {
unmarshalListRulesResponse,
unmarshalListSSHKeysResponse,
unmarshalListSamlCertificatesResponse,
unmarshalListScimTokensResponse,
unmarshalListUsersResponse,
unmarshalLog,
unmarshalMFAOTP,
Expand All @@ -67,6 +69,7 @@ import {
unmarshalSSHKey,
unmarshalSaml,
unmarshalSamlCertificate,
unmarshalScim,
unmarshalSetRulesResponse,
unmarshalUser,
unmarshalValidateUserMFAOTPResponse,
Expand All @@ -84,6 +87,8 @@ import type {
CreateJWTRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateScimTokenRequest,
CreateScimTokenResponse,
CreateUserMFAOTPRequest,
CreateUserRequest,
DeleteAPIKeyRequest,
Expand All @@ -94,9 +99,12 @@ import type {
DeleteSSHKeyRequest,
DeleteSamlCertificateRequest,
DeleteSamlRequest,
DeleteScimRequest,
DeleteScimTokenRequest,
DeleteUserMFAOTPRequest,
DeleteUserRequest,
EnableOrganizationSamlRequest,
EnableOrganizationScimRequest,
EncodedJWT,
GetAPIKeyRequest,
GetApplicationRequest,
Expand Down Expand Up @@ -141,6 +149,8 @@ import type {
ListSSHKeysResponse,
ListSamlCertificatesRequest,
ListSamlCertificatesResponse,
ListScimTokensRequest,
ListScimTokensResponse,
ListUsersRequest,
ListUsersResponse,
LockUserRequest,
Expand All @@ -157,6 +167,7 @@ import type {
SSHKey,
Saml,
SamlCertificate,
Scim,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand Down Expand Up @@ -1548,4 +1559,58 @@ export class API extends ParentAPI {
method: 'DELETE',
path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`,
})

enableOrganizationScim = (
request: Readonly<EnableOrganizationScimRequest> = {},
) =>
this.client.fetch<Scim>(
{
body: '{}',
headers: jsonContentHeaders,
method: 'POST',
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/scim`,
},
unmarshalScim,
)

deleteScim = (request: Readonly<DeleteScimRequest>) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}`,
})

protected pageOfListScimTokens = (request: Readonly<ListScimTokensRequest>) =>
this.client.fetch<ListScimTokensResponse>(
{
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<ListScimTokensRequest>) =>
enrichForPagination('scimTokens', this.pageOfListScimTokens, request)

createScimToken = (request: Readonly<CreateScimTokenRequest>) =>
this.client.fetch<CreateScimTokenResponse>(
{
method: 'POST',
path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}/tokens`,
},
unmarshalCreateScimTokenResponse,
)

deleteScimToken = (request: Readonly<DeleteScimTokenRequest>) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/iam/v1alpha1/scim-tokens/${validatePathParam('tokenId', request.tokenId)}`,
})
}
10 changes: 10 additions & 0 deletions packages_generated/iam/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export type {
CreateJWTRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateScimTokenRequest,
CreateScimTokenResponse,
CreateUserMFAOTPRequest,
CreateUserRequest,
CreateUserRequestMember,
Expand All @@ -30,9 +32,12 @@ export type {
DeleteSSHKeyRequest,
DeleteSamlCertificateRequest,
DeleteSamlRequest,
DeleteScimRequest,
DeleteScimTokenRequest,
DeleteUserMFAOTPRequest,
DeleteUserRequest,
EnableOrganizationSamlRequest,
EnableOrganizationScimRequest,
EncodedJWT,
GetAPIKeyRequest,
GetApplicationRequest,
Expand Down Expand Up @@ -88,6 +93,9 @@ export type {
ListSSHKeysResponse,
ListSamlCertificatesRequest,
ListSamlCertificatesResponse,
ListScimTokensRequest,
ListScimTokensRequestOrderBy,
ListScimTokensResponse,
ListUsersRequest,
ListUsersRequestOrderBy,
ListUsersResponse,
Expand Down Expand Up @@ -117,6 +125,8 @@ export type {
SamlCertificateType,
SamlServiceProvider,
SamlStatus,
Scim,
ScimToken,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand Down
62 changes: 62 additions & 0 deletions packages_generated/iam/src/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
CreateJWTRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateScimTokenResponse,
CreateUserRequest,
CreateUserRequestMember,
EncodedJWT,
Expand All @@ -45,6 +46,7 @@ import type {
ListRulesResponse,
ListSSHKeysResponse,
ListSamlCertificatesResponse,
ListScimTokensResponse,
ListUsersResponse,
Log,
MFAOTP,
Expand All @@ -64,6 +66,8 @@ import type {
Saml,
SamlCertificate,
SamlServiceProvider,
Scim,
ScimToken,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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(
Expand Down
Loading
Loading