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
61 changes: 19 additions & 42 deletions packages_generated/iam/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
marshalCreateApplicationRequest,
marshalCreateGroupRequest,
marshalCreateJWTRequest,
marshalCreateOrganizationSamlRequest,
marshalCreatePolicyRequest,
marshalCreateSSHKeyRequest,
marshalCreateUserRequest,
Expand All @@ -28,9 +27,9 @@ import {
marshalUpdateAPIKeyRequest,
marshalUpdateApplicationRequest,
marshalUpdateGroupRequest,
marshalUpdateOrganizationSamlRequest,
marshalUpdateOrganizationSecuritySettingsRequest,
marshalUpdatePolicyRequest,
marshalUpdateSamlRequest,
marshalUpdateSSHKeyRequest,
marshalUpdateUserPasswordRequest,
marshalUpdateUserRequest,
Expand Down Expand Up @@ -64,7 +63,6 @@ import {
unmarshalQuotum,
unmarshalSaml,
unmarshalSamlCertificate,
unmarshalSamlInformation,
unmarshalSetRulesResponse,
unmarshalSSHKey,
unmarshalUser,
Expand All @@ -81,7 +79,6 @@ import type {
CreateApplicationRequest,
CreateGroupRequest,
CreateJWTRequest,
CreateOrganizationSamlRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateUserMFAOTPRequest,
Expand All @@ -90,12 +87,13 @@ import type {
DeleteApplicationRequest,
DeleteGroupRequest,
DeleteJWTRequest,
DeleteOrganizationSamlRequest,
DeletePolicyRequest,
DeleteSamlCertificateRequest,
DeleteSamlRequest,
DeleteSSHKeyRequest,
DeleteUserMFAOTPRequest,
DeleteUserRequest,
EnableOrganizationSamlRequest,
EncodedJWT,
GetAPIKeyRequest,
GetApplicationRequest,
Expand All @@ -107,7 +105,6 @@ import type {
GetOrganizationSecuritySettingsRequest,
GetPolicyRequest,
GetQuotumRequest,
GetSamlInformationRequest,
GetSSHKeyRequest,
GetUserConnectionsRequest,
GetUserConnectionsResponse,
Expand Down Expand Up @@ -155,7 +152,6 @@ import type {
RemoveUserConnectionRequest,
Saml,
SamlCertificate,
SamlInformation,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand All @@ -165,9 +161,9 @@ import type {
UpdateAPIKeyRequest,
UpdateApplicationRequest,
UpdateGroupRequest,
UpdateOrganizationSamlRequest,
UpdateOrganizationSecuritySettingsRequest,
UpdatePolicyRequest,
UpdateSamlRequest,
UpdateSSHKeyRequest,
UpdateUserPasswordRequest,
UpdateUserRequest,
Expand Down Expand Up @@ -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<CreateOrganizationSamlRequest>) =>
enableOrganizationSaml = (
request: Readonly<EnableOrganizationSamlRequest> = {},
) =>
this.client.fetch<Saml>(
{
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`,
Expand All @@ -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<UpdateOrganizationSamlRequest> = {},
) =>
updateSaml = (request: Readonly<UpdateSamlRequest>) =>
this.client.fetch<Saml>(
{
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<DeleteOrganizationSamlRequest> = {},
) =>
deleteSaml = (request: Readonly<DeleteSamlRequest>) =>
this.client.fetch<void>({
method: 'DELETE',
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/saml`,
path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}`,
})

/**
Expand Down Expand Up @@ -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<GetSamlInformationRequest> = {}) =>
this.client.fetch<SamlInformation>(
{
method: 'GET',
path: `/iam/v1alpha1/saml-information`,
},
unmarshalSamlInformation,
)
}
10 changes: 5 additions & 5 deletions packages_generated/iam/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type {
CreateApplicationRequest,
CreateGroupRequest,
CreateJWTRequest,
CreateOrganizationSamlRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateUserMFAOTPRequest,
Expand All @@ -27,12 +26,13 @@ export type {
DeleteApplicationRequest,
DeleteGroupRequest,
DeleteJWTRequest,
DeleteOrganizationSamlRequest,
DeletePolicyRequest,
DeleteSamlCertificateRequest,
DeleteSamlRequest,
DeleteSSHKeyRequest,
DeleteUserMFAOTPRequest,
DeleteUserRequest,
EnableOrganizationSamlRequest,
EncodedJWT,
GetAPIKeyRequest,
GetApplicationRequest,
Expand All @@ -44,7 +44,6 @@ export type {
GetOrganizationSecuritySettingsRequest,
GetPolicyRequest,
GetQuotumRequest,
GetSamlInformationRequest,
GetSSHKeyRequest,
GetUserConnectionsRequest,
GetUserConnectionsResponse,
Expand Down Expand Up @@ -114,7 +113,8 @@ export type {
SamlCertificate,
SamlCertificateOrigin,
SamlCertificateType,
SamlInformation,
SamlServiceProvider,
SamlStatus,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand All @@ -124,9 +124,9 @@ export type {
UpdateAPIKeyRequest,
UpdateApplicationRequest,
UpdateGroupRequest,
UpdateOrganizationSamlRequest,
UpdateOrganizationSecuritySettingsRequest,
UpdatePolicyRequest,
UpdateSamlRequest,
UpdateSSHKeyRequest,
UpdateUserPasswordRequest,
UpdateUserRequest,
Expand Down
51 changes: 23 additions & 28 deletions packages_generated/iam/src/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type {
CreateApplicationRequest,
CreateGroupRequest,
CreateJWTRequest,
CreateOrganizationSamlRequest,
CreatePolicyRequest,
CreateSSHKeyRequest,
CreateUserRequest,
Expand Down Expand Up @@ -60,7 +59,7 @@ import type {
RuleSpecs,
Saml,
SamlCertificate,
SamlInformation,
SamlServiceProvider,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
Expand All @@ -69,9 +68,9 @@ import type {
UpdateAPIKeyRequest,
UpdateApplicationRequest,
UpdateGroupRequest,
UpdateOrganizationSamlRequest,
UpdateOrganizationSecuritySettingsRequest,
UpdatePolicyRequest,
UpdateSamlRequest,
UpdateSSHKeyRequest,
UpdateUserPasswordRequest,
UpdateUserRequest,
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -818,14 +821,6 @@ export const marshalCreateJWTRequest = (
user_id: request.userId,
})

export const marshalCreateOrganizationSamlRequest = (
request: CreateOrganizationSamlRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
entity_id: request.entityId,
single_sign_on_url: request.singleSignOnUrl,
})

const marshalRuleSpecs = (
request: RuleSpecs,
defaults: DefaultValues,
Expand Down Expand Up @@ -973,14 +968,6 @@ export const marshalUpdateGroupRequest = (
tags: request.tags,
})

export const marshalUpdateOrganizationSamlRequest = (
request: UpdateOrganizationSamlRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
entity_id: request.entityId,
single_sign_on_url: request.singleSignOnUrl,
})

export const marshalUpdateOrganizationSecuritySettingsRequest = (
request: UpdateOrganizationSecuritySettingsRequest,
defaults: DefaultValues,
Expand Down Expand Up @@ -1013,6 +1000,14 @@ export const marshalUpdateSSHKeyRequest = (
name: request.name,
})

export const marshalUpdateSamlRequest = (
request: UpdateSamlRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
entity_id: request.entityId,
single_sign_on_url: request.singleSignOnUrl,
})

export const marshalUpdateUserPasswordRequest = (
request: UpdateUserPasswordRequest,
defaults: DefaultValues,
Expand Down
Loading
Loading