Skip to content

Commit 577e9b1

Browse files
committed
feat: update generated APIs
1 parent 225c182 commit 577e9b1

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

packages/clients/src/api/iam/v1alpha1/api.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
unmarshalAPIKey,
3434
unmarshalApplication,
3535
unmarshalEncodedJWT,
36+
unmarshalGetUserConnectionsResponse,
3637
unmarshalGroup,
3738
unmarshalJWT,
3839
unmarshalListAPIKeysResponse,
@@ -89,6 +90,8 @@ import type {
8990
GetPolicyRequest,
9091
GetQuotumRequest,
9192
GetSSHKeyRequest,
93+
GetUserConnectionsRequest,
94+
GetUserConnectionsResponse,
9295
GetUserRequest,
9396
Group,
9497
JWT,
@@ -509,6 +512,15 @@ export class API extends ParentAPI {
509512
unmarshalListGracePeriodsResponse,
510513
)
511514

515+
getUserConnections = (request: Readonly<GetUserConnectionsRequest>) =>
516+
this.client.fetch<GetUserConnectionsResponse>(
517+
{
518+
method: 'GET',
519+
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/connections`,
520+
},
521+
unmarshalGetUserConnectionsResponse,
522+
)
523+
512524
protected pageOfListApplications = (
513525
request: Readonly<ListApplicationsRequest> = {},
514526
) =>

packages/clients/src/api/iam/v1alpha1/index.gen.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export type {
3535
GetPolicyRequest,
3636
GetQuotumRequest,
3737
GetSSHKeyRequest,
38+
GetUserConnectionsRequest,
39+
GetUserConnectionsResponse,
40+
GetUserConnectionsResponseConnection,
41+
GetUserConnectionsResponseConnectionConnectedOrganization,
42+
GetUserConnectionsResponseConnectionConnectedUser,
3843
GetUserRequest,
3944
GracePeriod,
4045
GracePeriodType,

packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import type {
2222
CreateUserRequest,
2323
CreateUserRequestMember,
2424
EncodedJWT,
25+
GetUserConnectionsResponse,
26+
GetUserConnectionsResponseConnection,
27+
GetUserConnectionsResponseConnectionConnectedOrganization,
28+
GetUserConnectionsResponseConnectionConnectedUser,
2529
GracePeriod,
2630
Group,
2731
JWT,
@@ -296,6 +300,76 @@ export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => {
296300
} as EncodedJWT
297301
}
298302

303+
const unmarshalGetUserConnectionsResponseConnectionConnectedOrganization = (
304+
data: unknown,
305+
): GetUserConnectionsResponseConnectionConnectedOrganization => {
306+
if (!isJSONObject(data)) {
307+
throw new TypeError(
308+
`Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary.`,
309+
)
310+
}
311+
312+
return {
313+
id: data.id,
314+
locked: data.locked,
315+
name: data.name,
316+
} as GetUserConnectionsResponseConnectionConnectedOrganization
317+
}
318+
319+
const unmarshalGetUserConnectionsResponseConnectionConnectedUser = (
320+
data: unknown,
321+
): GetUserConnectionsResponseConnectionConnectedUser => {
322+
if (!isJSONObject(data)) {
323+
throw new TypeError(
324+
`Unmarshalling the type 'GetUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary.`,
325+
)
326+
}
327+
328+
return {
329+
id: data.id,
330+
type: data.type,
331+
username: data.username,
332+
} as GetUserConnectionsResponseConnectionConnectedUser
333+
}
334+
335+
const unmarshalGetUserConnectionsResponseConnection = (
336+
data: unknown,
337+
): GetUserConnectionsResponseConnection => {
338+
if (!isJSONObject(data)) {
339+
throw new TypeError(
340+
`Unmarshalling the type 'GetUserConnectionsResponseConnection' failed as data isn't a dictionary.`,
341+
)
342+
}
343+
344+
return {
345+
organization: data.organization
346+
? unmarshalGetUserConnectionsResponseConnectionConnectedOrganization(
347+
data.organization,
348+
)
349+
: undefined,
350+
user: data.user
351+
? unmarshalGetUserConnectionsResponseConnectionConnectedUser(data.user)
352+
: undefined,
353+
} as GetUserConnectionsResponseConnection
354+
}
355+
356+
export const unmarshalGetUserConnectionsResponse = (
357+
data: unknown,
358+
): GetUserConnectionsResponse => {
359+
if (!isJSONObject(data)) {
360+
throw new TypeError(
361+
`Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary.`,
362+
)
363+
}
364+
365+
return {
366+
connections: unmarshalArrayOfObject(
367+
data.connections,
368+
unmarshalGetUserConnectionsResponseConnection,
369+
),
370+
} as GetUserConnectionsResponse
371+
}
372+
299373
export const unmarshalListAPIKeysResponse = (
300374
data: unknown,
301375
): ListAPIKeysResponse => {

packages/clients/src/api/iam/v1alpha1/types.gen.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated'
9999

100100
export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member'
101101

102+
export interface GetUserConnectionsResponseConnectionConnectedOrganization {
103+
id: string
104+
name: string
105+
locked: boolean
106+
}
107+
108+
export interface GetUserConnectionsResponseConnectionConnectedUser {
109+
id: string
110+
username: string
111+
type: UserType
112+
}
113+
102114
export interface QuotumLimit {
103115
/**
104116
* Whether or not the limit is applied globally.
@@ -191,6 +203,13 @@ export interface CreateUserRequestMember {
191203
password: string
192204
}
193205

206+
export interface GetUserConnectionsResponseConnection {
207+
/** Information about the connected organization. */
208+
organization?: GetUserConnectionsResponseConnectionConnectedOrganization
209+
/** Information about the connected user. */
210+
user?: GetUserConnectionsResponseConnectionConnectedUser
211+
}
212+
194213
export interface APIKey {
195214
/** Access key of the API key. */
196215
accessKey: string
@@ -751,6 +770,16 @@ export type GetSSHKeyRequest = {
751770
sshKeyId: string
752771
}
753772

773+
export type GetUserConnectionsRequest = {
774+
/** ID of the user to list connections for. */
775+
userId: string
776+
}
777+
778+
export interface GetUserConnectionsResponse {
779+
/** List of connections. */
780+
connections: GetUserConnectionsResponseConnection[]
781+
}
782+
754783
export type GetUserRequest = {
755784
/** ID of the user to find. */
756785
userId: string

0 commit comments

Comments
 (0)