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
12 changes: 12 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
unmarshalListQuotaResponse,
unmarshalListRulesResponse,
unmarshalListSSHKeysResponse,
unmarshalListUserConnectionsResponse,
unmarshalListUsersResponse,
unmarshalLog,
unmarshalMFAOTP,
Expand Down Expand Up @@ -114,6 +115,8 @@ import type {
ListRulesResponse,
ListSSHKeysRequest,
ListSSHKeysResponse,
ListUserConnectionsRequest,
ListUserConnectionsResponse,
ListUsersRequest,
ListUsersResponse,
LockUserRequest,
Expand Down Expand Up @@ -509,6 +512,15 @@ export class API extends ParentAPI {
unmarshalListGracePeriodsResponse,
)

listUserConnections = (request: Readonly<ListUserConnectionsRequest>) =>
this.client.fetch<ListUserConnectionsResponse>(
{
method: 'GET',
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/connections`,
},
unmarshalListUserConnectionsResponse,
)

protected pageOfListApplications = (
request: Readonly<ListApplicationsRequest> = {},
) =>
Expand Down
5 changes: 5 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export type {
ListSSHKeysRequest,
ListSSHKeysRequestOrderBy,
ListSSHKeysResponse,
ListUserConnectionsRequest,
ListUserConnectionsResponse,
ListUserConnectionsResponseConnection,
ListUserConnectionsResponseConnectionConnectedOrganization,
ListUserConnectionsResponseConnectionConnectedUser,
ListUsersRequest,
ListUsersRequestOrderBy,
ListUsersResponse,
Expand Down
74 changes: 74 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import type {
ListQuotaResponse,
ListRulesResponse,
ListSSHKeysResponse,
ListUserConnectionsResponse,
ListUserConnectionsResponseConnection,
ListUserConnectionsResponseConnectionConnectedOrganization,
ListUserConnectionsResponseConnectionConnectedUser,
ListUsersResponse,
Log,
MFAOTP,
Expand Down Expand Up @@ -513,6 +517,76 @@ 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 => {
Expand Down
29 changes: 29 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ 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
Expand Down Expand Up @@ -463,6 +475,13 @@ 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
Expand Down Expand Up @@ -1022,6 +1041,16 @@ 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
Expand Down
Loading