Skip to content

Commit 8ce2450

Browse files
scaleway-botdevtools-ci-cdremyleone
authored
fix(iam): rename ListUserConnections to GetUserConnections to be clear this isn't paginated (#1884)
Co-authored-by: devtools-ci-cd <[email protected]> Co-authored-by: Rémy Léone <[email protected]>
1 parent ece83fa commit 8ce2450

File tree

4 files changed

+114
-114
lines changed

4 files changed

+114
-114
lines changed

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

Lines changed: 6 additions & 6 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,
@@ -46,7 +47,6 @@ import {
4647
unmarshalListQuotaResponse,
4748
unmarshalListRulesResponse,
4849
unmarshalListSSHKeysResponse,
49-
unmarshalListUserConnectionsResponse,
5050
unmarshalListUsersResponse,
5151
unmarshalLog,
5252
unmarshalMFAOTP,
@@ -90,6 +90,8 @@ import type {
9090
GetPolicyRequest,
9191
GetQuotumRequest,
9292
GetSSHKeyRequest,
93+
GetUserConnectionsRequest,
94+
GetUserConnectionsResponse,
9395
GetUserRequest,
9496
Group,
9597
JWT,
@@ -115,8 +117,6 @@ import type {
115117
ListRulesResponse,
116118
ListSSHKeysRequest,
117119
ListSSHKeysResponse,
118-
ListUserConnectionsRequest,
119-
ListUserConnectionsResponse,
120120
ListUsersRequest,
121121
ListUsersResponse,
122122
LockUserRequest,
@@ -512,13 +512,13 @@ export class API extends ParentAPI {
512512
unmarshalListGracePeriodsResponse,
513513
)
514514

515-
listUserConnections = (request: Readonly<ListUserConnectionsRequest>) =>
516-
this.client.fetch<ListUserConnectionsResponse>(
515+
getUserConnections = (request: Readonly<GetUserConnectionsRequest>) =>
516+
this.client.fetch<GetUserConnectionsResponse>(
517517
{
518518
method: 'GET',
519519
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/connections`,
520520
},
521-
unmarshalListUserConnectionsResponse,
521+
unmarshalGetUserConnectionsResponse,
522522
)
523523

524524
protected pageOfListApplications = (

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

Lines changed: 5 additions & 5 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,
@@ -71,11 +76,6 @@ export type {
7176
ListSSHKeysRequest,
7277
ListSSHKeysRequestOrderBy,
7378
ListSSHKeysResponse,
74-
ListUserConnectionsRequest,
75-
ListUserConnectionsResponse,
76-
ListUserConnectionsResponseConnection,
77-
ListUserConnectionsResponseConnectionConnectedOrganization,
78-
ListUserConnectionsResponseConnectionConnectedUser,
7979
ListUsersRequest,
8080
ListUsersRequestOrderBy,
8181
ListUsersResponse,

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

Lines changed: 74 additions & 74 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,
@@ -36,10 +40,6 @@ import type {
3640
ListQuotaResponse,
3741
ListRulesResponse,
3842
ListSSHKeysResponse,
39-
ListUserConnectionsResponse,
40-
ListUserConnectionsResponseConnection,
41-
ListUserConnectionsResponseConnectionConnectedOrganization,
42-
ListUserConnectionsResponseConnectionConnectedUser,
4343
ListUsersResponse,
4444
Log,
4545
MFAOTP,
@@ -300,6 +300,76 @@ export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => {
300300
} as EncodedJWT
301301
}
302302

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+
303373
export const unmarshalListAPIKeysResponse = (
304374
data: unknown,
305375
): ListAPIKeysResponse => {
@@ -517,76 +587,6 @@ export const unmarshalListSSHKeysResponse = (
517587
} as ListSSHKeysResponse
518588
}
519589

520-
const unmarshalListUserConnectionsResponseConnectionConnectedOrganization = (
521-
data: unknown,
522-
): ListUserConnectionsResponseConnectionConnectedOrganization => {
523-
if (!isJSONObject(data)) {
524-
throw new TypeError(
525-
`Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedOrganization' failed as data isn't a dictionary.`,
526-
)
527-
}
528-
529-
return {
530-
id: data.id,
531-
locked: data.locked,
532-
name: data.name,
533-
} as ListUserConnectionsResponseConnectionConnectedOrganization
534-
}
535-
536-
const unmarshalListUserConnectionsResponseConnectionConnectedUser = (
537-
data: unknown,
538-
): ListUserConnectionsResponseConnectionConnectedUser => {
539-
if (!isJSONObject(data)) {
540-
throw new TypeError(
541-
`Unmarshalling the type 'ListUserConnectionsResponseConnectionConnectedUser' failed as data isn't a dictionary.`,
542-
)
543-
}
544-
545-
return {
546-
id: data.id,
547-
type: data.type,
548-
username: data.username,
549-
} as ListUserConnectionsResponseConnectionConnectedUser
550-
}
551-
552-
const unmarshalListUserConnectionsResponseConnection = (
553-
data: unknown,
554-
): ListUserConnectionsResponseConnection => {
555-
if (!isJSONObject(data)) {
556-
throw new TypeError(
557-
`Unmarshalling the type 'ListUserConnectionsResponseConnection' failed as data isn't a dictionary.`,
558-
)
559-
}
560-
561-
return {
562-
organization: data.organization
563-
? unmarshalListUserConnectionsResponseConnectionConnectedOrganization(
564-
data.organization,
565-
)
566-
: undefined,
567-
user: data.user
568-
? unmarshalListUserConnectionsResponseConnectionConnectedUser(data.user)
569-
: undefined,
570-
} as ListUserConnectionsResponseConnection
571-
}
572-
573-
export const unmarshalListUserConnectionsResponse = (
574-
data: unknown,
575-
): ListUserConnectionsResponse => {
576-
if (!isJSONObject(data)) {
577-
throw new TypeError(
578-
`Unmarshalling the type 'ListUserConnectionsResponse' failed as data isn't a dictionary.`,
579-
)
580-
}
581-
582-
return {
583-
connections: unmarshalArrayOfObject(
584-
data.connections,
585-
unmarshalListUserConnectionsResponseConnection,
586-
),
587-
} as ListUserConnectionsResponse
588-
}
589-
590590
export const unmarshalListUsersResponse = (
591591
data: unknown,
592592
): ListUsersResponse => {

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

Lines changed: 29 additions & 29 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.
@@ -135,18 +147,6 @@ export interface QuotumLimit {
135147
unlimited?: boolean
136148
}
137149

138-
export interface ListUserConnectionsResponseConnectionConnectedOrganization {
139-
id: string
140-
name: string
141-
locked: boolean
142-
}
143-
144-
export interface ListUserConnectionsResponseConnectionConnectedUser {
145-
id: string
146-
username: string
147-
type: UserType
148-
}
149-
150150
export interface JWT {
151151
/** JWT ID. */
152152
jti: string
@@ -203,6 +203,13 @@ export interface CreateUserRequestMember {
203203
password: string
204204
}
205205

206+
export interface GetUserConnectionsResponseConnection {
207+
/** Information about the connected organization. */
208+
organization?: GetUserConnectionsResponseConnectionConnectedOrganization
209+
/** Information about the connected user. */
210+
user?: GetUserConnectionsResponseConnectionConnectedUser
211+
}
212+
206213
export interface APIKey {
207214
/** Access key of the API key. */
208215
accessKey: string
@@ -475,13 +482,6 @@ export interface SSHKey {
475482
disabled: boolean
476483
}
477484

478-
export interface ListUserConnectionsResponseConnection {
479-
/** Information about the connected organization. */
480-
organization?: ListUserConnectionsResponseConnectionConnectedOrganization
481-
/** Information about the connected user. */
482-
user?: ListUserConnectionsResponseConnectionConnectedUser
483-
}
484-
485485
export interface User {
486486
/** ID of user. */
487487
id: string
@@ -770,6 +770,16 @@ export type GetSSHKeyRequest = {
770770
sshKeyId: string
771771
}
772772

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+
773783
export type GetUserRequest = {
774784
/** ID of the user to find. */
775785
userId: string
@@ -1041,16 +1051,6 @@ export interface ListSSHKeysResponse {
10411051
totalCount: number
10421052
}
10431053

1044-
export type ListUserConnectionsRequest = {
1045-
/** ID of the user to list connections for. */
1046-
userId: string
1047-
}
1048-
1049-
export interface ListUserConnectionsResponse {
1050-
/** List of connections. */
1051-
connections: ListUserConnectionsResponseConnection[]
1052-
}
1053-
10541054
export type ListUsersRequest = {
10551055
/** Criteria for sorting results. */
10561056
orderBy?: ListUsersRequestOrderBy

0 commit comments

Comments
 (0)