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
39 changes: 39 additions & 0 deletions packages_generated/iam/src/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
marshalRemoveGroupMemberRequest,
marshalRemoveUserConnectionRequest,
marshalSetGroupMembersRequest,
marshalSetOrganizationAliasRequest,
marshalSetRulesRequest,
marshalUpdateAPIKeyRequest,
marshalUpdateApplicationRequest,
Expand Down Expand Up @@ -53,6 +54,7 @@ import {
unmarshalListUsersResponse,
unmarshalLog,
unmarshalMFAOTP,
unmarshalOrganization,
unmarshalOrganizationSecuritySettings,
unmarshalPolicy,
unmarshalQuotum,
Expand Down Expand Up @@ -89,6 +91,7 @@ import type {
GetGroupRequest,
GetJWTRequest,
GetLogRequest,
GetOrganizationRequest,
GetOrganizationSecuritySettingsRequest,
GetPolicyRequest,
GetQuotumRequest,
Expand Down Expand Up @@ -129,13 +132,15 @@ import type {
Log,
MFAOTP,
MigrateOrganizationGuestsRequest,
Organization,
OrganizationSecuritySettings,
Policy,
Quotum,
RemoveGroupMemberRequest,
RemoveUserConnectionRequest,
SSHKey,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
SetRulesResponse,
UnlockUserRequest,
Expand Down Expand Up @@ -1338,6 +1343,40 @@ export class API extends ParentAPI {
unmarshalOrganizationSecuritySettings,
)

/**
* Set your Organization's alias.. This will fail if an alias has already been defined. Please contact support if you need to change your Organization's alias.
*
* @param request - The request {@link SetOrganizationAliasRequest}
* @returns A Promise of Organization
*/
setOrganizationAlias = (request: Readonly<SetOrganizationAliasRequest>) =>
this.client.fetch<Organization>(
{
body: JSON.stringify(
marshalSetOrganizationAliasRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'PUT',
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}/alias`,
},
unmarshalOrganization,
)

/**
* Get your Organization's IAM information.
*
* @param request - The request {@link GetOrganizationRequest}
* @returns A Promise of Organization
*/
getOrganization = (request: Readonly<GetOrganizationRequest> = {}) =>
this.client.fetch<Organization>(
{
method: 'GET',
path: `/iam/v1alpha1/organizations/${validatePathParam('organizationId', request.organizationId ?? this.client.settings.defaultOrganizationId)}`,
},
unmarshalOrganization,
)

/**
* Migrate the organization's guests to IAM members.
*
Expand Down
3 changes: 3 additions & 0 deletions packages_generated/iam/src/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type {
GetGroupRequest,
GetJWTRequest,
GetLogRequest,
GetOrganizationRequest,
GetOrganizationSecuritySettingsRequest,
GetPolicyRequest,
GetQuotumRequest,
Expand Down Expand Up @@ -90,6 +91,7 @@ export type {
LogResourceType,
MFAOTP,
MigrateOrganizationGuestsRequest,
Organization,
OrganizationSecuritySettings,
PermissionSet,
PermissionSetScopeType,
Expand All @@ -102,6 +104,7 @@ export type {
RuleSpecs,
SSHKey,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
SetRulesResponse,
UnlockUserRequest,
Expand Down
23 changes: 23 additions & 0 deletions packages_generated/iam/src/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import type {
ListUsersResponse,
Log,
MFAOTP,
Organization,
OrganizationSecuritySettings,
PermissionSet,
Policy,
Expand All @@ -56,6 +57,7 @@ import type {
RuleSpecs,
SSHKey,
SetGroupMembersRequest,
SetOrganizationAliasRequest,
SetRulesRequest,
SetRulesResponse,
UpdateAPIKeyRequest,
Expand Down Expand Up @@ -626,6 +628,20 @@ export const unmarshalMFAOTP = (data: unknown): MFAOTP => {
} as MFAOTP
}

export const unmarshalOrganization = (data: unknown): Organization => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`,
)
}

return {
alias: data.alias,
id: data.id,
name: data.name,
} as Organization
}

export const unmarshalOrganizationSecuritySettings = (
data: unknown,
): OrganizationSecuritySettings => {
Expand Down Expand Up @@ -833,6 +849,13 @@ export const marshalSetGroupMembersRequest = (
user_ids: request.userIds,
})

export const marshalSetOrganizationAliasRequest = (
request: SetOrganizationAliasRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
alias: request.alias,
})

export const marshalSetRulesRequest = (
request: SetRulesRequest,
defaults: DefaultValues,
Expand Down
33 changes: 33 additions & 0 deletions packages_generated/iam/src/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,13 @@ export type GetLogRequest = {
logId: string
}

export type GetOrganizationRequest = {
/**
* ID of the Organization.
*/
organizationId?: string
}

export type GetOrganizationSecuritySettingsRequest = {
/**
* ID of the Organization.
Expand Down Expand Up @@ -1662,6 +1669,21 @@ export type MigrateOrganizationGuestsRequest = {
organizationId?: string
}

export interface Organization {
/**
* ID of the Organization.
*/
id: string
/**
* Name of the Organization.
*/
name: string
/**
* Alias of the Organization.
*/
alias: string
}

export interface OrganizationSecuritySettings {
/**
* Defines whether password renewal is enforced during first login.
Expand Down Expand Up @@ -1713,6 +1735,17 @@ export type SetGroupMembersRequest = {
applicationIds: string[]
}

export type SetOrganizationAliasRequest = {
/**
* ID of the Organization.
*/
organizationId?: string
/**
* Alias of the Organization.
*/
alias: string
}

export type SetRulesRequest = {
/**
* Id of policy to update.
Expand Down
8 changes: 8 additions & 0 deletions packages_generated/iam/src/v1alpha1/validation-rules.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ export const RuleSpecs = {
},
}

export const SetOrganizationAliasRequest = {
alias: {
maxLength: 32,
minLength: 2,
pattern: /^[a-z0-9]+$/,
},
}

export const UpdateAPIKeyRequest = {
description: {
maxLength: 200,
Expand Down
Loading