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: 6 additions & 6 deletions packages/clients/src/api/iam/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
unmarshalAPIKey,
unmarshalApplication,
unmarshalEncodedJWT,
unmarshalGetUserConnectionsResponse,
unmarshalGroup,
unmarshalJWT,
unmarshalListAPIKeysResponse,
Expand All @@ -46,7 +47,6 @@ import {
unmarshalListQuotaResponse,
unmarshalListRulesResponse,
unmarshalListSSHKeysResponse,
unmarshalListUserConnectionsResponse,
unmarshalListUsersResponse,
unmarshalLog,
unmarshalMFAOTP,
Expand Down Expand Up @@ -90,6 +90,8 @@ import type {
GetPolicyRequest,
GetQuotumRequest,
GetSSHKeyRequest,
GetUserConnectionsRequest,
GetUserConnectionsResponse,
GetUserRequest,
Group,
JWT,
Expand All @@ -115,8 +117,6 @@ import type {
ListRulesResponse,
ListSSHKeysRequest,
ListSSHKeysResponse,
ListUserConnectionsRequest,
ListUserConnectionsResponse,
ListUsersRequest,
ListUsersResponse,
LockUserRequest,
Expand Down Expand Up @@ -512,13 +512,13 @@ export class API extends ParentAPI {
unmarshalListGracePeriodsResponse,
)

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

protected pageOfListApplications = (
Expand Down
10 changes: 5 additions & 5 deletions packages/clients/src/api/iam/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export type {
GetPolicyRequest,
GetQuotumRequest,
GetSSHKeyRequest,
GetUserConnectionsRequest,
GetUserConnectionsResponse,
GetUserConnectionsResponseConnection,
GetUserConnectionsResponseConnectionConnectedOrganization,
GetUserConnectionsResponseConnectionConnectedUser,
GetUserRequest,
GracePeriod,
GracePeriodType,
Expand Down Expand Up @@ -71,11 +76,6 @@ export type {
ListSSHKeysRequest,
ListSSHKeysRequestOrderBy,
ListSSHKeysResponse,
ListUserConnectionsRequest,
ListUserConnectionsResponse,
ListUserConnectionsResponseConnection,
ListUserConnectionsResponseConnectionConnectedOrganization,
ListUserConnectionsResponseConnectionConnectedUser,
ListUsersRequest,
ListUsersRequestOrderBy,
ListUsersResponse,
Expand Down
148 changes: 74 additions & 74 deletions packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import type {
CreateUserRequest,
CreateUserRequestMember,
EncodedJWT,
GetUserConnectionsResponse,
GetUserConnectionsResponseConnection,
GetUserConnectionsResponseConnectionConnectedOrganization,
GetUserConnectionsResponseConnectionConnectedUser,
GracePeriod,
Group,
JWT,
Expand All @@ -36,10 +40,6 @@ import type {
ListQuotaResponse,
ListRulesResponse,
ListSSHKeysResponse,
ListUserConnectionsResponse,
ListUserConnectionsResponseConnection,
ListUserConnectionsResponseConnectionConnectedOrganization,
ListUserConnectionsResponseConnectionConnectedUser,
ListUsersResponse,
Log,
MFAOTP,
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 => {
Expand Down
58 changes: 29 additions & 29 deletions packages/clients/src/api/iam/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading