@scaleway/sdk 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account/v2/api.gen.js +29 -0
- package/dist/api/account/v2alpha1/api.gen.js +29 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +74 -1
- package/dist/api/baremetal/v1/api.gen.js +202 -2
- package/dist/api/baremetal/v1/api.utils.js +7 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +4 -1
- package/dist/api/cockpit/index.js +2 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +319 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +4 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +174 -0
- package/dist/api/container/v1beta1/api.gen.js +189 -2
- package/dist/api/domain/v2beta1/api.gen.js +395 -8
- package/dist/api/domain/v2beta1/marshalling.gen.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +68 -1
- package/dist/api/function/v1beta1/api.gen.js +214 -2
- package/dist/api/function/v1beta1/marshalling.gen.js +12 -0
- package/dist/api/iam/v1alpha1/api.gen.js +265 -3
- package/dist/api/iam/v1alpha1/marshalling.gen.js +44 -1
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +24 -1
- package/dist/api/instance/v1/api.gen.js +351 -11
- package/dist/api/instance/v1/api.utils.js +101 -0
- package/dist/api/instance/v1/marshalling.gen.js +12 -5
- package/dist/api/iot/v1/api.gen.js +230 -1
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +189 -1
- package/dist/api/k8s/v1/api.utils.js +16 -0
- package/dist/api/k8s/v1/{index.gen.js → index.js} +1 -3
- package/dist/api/lb/v1/api.gen.js +652 -6
- package/dist/api/lb/v1/api.utils.js +29 -0
- package/dist/api/lb/v1/marshalling.gen.js +14 -0
- package/dist/api/marketplace/v1/api.gen.js +12 -0
- package/dist/api/marketplace/v2/api.gen.js +18 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +60 -1
- package/dist/api/rdb/v1/api.gen.js +383 -4
- package/dist/api/rdb/v1/marshalling.gen.js +5 -1
- package/dist/api/redis/v1/api.gen.js +144 -1
- package/dist/api/registry/v1/api.gen.js +96 -2
- package/dist/api/secret/v1alpha1/api.gen.js +134 -44
- package/dist/api/tem/v1alpha1/api.gen.js +79 -3
- package/dist/api/test/v1/api.gen.js +61 -1
- package/dist/api/vpc/v1/api.gen.js +31 -1
- package/dist/api/vpcgw/v1/api.gen.js +227 -3
- package/dist/api/webhosting/index.js +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +131 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +6 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +140 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/index.cjs +1667 -707
- package/dist/index.d.ts +7504 -5544
- package/dist/index.js +42 -38
- package/dist/scw/constants.js +1 -1
- package/dist/scw/fetch/build-fetcher.js +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from '../../../scw/api.js';
|
|
2
2
|
import { urlParams, validatePathParam, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
3
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
-
import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest } from './marshalling.gen.js';
|
|
4
|
+
import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, unmarshalJWT } from './marshalling.gen.js';
|
|
5
5
|
|
|
6
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
7
7
|
const jsonContentHeaders = {
|
|
@@ -21,31 +21,60 @@ class API extends API$1 {
|
|
|
21
21
|
return _this.client.fetch({
|
|
22
22
|
method: 'GET',
|
|
23
23
|
path: `/iam/v1alpha1/ssh-keys`,
|
|
24
|
-
urlParams: urlParams(['disabled', request.disabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId
|
|
24
|
+
urlParams: urlParams(['disabled', request.disabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
25
25
|
}, unmarshalListSSHKeysResponse);
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* List SSH keys
|
|
29
|
+
*
|
|
30
|
+
* @param request - The request {@link ListSSHKeysRequest}
|
|
31
|
+
* @returns A Promise of ListSSHKeysResponse
|
|
32
|
+
*/
|
|
27
33
|
this.listSSHKeys = function (request) {
|
|
28
34
|
if (request === void 0) {
|
|
29
35
|
request = {};
|
|
30
36
|
}
|
|
31
37
|
return enrichForPagination('sshKeys', _this.pageOfListSSHKeys, request);
|
|
32
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Create an SSH key
|
|
41
|
+
*
|
|
42
|
+
* @param request - The request {@link CreateSSHKeyRequest}
|
|
43
|
+
* @returns A Promise of SSHKey
|
|
44
|
+
*/
|
|
33
45
|
this.createSSHKey = request => this.client.fetch({
|
|
34
46
|
body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),
|
|
35
47
|
headers: jsonContentHeaders,
|
|
36
48
|
method: 'POST',
|
|
37
49
|
path: `/iam/v1alpha1/ssh-keys`
|
|
38
50
|
}, unmarshalSSHKey);
|
|
51
|
+
/**
|
|
52
|
+
* Get an SSH key
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link GetSSHKeyRequest}
|
|
55
|
+
* @returns A Promise of SSHKey
|
|
56
|
+
*/
|
|
39
57
|
this.getSSHKey = request => this.client.fetch({
|
|
40
58
|
method: 'GET',
|
|
41
59
|
path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
42
60
|
}, unmarshalSSHKey);
|
|
61
|
+
/**
|
|
62
|
+
* Update an SSH key
|
|
63
|
+
*
|
|
64
|
+
* @param request - The request {@link UpdateSSHKeyRequest}
|
|
65
|
+
* @returns A Promise of SSHKey
|
|
66
|
+
*/
|
|
43
67
|
this.updateSSHKey = request => this.client.fetch({
|
|
44
68
|
body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),
|
|
45
69
|
headers: jsonContentHeaders,
|
|
46
70
|
method: 'PATCH',
|
|
47
71
|
path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
48
72
|
}, unmarshalSSHKey);
|
|
73
|
+
/**
|
|
74
|
+
* Delete an SSH key
|
|
75
|
+
*
|
|
76
|
+
* @param request - The request {@link DeleteSSHKeyRequest}
|
|
77
|
+
*/
|
|
49
78
|
this.deleteSSHKey = request => this.client.fetch({
|
|
50
79
|
method: 'DELETE',
|
|
51
80
|
path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`
|
|
@@ -60,16 +89,33 @@ class API extends API$1 {
|
|
|
60
89
|
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
61
90
|
}, unmarshalListUsersResponse);
|
|
62
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* List users of an organization
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link ListUsersRequest}
|
|
96
|
+
* @returns A Promise of ListUsersResponse
|
|
97
|
+
*/
|
|
63
98
|
this.listUsers = function (request) {
|
|
64
99
|
if (request === void 0) {
|
|
65
100
|
request = {};
|
|
66
101
|
}
|
|
67
102
|
return enrichForPagination('users', _this.pageOfListUsers, request);
|
|
68
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Retrieve a user from its ID
|
|
106
|
+
*
|
|
107
|
+
* @param request - The request {@link GetUserRequest}
|
|
108
|
+
* @returns A Promise of User
|
|
109
|
+
*/
|
|
69
110
|
this.getUser = request => this.client.fetch({
|
|
70
111
|
method: 'GET',
|
|
71
112
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
72
113
|
}, unmarshalUser);
|
|
114
|
+
/**
|
|
115
|
+
* Delete a guest user from an organization
|
|
116
|
+
*
|
|
117
|
+
* @param request - The request {@link DeleteUserRequest}
|
|
118
|
+
*/
|
|
73
119
|
this.deleteUser = request => this.client.fetch({
|
|
74
120
|
method: 'DELETE',
|
|
75
121
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
@@ -84,28 +130,57 @@ class API extends API$1 {
|
|
|
84
130
|
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
85
131
|
}, unmarshalListApplicationsResponse);
|
|
86
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* List applications of an organization
|
|
135
|
+
*
|
|
136
|
+
* @param request - The request {@link ListApplicationsRequest}
|
|
137
|
+
* @returns A Promise of ListApplicationsResponse
|
|
138
|
+
*/
|
|
87
139
|
this.listApplications = function (request) {
|
|
88
140
|
if (request === void 0) {
|
|
89
141
|
request = {};
|
|
90
142
|
}
|
|
91
143
|
return enrichForPagination('applications', _this.pageOfListApplications, request);
|
|
92
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* Create a new application
|
|
147
|
+
*
|
|
148
|
+
* @param request - The request {@link CreateApplicationRequest}
|
|
149
|
+
* @returns A Promise of Application
|
|
150
|
+
*/
|
|
93
151
|
this.createApplication = request => this.client.fetch({
|
|
94
152
|
body: JSON.stringify(marshalCreateApplicationRequest(request, this.client.settings)),
|
|
95
153
|
headers: jsonContentHeaders,
|
|
96
154
|
method: 'POST',
|
|
97
155
|
path: `/iam/v1alpha1/applications`
|
|
98
156
|
}, unmarshalApplication);
|
|
157
|
+
/**
|
|
158
|
+
* Get an existing application
|
|
159
|
+
*
|
|
160
|
+
* @param request - The request {@link GetApplicationRequest}
|
|
161
|
+
* @returns A Promise of Application
|
|
162
|
+
*/
|
|
99
163
|
this.getApplication = request => this.client.fetch({
|
|
100
164
|
method: 'GET',
|
|
101
165
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
102
166
|
}, unmarshalApplication);
|
|
167
|
+
/**
|
|
168
|
+
* Update an existing application
|
|
169
|
+
*
|
|
170
|
+
* @param request - The request {@link UpdateApplicationRequest}
|
|
171
|
+
* @returns A Promise of Application
|
|
172
|
+
*/
|
|
103
173
|
this.updateApplication = request => this.client.fetch({
|
|
104
174
|
body: JSON.stringify(marshalUpdateApplicationRequest(request, this.client.settings)),
|
|
105
175
|
headers: jsonContentHeaders,
|
|
106
176
|
method: 'PATCH',
|
|
107
177
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
108
178
|
}, unmarshalApplication);
|
|
179
|
+
/**
|
|
180
|
+
* Delete an application
|
|
181
|
+
*
|
|
182
|
+
* @param request - The request {@link DeleteApplicationRequest}
|
|
183
|
+
*/
|
|
109
184
|
this.deleteApplication = request => this.client.fetch({
|
|
110
185
|
method: 'DELETE',
|
|
111
186
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
@@ -117,49 +192,96 @@ class API extends API$1 {
|
|
|
117
192
|
return _this.client.fetch({
|
|
118
193
|
method: 'GET',
|
|
119
194
|
path: `/iam/v1alpha1/groups`,
|
|
120
|
-
urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId
|
|
195
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
121
196
|
}, unmarshalListGroupsResponse);
|
|
122
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* List groups
|
|
200
|
+
*
|
|
201
|
+
* @param request - The request {@link ListGroupsRequest}
|
|
202
|
+
* @returns A Promise of ListGroupsResponse
|
|
203
|
+
*/
|
|
123
204
|
this.listGroups = function (request) {
|
|
124
205
|
if (request === void 0) {
|
|
125
206
|
request = {};
|
|
126
207
|
}
|
|
127
208
|
return enrichForPagination('groups', _this.pageOfListGroups, request);
|
|
128
209
|
};
|
|
210
|
+
/**
|
|
211
|
+
* Create a new group
|
|
212
|
+
*
|
|
213
|
+
* @param request - The request {@link CreateGroupRequest}
|
|
214
|
+
* @returns A Promise of Group
|
|
215
|
+
*/
|
|
129
216
|
this.createGroup = request => this.client.fetch({
|
|
130
217
|
body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)),
|
|
131
218
|
headers: jsonContentHeaders,
|
|
132
219
|
method: 'POST',
|
|
133
220
|
path: `/iam/v1alpha1/groups`
|
|
134
221
|
}, unmarshalGroup);
|
|
222
|
+
/**
|
|
223
|
+
* Get a group
|
|
224
|
+
*
|
|
225
|
+
* @param request - The request {@link GetGroupRequest}
|
|
226
|
+
* @returns A Promise of Group
|
|
227
|
+
*/
|
|
135
228
|
this.getGroup = request => this.client.fetch({
|
|
136
229
|
method: 'GET',
|
|
137
230
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
138
231
|
}, unmarshalGroup);
|
|
232
|
+
/**
|
|
233
|
+
* Update a group
|
|
234
|
+
*
|
|
235
|
+
* @param request - The request {@link UpdateGroupRequest}
|
|
236
|
+
* @returns A Promise of Group
|
|
237
|
+
*/
|
|
139
238
|
this.updateGroup = request => this.client.fetch({
|
|
140
239
|
body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)),
|
|
141
240
|
headers: jsonContentHeaders,
|
|
142
241
|
method: 'PATCH',
|
|
143
242
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
144
243
|
}, unmarshalGroup);
|
|
244
|
+
/**
|
|
245
|
+
* Overwrite users and applications of a group
|
|
246
|
+
*
|
|
247
|
+
* @param request - The request {@link SetGroupMembersRequest}
|
|
248
|
+
* @returns A Promise of Group
|
|
249
|
+
*/
|
|
145
250
|
this.setGroupMembers = request => this.client.fetch({
|
|
146
251
|
body: JSON.stringify(marshalSetGroupMembersRequest(request, this.client.settings)),
|
|
147
252
|
headers: jsonContentHeaders,
|
|
148
253
|
method: 'PUT',
|
|
149
254
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/members`
|
|
150
255
|
}, unmarshalGroup);
|
|
256
|
+
/**
|
|
257
|
+
* Add a user of an application to a group
|
|
258
|
+
*
|
|
259
|
+
* @param request - The request {@link AddGroupMemberRequest}
|
|
260
|
+
* @returns A Promise of Group
|
|
261
|
+
*/
|
|
151
262
|
this.addGroupMember = request => this.client.fetch({
|
|
152
263
|
body: JSON.stringify(marshalAddGroupMemberRequest(request, this.client.settings)),
|
|
153
264
|
headers: jsonContentHeaders,
|
|
154
265
|
method: 'POST',
|
|
155
266
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/add-member`
|
|
156
267
|
}, unmarshalGroup);
|
|
268
|
+
/**
|
|
269
|
+
* Remove a user or an application from a group
|
|
270
|
+
*
|
|
271
|
+
* @param request - The request {@link RemoveGroupMemberRequest}
|
|
272
|
+
* @returns A Promise of Group
|
|
273
|
+
*/
|
|
157
274
|
this.removeGroupMember = request => this.client.fetch({
|
|
158
275
|
body: JSON.stringify(marshalRemoveGroupMemberRequest(request, this.client.settings)),
|
|
159
276
|
headers: jsonContentHeaders,
|
|
160
277
|
method: 'POST',
|
|
161
278
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/remove-member`
|
|
162
279
|
}, unmarshalGroup);
|
|
280
|
+
/**
|
|
281
|
+
* Delete a group
|
|
282
|
+
*
|
|
283
|
+
* @param request - The request {@link DeleteGroupRequest}
|
|
284
|
+
*/
|
|
163
285
|
this.deleteGroup = request => this.client.fetch({
|
|
164
286
|
method: 'DELETE',
|
|
165
287
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
@@ -174,28 +296,57 @@ class API extends API$1 {
|
|
|
174
296
|
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['policy_name', request.policyName], ['user_ids', request.userIds])
|
|
175
297
|
}, unmarshalListPoliciesResponse);
|
|
176
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* List policies of an organization
|
|
301
|
+
*
|
|
302
|
+
* @param request - The request {@link ListPoliciesRequest}
|
|
303
|
+
* @returns A Promise of ListPoliciesResponse
|
|
304
|
+
*/
|
|
177
305
|
this.listPolicies = function (request) {
|
|
178
306
|
if (request === void 0) {
|
|
179
307
|
request = {};
|
|
180
308
|
}
|
|
181
309
|
return enrichForPagination('policies', _this.pageOfListPolicies, request);
|
|
182
310
|
};
|
|
311
|
+
/**
|
|
312
|
+
* Create a new policy
|
|
313
|
+
*
|
|
314
|
+
* @param request - The request {@link CreatePolicyRequest}
|
|
315
|
+
* @returns A Promise of Policy
|
|
316
|
+
*/
|
|
183
317
|
this.createPolicy = request => this.client.fetch({
|
|
184
318
|
body: JSON.stringify(marshalCreatePolicyRequest(request, this.client.settings)),
|
|
185
319
|
headers: jsonContentHeaders,
|
|
186
320
|
method: 'POST',
|
|
187
321
|
path: `/iam/v1alpha1/policies`
|
|
188
322
|
}, unmarshalPolicy);
|
|
323
|
+
/**
|
|
324
|
+
* Get an existing policy
|
|
325
|
+
*
|
|
326
|
+
* @param request - The request {@link GetPolicyRequest}
|
|
327
|
+
* @returns A Promise of Policy
|
|
328
|
+
*/
|
|
189
329
|
this.getPolicy = request => this.client.fetch({
|
|
190
330
|
method: 'GET',
|
|
191
331
|
path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`
|
|
192
332
|
}, unmarshalPolicy);
|
|
333
|
+
/**
|
|
334
|
+
* Update an existing policy
|
|
335
|
+
*
|
|
336
|
+
* @param request - The request {@link UpdatePolicyRequest}
|
|
337
|
+
* @returns A Promise of Policy
|
|
338
|
+
*/
|
|
193
339
|
this.updatePolicy = request => this.client.fetch({
|
|
194
340
|
body: JSON.stringify(marshalUpdatePolicyRequest(request, this.client.settings)),
|
|
195
341
|
headers: jsonContentHeaders,
|
|
196
342
|
method: 'PATCH',
|
|
197
343
|
path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`
|
|
198
344
|
}, unmarshalPolicy);
|
|
345
|
+
/**
|
|
346
|
+
* Delete a policy
|
|
347
|
+
*
|
|
348
|
+
* @param request - The request {@link DeletePolicyRequest}
|
|
349
|
+
*/
|
|
199
350
|
this.deletePolicy = request => this.client.fetch({
|
|
200
351
|
method: 'DELETE',
|
|
201
352
|
path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`
|
|
@@ -206,6 +357,12 @@ class API extends API$1 {
|
|
|
206
357
|
method: 'POST',
|
|
207
358
|
path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}/clone`
|
|
208
359
|
}, unmarshalPolicy);
|
|
360
|
+
/**
|
|
361
|
+
* Set rules of an existing policy
|
|
362
|
+
*
|
|
363
|
+
* @param request - The request {@link SetRulesRequest}
|
|
364
|
+
* @returns A Promise of SetRulesResponse
|
|
365
|
+
*/
|
|
209
366
|
this.setRules = request => this.client.fetch({
|
|
210
367
|
body: JSON.stringify(marshalSetRulesRequest(request, this.client.settings)),
|
|
211
368
|
headers: jsonContentHeaders,
|
|
@@ -217,6 +374,12 @@ class API extends API$1 {
|
|
|
217
374
|
path: `/iam/v1alpha1/rules`,
|
|
218
375
|
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_id', request.policyId])
|
|
219
376
|
}, unmarshalListRulesResponse);
|
|
377
|
+
/**
|
|
378
|
+
* List rules of an existing policy
|
|
379
|
+
*
|
|
380
|
+
* @param request - The request {@link ListRulesRequest}
|
|
381
|
+
* @returns A Promise of ListRulesResponse
|
|
382
|
+
*/
|
|
220
383
|
this.listRules = request => enrichForPagination('rules', this.pageOfListRules, request);
|
|
221
384
|
this.pageOfListPermissionSets = function (request) {
|
|
222
385
|
if (request === void 0) {
|
|
@@ -228,6 +391,12 @@ class API extends API$1 {
|
|
|
228
391
|
urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
229
392
|
}, unmarshalListPermissionSetsResponse);
|
|
230
393
|
};
|
|
394
|
+
/**
|
|
395
|
+
* List permission sets
|
|
396
|
+
*
|
|
397
|
+
* @param request - The request {@link ListPermissionSetsRequest}
|
|
398
|
+
* @returns A Promise of ListPermissionSetsResponse
|
|
399
|
+
*/
|
|
231
400
|
this.listPermissionSets = function (request) {
|
|
232
401
|
if (request === void 0) {
|
|
233
402
|
request = {};
|
|
@@ -250,32 +419,125 @@ class API extends API$1 {
|
|
|
250
419
|
}])))
|
|
251
420
|
}, unmarshalListAPIKeysResponse);
|
|
252
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* List API keys
|
|
424
|
+
*
|
|
425
|
+
* @param request - The request {@link ListAPIKeysRequest}
|
|
426
|
+
* @returns A Promise of ListAPIKeysResponse
|
|
427
|
+
*/
|
|
253
428
|
this.listAPIKeys = function (request) {
|
|
254
429
|
if (request === void 0) {
|
|
255
430
|
request = {};
|
|
256
431
|
}
|
|
257
432
|
return enrichForPagination('apiKeys', _this.pageOfListAPIKeys, request);
|
|
258
433
|
};
|
|
434
|
+
/**
|
|
435
|
+
* Create an API key
|
|
436
|
+
*
|
|
437
|
+
* @param request - The request {@link CreateAPIKeyRequest}
|
|
438
|
+
* @returns A Promise of APIKey
|
|
439
|
+
*/
|
|
259
440
|
this.createAPIKey = request => this.client.fetch({
|
|
260
441
|
body: JSON.stringify(marshalCreateAPIKeyRequest(request, this.client.settings)),
|
|
261
442
|
headers: jsonContentHeaders,
|
|
262
443
|
method: 'POST',
|
|
263
444
|
path: `/iam/v1alpha1/api-keys`
|
|
264
445
|
}, unmarshalAPIKey);
|
|
446
|
+
/**
|
|
447
|
+
* Get an API key
|
|
448
|
+
*
|
|
449
|
+
* @param request - The request {@link GetAPIKeyRequest}
|
|
450
|
+
* @returns A Promise of APIKey
|
|
451
|
+
*/
|
|
265
452
|
this.getAPIKey = request => this.client.fetch({
|
|
266
453
|
method: 'GET',
|
|
267
454
|
path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`
|
|
268
455
|
}, unmarshalAPIKey);
|
|
456
|
+
/**
|
|
457
|
+
* Update an API key
|
|
458
|
+
*
|
|
459
|
+
* @param request - The request {@link UpdateAPIKeyRequest}
|
|
460
|
+
* @returns A Promise of APIKey
|
|
461
|
+
*/
|
|
269
462
|
this.updateAPIKey = request => this.client.fetch({
|
|
270
463
|
body: JSON.stringify(marshalUpdateAPIKeyRequest(request, this.client.settings)),
|
|
271
464
|
headers: jsonContentHeaders,
|
|
272
465
|
method: 'PATCH',
|
|
273
466
|
path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`
|
|
274
467
|
}, unmarshalAPIKey);
|
|
468
|
+
/**
|
|
469
|
+
* Delete an API key
|
|
470
|
+
*
|
|
471
|
+
* @param request - The request {@link DeleteAPIKeyRequest}
|
|
472
|
+
*/
|
|
275
473
|
this.deleteAPIKey = request => this.client.fetch({
|
|
276
474
|
method: 'DELETE',
|
|
277
475
|
path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`
|
|
278
476
|
});
|
|
477
|
+
this.pageOfListQuota = function (request) {
|
|
478
|
+
if (request === void 0) {
|
|
479
|
+
request = {};
|
|
480
|
+
}
|
|
481
|
+
return _this.client.fetch({
|
|
482
|
+
method: 'GET',
|
|
483
|
+
path: `/iam/v1alpha1/quota`,
|
|
484
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
485
|
+
}, unmarshalListQuotaResponse);
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* List all quota in the organization with the associated limit
|
|
489
|
+
*
|
|
490
|
+
* @param request - The request {@link ListQuotaRequest}
|
|
491
|
+
* @returns A Promise of ListQuotaResponse
|
|
492
|
+
*/
|
|
493
|
+
this.listQuota = function (request) {
|
|
494
|
+
if (request === void 0) {
|
|
495
|
+
request = {};
|
|
496
|
+
}
|
|
497
|
+
return enrichForPagination('quota', _this.pageOfListQuota, request);
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* Get a quotum in the organization with the associated limit
|
|
501
|
+
*
|
|
502
|
+
* @param request - The request {@link GetQuotumRequest}
|
|
503
|
+
* @returns A Promise of Quotum
|
|
504
|
+
*/
|
|
505
|
+
this.getQuotum = request => this.client.fetch({
|
|
506
|
+
method: 'GET',
|
|
507
|
+
path: `/iam/v1alpha1/quota/${validatePathParam('quotumName', request.quotumName)}`,
|
|
508
|
+
urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId])
|
|
509
|
+
}, unmarshalQuotum);
|
|
510
|
+
this.pageOfListJWTs = request => this.client.fetch({
|
|
511
|
+
method: 'GET',
|
|
512
|
+
path: `/iam/v1alpha1/jwts`,
|
|
513
|
+
urlParams: urlParams(['audience_id', request.audienceId], ['expired', request.expired], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
514
|
+
}, unmarshalListJWTsResponse);
|
|
515
|
+
/**
|
|
516
|
+
* List JWTs
|
|
517
|
+
*
|
|
518
|
+
* @param request - The request {@link ListJWTsRequest}
|
|
519
|
+
* @returns A Promise of ListJWTsResponse
|
|
520
|
+
*/
|
|
521
|
+
this.listJWTs = request => enrichForPagination('jwts', this.pageOfListJWTs, request);
|
|
522
|
+
/**
|
|
523
|
+
* Get a JWT
|
|
524
|
+
*
|
|
525
|
+
* @param request - The request {@link GetJWTRequest}
|
|
526
|
+
* @returns A Promise of JWT
|
|
527
|
+
*/
|
|
528
|
+
this.getJWT = request => this.client.fetch({
|
|
529
|
+
method: 'GET',
|
|
530
|
+
path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`
|
|
531
|
+
}, unmarshalJWT);
|
|
532
|
+
/**
|
|
533
|
+
* Delete a JWT
|
|
534
|
+
*
|
|
535
|
+
* @param request - The request {@link DeleteJWTRequest}
|
|
536
|
+
*/
|
|
537
|
+
this.deleteJWT = request => this.client.fetch({
|
|
538
|
+
method: 'DELETE',
|
|
539
|
+
path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`
|
|
540
|
+
});
|
|
279
541
|
}
|
|
280
542
|
}
|
|
281
543
|
|
|
@@ -51,6 +51,21 @@ const unmarshalGroup = data => {
|
|
|
51
51
|
userIds: data.user_ids
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
+
const unmarshalJWT = data => {
|
|
55
|
+
if (!isJSONObject(data)) {
|
|
56
|
+
throw new TypeError(`Unmarshalling the type 'JWT' failed as data isn't a dictionary.`);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
audienceId: data.audience_id,
|
|
60
|
+
createdAt: unmarshalDate(data.created_at),
|
|
61
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
62
|
+
ip: data.ip,
|
|
63
|
+
issuerId: data.issuer_id,
|
|
64
|
+
jti: data.jti,
|
|
65
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
66
|
+
userAgent: data.user_agent
|
|
67
|
+
};
|
|
68
|
+
};
|
|
54
69
|
const unmarshalPermissionSet = data => {
|
|
55
70
|
if (!isJSONObject(data)) {
|
|
56
71
|
throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`);
|
|
@@ -84,6 +99,16 @@ const unmarshalPolicy = data => {
|
|
|
84
99
|
userId: data.user_id
|
|
85
100
|
};
|
|
86
101
|
};
|
|
102
|
+
const unmarshalQuotum = data => {
|
|
103
|
+
if (!isJSONObject(data)) {
|
|
104
|
+
throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
limit: data.limit,
|
|
108
|
+
name: data.name,
|
|
109
|
+
unlimited: data.unlimited
|
|
110
|
+
};
|
|
111
|
+
};
|
|
87
112
|
const unmarshalRule = data => {
|
|
88
113
|
if (!isJSONObject(data)) {
|
|
89
114
|
throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`);
|
|
@@ -157,6 +182,15 @@ const unmarshalListGroupsResponse = data => {
|
|
|
157
182
|
totalCount: data.total_count
|
|
158
183
|
};
|
|
159
184
|
};
|
|
185
|
+
const unmarshalListJWTsResponse = data => {
|
|
186
|
+
if (!isJSONObject(data)) {
|
|
187
|
+
throw new TypeError(`Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`);
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT),
|
|
191
|
+
totalCount: data.total_count
|
|
192
|
+
};
|
|
193
|
+
};
|
|
160
194
|
const unmarshalListPermissionSetsResponse = data => {
|
|
161
195
|
if (!isJSONObject(data)) {
|
|
162
196
|
throw new TypeError(`Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`);
|
|
@@ -175,6 +209,15 @@ const unmarshalListPoliciesResponse = data => {
|
|
|
175
209
|
totalCount: data.total_count
|
|
176
210
|
};
|
|
177
211
|
};
|
|
212
|
+
const unmarshalListQuotaResponse = data => {
|
|
213
|
+
if (!isJSONObject(data)) {
|
|
214
|
+
throw new TypeError(`Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`);
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
quota: unmarshalArrayOfObject(data.quota, unmarshalQuotum),
|
|
218
|
+
totalCount: data.total_count
|
|
219
|
+
};
|
|
220
|
+
};
|
|
178
221
|
const unmarshalListRulesResponse = data => {
|
|
179
222
|
if (!isJSONObject(data)) {
|
|
180
223
|
throw new TypeError(`Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`);
|
|
@@ -326,4 +369,4 @@ const marshalUpdateSSHKeyRequest = (request, defaults) => ({
|
|
|
326
369
|
name: request.name
|
|
327
370
|
});
|
|
328
371
|
|
|
329
|
-
export { marshalAddGroupMemberRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalRemoveGroupMemberRequest, marshalSetGroupMembersRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, unmarshalAPIKey, unmarshalApplication, unmarshalGroup, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGroupsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListUsersResponse, unmarshalPolicy, unmarshalSSHKey, unmarshalSetRulesResponse, unmarshalUser };
|
|
372
|
+
export { marshalAddGroupMemberRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalRemoveGroupMemberRequest, marshalSetGroupMembersRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, unmarshalAPIKey, unmarshalApplication, unmarshalGroup, unmarshalJWT, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGroupsResponse, unmarshalListJWTsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListUsersResponse, unmarshalPolicy, unmarshalQuotum, unmarshalSSHKey, unmarshalSetRulesResponse, unmarshalUser };
|
|
@@ -50,6 +50,11 @@ const CreateSSHKeyRequest = {
|
|
|
50
50
|
minLength: 1
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
const GetQuotumRequest = {
|
|
54
|
+
quotumName: {
|
|
55
|
+
minLength: 1
|
|
56
|
+
}
|
|
57
|
+
};
|
|
53
58
|
const ListAPIKeysRequest = {
|
|
54
59
|
description: {
|
|
55
60
|
maxLength: 200
|
|
@@ -88,6 +93,15 @@ const ListGroupsRequest = {
|
|
|
88
93
|
lessThanOrEqual: 100
|
|
89
94
|
}
|
|
90
95
|
};
|
|
96
|
+
const ListJWTsRequest = {
|
|
97
|
+
page: {
|
|
98
|
+
greaterThanOrEqual: 1
|
|
99
|
+
},
|
|
100
|
+
pageSize: {
|
|
101
|
+
greaterThanOrEqual: 1,
|
|
102
|
+
lessThanOrEqual: 100
|
|
103
|
+
}
|
|
104
|
+
};
|
|
91
105
|
const ListPermissionSetsRequest = {
|
|
92
106
|
page: {
|
|
93
107
|
greaterThanOrEqual: 1
|
|
@@ -109,6 +123,15 @@ const ListPoliciesRequest = {
|
|
|
109
123
|
minLength: 1
|
|
110
124
|
}
|
|
111
125
|
};
|
|
126
|
+
const ListQuotaRequest = {
|
|
127
|
+
page: {
|
|
128
|
+
greaterThanOrEqual: 1
|
|
129
|
+
},
|
|
130
|
+
pageSize: {
|
|
131
|
+
greaterThanOrEqual: 1,
|
|
132
|
+
lessThanOrEqual: 100
|
|
133
|
+
}
|
|
134
|
+
};
|
|
112
135
|
const ListRulesRequest = {
|
|
113
136
|
page: {
|
|
114
137
|
greaterThanOrEqual: 1
|
|
@@ -181,4 +204,4 @@ const UpdateSSHKeyRequest = {
|
|
|
181
204
|
}
|
|
182
205
|
};
|
|
183
206
|
|
|
184
|
-
export { CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreatePolicyRequest, CreateSSHKeyRequest, ListAPIKeysRequest, ListApplicationsRequest, ListGroupsRequest, ListPermissionSetsRequest, ListPoliciesRequest, ListRulesRequest, ListSSHKeysRequest, ListUsersRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest };
|
|
207
|
+
export { CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreatePolicyRequest, CreateSSHKeyRequest, GetQuotumRequest, ListAPIKeysRequest, ListApplicationsRequest, ListGroupsRequest, ListJWTsRequest, ListPermissionSetsRequest, ListPoliciesRequest, ListQuotaRequest, ListRulesRequest, ListSSHKeysRequest, ListUsersRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest };
|