Skip to content

Commit 1d890dc

Browse files
authored
fix(iam): rename ListUserConnections to GetUserConnections to be clear this isn't paginated (scaleway#2450)
1 parent 70850af commit 1d890dc

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

api/iam/v1alpha1/iam_sdk.go

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,25 @@ func (enum *UserType) UnmarshalJSON(data []byte) error {
875875
return nil
876876
}
877877

878+
// GetUserConnectionsResponseConnectionConnectedOrganization: get user connections response connection connected organization.
879+
type GetUserConnectionsResponseConnectionConnectedOrganization struct {
880+
ID string `json:"id"`
881+
882+
Name string `json:"name"`
883+
884+
Locked bool `json:"locked"`
885+
}
886+
887+
// GetUserConnectionsResponseConnectionConnectedUser: get user connections response connection connected user.
888+
type GetUserConnectionsResponseConnectionConnectedUser struct {
889+
ID string `json:"id"`
890+
891+
Username string `json:"username"`
892+
893+
// Type: default value: unknown_type
894+
Type UserType `json:"type"`
895+
}
896+
878897
// QuotumLimit: quotum limit.
879898
type QuotumLimit struct {
880899
// Global: whether or not the limit is applied globally.
@@ -898,25 +917,6 @@ type QuotumLimit struct {
898917
Unlimited *bool `json:"unlimited,omitempty"`
899918
}
900919

901-
// ListUserConnectionsResponseConnectionConnectedOrganization: list user connections response connection connected organization.
902-
type ListUserConnectionsResponseConnectionConnectedOrganization struct {
903-
ID string `json:"id"`
904-
905-
Name string `json:"name"`
906-
907-
Locked bool `json:"locked"`
908-
}
909-
910-
// ListUserConnectionsResponseConnectionConnectedUser: list user connections response connection connected user.
911-
type ListUserConnectionsResponseConnectionConnectedUser struct {
912-
ID string `json:"id"`
913-
914-
Username string `json:"username"`
915-
916-
// Type: default value: unknown_type
917-
Type UserType `json:"type"`
918-
}
919-
920920
// JWT: jwt.
921921
type JWT struct {
922922
// Jti: jWT ID.
@@ -979,6 +979,15 @@ type CreateUserRequestMember struct {
979979
Password string `json:"password"`
980980
}
981981

982+
// GetUserConnectionsResponseConnection: get user connections response connection.
983+
type GetUserConnectionsResponseConnection struct {
984+
// Organization: information about the connected organization.
985+
Organization *GetUserConnectionsResponseConnectionConnectedOrganization `json:"organization"`
986+
987+
// User: information about the connected user.
988+
User *GetUserConnectionsResponseConnectionConnectedUser `json:"user"`
989+
}
990+
982991
// APIKey: api key.
983992
type APIKey struct {
984993
// AccessKey: access key of the API key.
@@ -1308,15 +1317,6 @@ type SSHKey struct {
13081317
Disabled bool `json:"disabled"`
13091318
}
13101319

1311-
// ListUserConnectionsResponseConnection: list user connections response connection.
1312-
type ListUserConnectionsResponseConnection struct {
1313-
// Organization: information about the connected organization.
1314-
Organization *ListUserConnectionsResponseConnectionConnectedOrganization `json:"organization"`
1315-
1316-
// User: information about the connected user.
1317-
User *ListUserConnectionsResponseConnectionConnectedUser `json:"user"`
1318-
}
1319-
13201320
// User: user.
13211321
type User struct {
13221322
// ID: ID of user.
@@ -1642,6 +1642,18 @@ type GetSSHKeyRequest struct {
16421642
SSHKeyID string `json:"-"`
16431643
}
16441644

1645+
// GetUserConnectionsRequest: get user connections request.
1646+
type GetUserConnectionsRequest struct {
1647+
// UserID: ID of the user to list connections for.
1648+
UserID string `json:"-"`
1649+
}
1650+
1651+
// GetUserConnectionsResponse: get user connections response.
1652+
type GetUserConnectionsResponse struct {
1653+
// Connections: list of connections.
1654+
Connections []*GetUserConnectionsResponseConnection `json:"connections"`
1655+
}
1656+
16451657
// GetUserRequest: get user request.
16461658
type GetUserRequest struct {
16471659
// UserID: ID of the user to find.
@@ -2207,18 +2219,6 @@ func (r *ListSSHKeysResponse) UnsafeAppend(res interface{}) (uint32, error) {
22072219
return uint32(len(results.SSHKeys)), nil
22082220
}
22092221

2210-
// ListUserConnectionsRequest: list user connections request.
2211-
type ListUserConnectionsRequest struct {
2212-
// UserID: ID of the user to list connections for.
2213-
UserID string `json:"-"`
2214-
}
2215-
2216-
// ListUserConnectionsResponse: list user connections response.
2217-
type ListUserConnectionsResponse struct {
2218-
// Connections: list of connections.
2219-
Connections []*ListUserConnectionsResponseConnection `json:"connections"`
2220-
}
2221-
22222222
// ListUsersRequest: list users request.
22232223
type ListUsersRequest struct {
22242224
// OrderBy: criteria for sorting results.
@@ -2968,8 +2968,8 @@ func (s *API) ListGracePeriods(req *ListGracePeriodsRequest, opts ...scw.Request
29682968
return &resp, nil
29692969
}
29702970

2971-
// ListUserConnections:
2972-
func (s *API) ListUserConnections(req *ListUserConnectionsRequest, opts ...scw.RequestOption) (*ListUserConnectionsResponse, error) {
2971+
// GetUserConnections:
2972+
func (s *API) GetUserConnections(req *GetUserConnectionsRequest, opts ...scw.RequestOption) (*GetUserConnectionsResponse, error) {
29732973
var err error
29742974

29752975
if fmt.Sprint(req.UserID) == "" {
@@ -2981,7 +2981,7 @@ func (s *API) ListUserConnections(req *ListUserConnectionsRequest, opts ...scw.R
29812981
Path: "/iam/v1alpha1/users/" + fmt.Sprint(req.UserID) + "/connections",
29822982
}
29832983

2984-
var resp ListUserConnectionsResponse
2984+
var resp GetUserConnectionsResponse
29852985

29862986
err = s.client.Do(scwReq, &resp, opts...)
29872987
if err != nil {

0 commit comments

Comments
 (0)