diff --git a/packages/clients/src/api/iam/v1alpha1/api.gen.ts b/packages/clients/src/api/iam/v1alpha1/api.gen.ts index f82fa31d0..60376a8a4 100644 --- a/packages/clients/src/api/iam/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/api.gen.ts @@ -33,6 +33,7 @@ import { unmarshalAPIKey, unmarshalApplication, unmarshalEncodedJWT, + unmarshalGetUserConnectionsResponse, unmarshalGroup, unmarshalJWT, unmarshalListAPIKeysResponse, @@ -46,7 +47,6 @@ import { unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, - unmarshalListUserConnectionsResponse, unmarshalListUsersResponse, unmarshalLog, unmarshalMFAOTP, @@ -90,6 +90,8 @@ import type { GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, + GetUserConnectionsRequest, + GetUserConnectionsResponse, GetUserRequest, Group, JWT, @@ -115,8 +117,6 @@ import type { ListRulesResponse, ListSSHKeysRequest, ListSSHKeysResponse, - ListUserConnectionsRequest, - ListUserConnectionsResponse, ListUsersRequest, ListUsersResponse, LockUserRequest, @@ -512,13 +512,13 @@ export class API extends ParentAPI { unmarshalListGracePeriodsResponse, ) - listUserConnections = (request: Readonly) => - this.client.fetch( + getUserConnections = (request: Readonly) => + this.client.fetch( { method: 'GET', path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/connections`, }, - unmarshalListUserConnectionsResponse, + unmarshalGetUserConnectionsResponse, ) protected pageOfListApplications = ( diff --git a/packages/clients/src/api/iam/v1alpha1/index.gen.ts b/packages/clients/src/api/iam/v1alpha1/index.gen.ts index 56b026385..b985b44ca 100644 --- a/packages/clients/src/api/iam/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/index.gen.ts @@ -35,6 +35,11 @@ export type { GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, + GetUserConnectionsRequest, + GetUserConnectionsResponse, + GetUserConnectionsResponseConnection, + GetUserConnectionsResponseConnectionConnectedOrganization, + GetUserConnectionsResponseConnectionConnectedUser, GetUserRequest, GracePeriod, GracePeriodType, @@ -71,11 +76,6 @@ export type { ListSSHKeysRequest, ListSSHKeysRequestOrderBy, ListSSHKeysResponse, - ListUserConnectionsRequest, - ListUserConnectionsResponse, - ListUserConnectionsResponseConnection, - ListUserConnectionsResponseConnectionConnectedOrganization, - ListUserConnectionsResponseConnectionConnectedUser, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, diff --git a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts index 81fa27f4d..fd48b13c5 100644 --- a/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts @@ -22,6 +22,10 @@ import type { CreateUserRequest, CreateUserRequestMember, EncodedJWT, + GetUserConnectionsResponse, + GetUserConnectionsResponseConnection, + GetUserConnectionsResponseConnectionConnectedOrganization, + GetUserConnectionsResponseConnectionConnectedUser, GracePeriod, Group, JWT, @@ -36,10 +40,6 @@ import type { ListQuotaResponse, ListRulesResponse, ListSSHKeysResponse, - ListUserConnectionsResponse, - ListUserConnectionsResponseConnection, - ListUserConnectionsResponseConnectionConnectedOrganization, - ListUserConnectionsResponseConnectionConnectedUser, ListUsersResponse, Log, MFAOTP, @@ -300,6 +300,76 @@ export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => { } as EncodedJWT } +const unmarshalGetUserConnectionsResponseConnectionConnectedOrganization = ( + data: unknown, +): GetUserConnectionsResponseConnectionConnectedOrganization => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary.`, + ) + } + + return { + id: data.id, + locked: data.locked, + name: data.name, + } as GetUserConnectionsResponseConnectionConnectedOrganization +} + +const unmarshalGetUserConnectionsResponseConnectionConnectedUser = ( + data: unknown, +): GetUserConnectionsResponseConnectionConnectedUser => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary.`, + ) + } + + return { + id: data.id, + type: data.type, + username: data.username, + } as GetUserConnectionsResponseConnectionConnectedUser +} + +const unmarshalGetUserConnectionsResponseConnection = ( + data: unknown, +): GetUserConnectionsResponseConnection => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary.`, + ) + } + + return { + organization: data.organization + ? unmarshalGetUserConnectionsResponseConnectionConnectedOrganization( + data.organization, + ) + : undefined, + user: data.user + ? unmarshalGetUserConnectionsResponseConnectionConnectedUser(data.user) + : undefined, + } as GetUserConnectionsResponseConnection +} + +export const unmarshalGetUserConnectionsResponse = ( + data: unknown, +): GetUserConnectionsResponse => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary.`, + ) + } + + return { + connections: unmarshalArrayOfObject( + data.connections, + unmarshalGetUserConnectionsResponseConnection, + ), + } as GetUserConnectionsResponse +} + export const unmarshalListAPIKeysResponse = ( data: unknown, ): ListAPIKeysResponse => { @@ -517,76 +587,6 @@ export const unmarshalListSSHKeysResponse = ( } as ListSSHKeysResponse } -const unmarshalListUserConnectionsResponseConnectionConnectedOrganization = ( - data: unknown, -): ListUserConnectionsResponseConnectionConnectedOrganization => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary.`, - ) - } - - return { - id: data.id, - locked: data.locked, - name: data.name, - } as ListUserConnectionsResponseConnectionConnectedOrganization -} - -const unmarshalListUserConnectionsResponseConnectionConnectedUser = ( - data: unknown, -): ListUserConnectionsResponseConnectionConnectedUser => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary.`, - ) - } - - return { - id: data.id, - type: data.type, - username: data.username, - } as ListUserConnectionsResponseConnectionConnectedUser -} - -const unmarshalListUserConnectionsResponseConnection = ( - data: unknown, -): ListUserConnectionsResponseConnection => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListUserConnectionsResponseConnection' failed as data isn't a dictionary.`, - ) - } - - return { - organization: data.organization - ? unmarshalListUserConnectionsResponseConnectionConnectedOrganization( - data.organization, - ) - : undefined, - user: data.user - ? unmarshalListUserConnectionsResponseConnectionConnectedUser(data.user) - : undefined, - } as ListUserConnectionsResponseConnection -} - -export const unmarshalListUserConnectionsResponse = ( - data: unknown, -): ListUserConnectionsResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListUserConnectionsResponse' failed as data isn't a dictionary.`, - ) - } - - return { - connections: unmarshalArrayOfObject( - data.connections, - unmarshalListUserConnectionsResponseConnection, - ), - } as ListUserConnectionsResponse -} - export const unmarshalListUsersResponse = ( data: unknown, ): ListUsersResponse => { diff --git a/packages/clients/src/api/iam/v1alpha1/types.gen.ts b/packages/clients/src/api/iam/v1alpha1/types.gen.ts index 5315eaf29..53591809d 100644 --- a/packages/clients/src/api/iam/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/iam/v1alpha1/types.gen.ts @@ -99,6 +99,18 @@ export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated' export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member' +export interface GetUserConnectionsResponseConnectionConnectedOrganization { + id: string + name: string + locked: boolean +} + +export interface GetUserConnectionsResponseConnectionConnectedUser { + id: string + username: string + type: UserType +} + export interface QuotumLimit { /** * Whether or not the limit is applied globally. @@ -135,18 +147,6 @@ export interface QuotumLimit { unlimited?: boolean } -export interface ListUserConnectionsResponseConnectionConnectedOrganization { - id: string - name: string - locked: boolean -} - -export interface ListUserConnectionsResponseConnectionConnectedUser { - id: string - username: string - type: UserType -} - export interface JWT { /** JWT ID. */ jti: string @@ -203,6 +203,13 @@ export interface CreateUserRequestMember { password: string } +export interface GetUserConnectionsResponseConnection { + /** Information about the connected organization. */ + organization?: GetUserConnectionsResponseConnectionConnectedOrganization + /** Information about the connected user. */ + user?: GetUserConnectionsResponseConnectionConnectedUser +} + export interface APIKey { /** Access key of the API key. */ accessKey: string @@ -475,13 +482,6 @@ export interface SSHKey { disabled: boolean } -export interface ListUserConnectionsResponseConnection { - /** Information about the connected organization. */ - organization?: ListUserConnectionsResponseConnectionConnectedOrganization - /** Information about the connected user. */ - user?: ListUserConnectionsResponseConnectionConnectedUser -} - export interface User { /** ID of user. */ id: string @@ -770,6 +770,16 @@ export type GetSSHKeyRequest = { sshKeyId: string } +export type GetUserConnectionsRequest = { + /** ID of the user to list connections for. */ + userId: string +} + +export interface GetUserConnectionsResponse { + /** List of connections. */ + connections: GetUserConnectionsResponseConnection[] +} + export type GetUserRequest = { /** ID of the user to find. */ userId: string @@ -1041,16 +1051,6 @@ export interface ListSSHKeysResponse { totalCount: number } -export type ListUserConnectionsRequest = { - /** ID of the user to list connections for. */ - userId: string -} - -export interface ListUserConnectionsResponse { - /** List of connections. */ - connections: ListUserConnectionsResponseConnection[] -} - export type ListUsersRequest = { /** Criteria for sorting results. */ orderBy?: ListUsersRequestOrderBy