@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.
Files changed (55) hide show
  1. package/dist/api/account/v2/api.gen.js +29 -0
  2. package/dist/api/account/v2alpha1/api.gen.js +29 -0
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +74 -1
  4. package/dist/api/baremetal/v1/api.gen.js +202 -2
  5. package/dist/api/baremetal/v1/api.utils.js +7 -0
  6. package/dist/api/baremetal/v1/marshalling.gen.js +4 -1
  7. package/dist/api/cockpit/index.js +2 -0
  8. package/dist/api/cockpit/v1beta1/api.gen.js +319 -0
  9. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  10. package/dist/api/cockpit/v1beta1/index.gen.js +4 -0
  11. package/dist/api/cockpit/v1beta1/marshalling.gen.js +174 -0
  12. package/dist/api/container/v1beta1/api.gen.js +189 -2
  13. package/dist/api/domain/v2beta1/api.gen.js +395 -8
  14. package/dist/api/domain/v2beta1/marshalling.gen.js +2 -2
  15. package/dist/api/flexibleip/v1alpha1/api.gen.js +68 -1
  16. package/dist/api/function/v1beta1/api.gen.js +214 -2
  17. package/dist/api/function/v1beta1/marshalling.gen.js +12 -0
  18. package/dist/api/iam/v1alpha1/api.gen.js +265 -3
  19. package/dist/api/iam/v1alpha1/marshalling.gen.js +44 -1
  20. package/dist/api/iam/v1alpha1/validation-rules.gen.js +24 -1
  21. package/dist/api/instance/v1/api.gen.js +351 -11
  22. package/dist/api/instance/v1/api.utils.js +101 -0
  23. package/dist/api/instance/v1/marshalling.gen.js +12 -5
  24. package/dist/api/iot/v1/api.gen.js +230 -1
  25. package/dist/api/k8s/index.js +2 -2
  26. package/dist/api/k8s/v1/api.gen.js +189 -1
  27. package/dist/api/k8s/v1/api.utils.js +16 -0
  28. package/dist/api/k8s/v1/{index.gen.js → index.js} +1 -3
  29. package/dist/api/lb/v1/api.gen.js +652 -6
  30. package/dist/api/lb/v1/api.utils.js +29 -0
  31. package/dist/api/lb/v1/marshalling.gen.js +14 -0
  32. package/dist/api/marketplace/v1/api.gen.js +12 -0
  33. package/dist/api/marketplace/v2/api.gen.js +18 -0
  34. package/dist/api/mnq/v1alpha1/api.gen.js +60 -1
  35. package/dist/api/rdb/v1/api.gen.js +383 -4
  36. package/dist/api/rdb/v1/marshalling.gen.js +5 -1
  37. package/dist/api/redis/v1/api.gen.js +144 -1
  38. package/dist/api/registry/v1/api.gen.js +96 -2
  39. package/dist/api/secret/v1alpha1/api.gen.js +134 -44
  40. package/dist/api/tem/v1alpha1/api.gen.js +79 -3
  41. package/dist/api/test/v1/api.gen.js +61 -1
  42. package/dist/api/vpc/v1/api.gen.js +31 -1
  43. package/dist/api/vpcgw/v1/api.gen.js +227 -3
  44. package/dist/api/webhosting/index.js +2 -0
  45. package/dist/api/webhosting/v1alpha1/api.gen.js +131 -0
  46. package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
  47. package/dist/api/webhosting/v1alpha1/index.gen.js +6 -0
  48. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +140 -0
  49. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
  50. package/dist/index.cjs +1667 -707
  51. package/dist/index.d.ts +7504 -5544
  52. package/dist/index.js +42 -38
  53. package/dist/scw/constants.js +1 -1
  54. package/dist/scw/fetch/build-fetcher.js +1 -1
  55. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { API as API$1 } from '../../../scw/api.js';
2
- import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
2
+ import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
4
  import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse } from './marshalling.gen.js';
5
5
 
@@ -18,25 +18,44 @@ class API extends API$1 {
18
18
  var _this;
19
19
  super(...arguments);
20
20
  _this = this;
21
+ /**
22
+ * Create a Secret containing no versions
23
+ *
24
+ * @param request - The request {@link CreateSecretRequest}
25
+ * @returns A Promise of Secret
26
+ */
21
27
  this.createSecret = request => this.client.fetch({
22
28
  body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),
23
29
  headers: jsonContentHeaders,
24
30
  method: 'POST',
25
31
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
26
32
  }, unmarshalSecret);
27
- this.getSecret = function (request) {
28
- if (request === void 0) {
29
- request = {};
30
- }
31
- return _this.client.fetch({
32
- method: 'GET',
33
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`,
34
- urlParams: urlParams(...Object.entries(resolveOneOf([{
35
- param: 'secret_name',
36
- value: request.secretName
37
- }])))
38
- }, unmarshalSecret);
39
- };
33
+ /**
34
+ * Get metadata of a Secret
35
+ *
36
+ * @param request - The request {@link GetSecretRequest}
37
+ * @returns A Promise of Secret
38
+ */
39
+ this.getSecret = request => this.client.fetch({
40
+ method: 'GET',
41
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
42
+ }, unmarshalSecret);
43
+ /**
44
+ * Get metadata of a Secret
45
+ *
46
+ * @param request - The request {@link GetSecretByNameRequest}
47
+ * @returns A Promise of Secret
48
+ */
49
+ this.getSecretByName = request => this.client.fetch({
50
+ method: 'GET',
51
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}`
52
+ }, unmarshalSecret);
53
+ /**
54
+ * Update metadata of a Secret
55
+ *
56
+ * @param request - The request {@link UpdateSecretRequest}
57
+ * @returns A Promise of Secret
58
+ */
40
59
  this.updateSecret = request => this.client.fetch({
41
60
  body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
42
61
  headers: jsonContentHeaders,
@@ -50,86 +69,157 @@ class API extends API$1 {
50
69
  return _this.client.fetch({
51
70
  method: 'GET',
52
71
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets`,
53
- urlParams: urlParams(['name', request.name], ['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], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags])
72
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
54
73
  }, unmarshalListSecretsResponse);
55
74
  };
75
+ /**
76
+ * List Secrets
77
+ *
78
+ * @param request - The request {@link ListSecretsRequest}
79
+ * @returns A Promise of ListSecretsResponse
80
+ */
56
81
  this.listSecrets = function (request) {
57
82
  if (request === void 0) {
58
83
  request = {};
59
84
  }
60
85
  return enrichForPagination('secrets', _this.pageOfListSecrets, request);
61
86
  };
87
+ /**
88
+ * Delete a secret
89
+ *
90
+ * @param request - The request {@link DeleteSecretRequest}
91
+ */
62
92
  this.deleteSecret = request => this.client.fetch({
63
93
  method: 'DELETE',
64
94
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
65
95
  });
96
+ /**
97
+ * Create a SecretVersion
98
+ *
99
+ * @param request - The request {@link CreateSecretVersionRequest}
100
+ * @returns A Promise of SecretVersion
101
+ */
66
102
  this.createSecretVersion = request => this.client.fetch({
67
103
  body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),
68
104
  headers: jsonContentHeaders,
69
105
  method: 'POST',
70
106
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`
71
107
  }, unmarshalSecretVersion);
108
+ /**
109
+ * Get metadata of a SecretVersion
110
+ *
111
+ * @param request - The request {@link GetSecretVersionRequest}
112
+ * @returns A Promise of SecretVersion
113
+ */
72
114
  this.getSecretVersion = request => this.client.fetch({
73
115
  method: 'GET',
74
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`,
75
- urlParams: urlParams(...Object.entries(resolveOneOf([{
76
- param: 'secret_name',
77
- value: request.secretName
78
- }])))
116
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
117
+ }, unmarshalSecretVersion);
118
+ /**
119
+ * Get metadata of a SecretVersion
120
+ *
121
+ * @param request - The request {@link GetSecretVersionByNameRequest}
122
+ * @returns A Promise of SecretVersion
123
+ */
124
+ this.getSecretVersionByName = request => this.client.fetch({
125
+ method: 'GET',
126
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}`
79
127
  }, unmarshalSecretVersion);
128
+ /**
129
+ * Update metadata of a SecretVersion
130
+ *
131
+ * @param request - The request {@link UpdateSecretVersionRequest}
132
+ * @returns A Promise of SecretVersion
133
+ */
80
134
  this.updateSecretVersion = request => this.client.fetch({
81
135
  body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),
82
136
  headers: jsonContentHeaders,
83
137
  method: 'PATCH',
84
138
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
85
139
  }, unmarshalSecretVersion);
86
- this.pageOfListSecretVersions = function (request) {
87
- if (request === void 0) {
88
- request = {};
89
- }
90
- return _this.client.fetch({
91
- method: 'GET',
92
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,
93
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['status', request.status], ...Object.entries(resolveOneOf([{
94
- param: 'secret_name',
95
- value: request.secretName
96
- }])))
97
- }, unmarshalListSecretVersionsResponse);
98
- };
99
- this.listSecretVersions = function (request) {
100
- if (request === void 0) {
101
- request = {};
102
- }
103
- return enrichForPagination('versions', _this.pageOfListSecretVersions, request);
104
- };
140
+ this.pageOfListSecretVersions = request => this.client.fetch({
141
+ method: 'GET',
142
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,
143
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
144
+ }, unmarshalListSecretVersionsResponse);
145
+ /**
146
+ * List versions of a secret, not returning any sensitive data
147
+ *
148
+ * @param request - The request {@link ListSecretVersionsRequest}
149
+ * @returns A Promise of ListSecretVersionsResponse
150
+ */
151
+ this.listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request);
152
+ this.pageOfListSecretVersionsByName = request => this.client.fetch({
153
+ method: 'GET',
154
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions`,
155
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
156
+ }, unmarshalListSecretVersionsResponse);
157
+ /**
158
+ * List versions of a secret, not returning any sensitive data
159
+ *
160
+ * @param request - The request {@link ListSecretVersionsByNameRequest}
161
+ * @returns A Promise of ListSecretVersionsResponse
162
+ */
163
+ this.listSecretVersionsByName = request => enrichForPagination('versions', this.pageOfListSecretVersionsByName, request);
164
+ /**
165
+ * Destroy a SecretVersion, permanently destroying the sensitive data
166
+ *
167
+ * @param request - The request {@link DestroySecretVersionRequest}
168
+ * @returns A Promise of SecretVersion
169
+ */
105
170
  this.destroySecretVersion = request => this.client.fetch({
106
171
  body: '{}',
107
172
  headers: jsonContentHeaders,
108
173
  method: 'POST',
109
174
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`
110
175
  }, unmarshalSecretVersion);
176
+ /**
177
+ * Enable a SecretVersion
178
+ *
179
+ * @param request - The request {@link EnableSecretVersionRequest}
180
+ * @returns A Promise of SecretVersion
181
+ */
111
182
  this.enableSecretVersion = request => this.client.fetch({
112
183
  body: '{}',
113
184
  headers: jsonContentHeaders,
114
185
  method: 'POST',
115
186
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`
116
187
  }, unmarshalSecretVersion);
188
+ /**
189
+ * Disable a SecretVersion
190
+ *
191
+ * @param request - The request {@link DisableSecretVersionRequest}
192
+ * @returns A Promise of SecretVersion
193
+ */
117
194
  this.disableSecretVersion = request => this.client.fetch({
118
195
  body: '{}',
119
196
  headers: jsonContentHeaders,
120
197
  method: 'POST',
121
198
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`
122
199
  }, unmarshalSecretVersion);
200
+ /**
201
+ * Access a SecretVersion, returning the sensitive data
202
+ *
203
+ * @param request - The request {@link AccessSecretVersionRequest}
204
+ * @returns A Promise of AccessSecretVersionResponse
205
+ */
123
206
  this.accessSecretVersion = request => this.client.fetch({
124
207
  method: 'GET',
125
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`,
126
- urlParams: urlParams(...Object.entries(resolveOneOf([{
127
- param: 'secret_name',
128
- value: request.secretName
129
- }])))
208
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`
209
+ }, unmarshalAccessSecretVersionResponse);
210
+ /**
211
+ * Access a SecretVersion, returning the sensitive data
212
+ *
213
+ * @param request - The request {@link AccessSecretVersionByNameRequest}
214
+ * @returns A Promise of AccessSecretVersionResponse
215
+ */
216
+ this.accessSecretVersionByName = request => this.client.fetch({
217
+ method: 'GET',
218
+ path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}/access`
130
219
  }, unmarshalAccessSecretVersionResponse);
131
220
  }
132
221
  }
222
+ /** Lists the available regions of the API. */
133
223
  API.LOCALITIES = ['fr-par'];
134
224
 
135
225
  export { API };
@@ -20,16 +20,35 @@ class API extends API$1 {
20
20
  var _this;
21
21
  super(...arguments);
22
22
  _this = this;
23
+ /**
24
+ * Send an email
25
+ *
26
+ * @param request - The request {@link CreateEmailRequest}
27
+ * @returns A Promise of CreateEmailResponse
28
+ */
23
29
  this.createEmail = request => this.client.fetch({
24
30
  body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),
25
31
  headers: jsonContentHeaders,
26
32
  method: 'POST',
27
33
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`
28
34
  }, unmarshalCreateEmailResponse);
35
+ /**
36
+ * Get information about an email
37
+ *
38
+ * @param request - The request {@link GetEmailRequest}
39
+ * @returns A Promise of Email
40
+ */
29
41
  this.getEmail = request => this.client.fetch({
30
42
  method: 'GET',
31
43
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}`
32
44
  }, unmarshalEmail);
45
+ /**
46
+ * Waits for {@link Email} to be in a final state.
47
+ *
48
+ * @param request - The request {@link GetEmailRequest}
49
+ * @param options - The waiting options
50
+ * @returns A Promise of Email
51
+ */
33
52
  this.waitForEmail = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options);
34
53
  this.pageOfListEmails = function (request) {
35
54
  if (request === void 0) {
@@ -38,15 +57,28 @@ class API extends API$1 {
38
57
  return _this.client.fetch({
39
58
  method: 'GET',
40
59
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/emails`,
41
- urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['mail_to', request.mailTo], ['message_id', request.messageId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['since', request.since], ['statuses', request.statuses], ['until', request.until])
60
+ urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['mail_to', request.mailTo], ['message_id', request.messageId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['since', request.since], ['statuses', request.statuses], ['until', request.until])
42
61
  }, unmarshalListEmailsResponse);
43
62
  };
63
+ /**
64
+ * List emails sent from a domain and/or for a project and/or for an
65
+ * organization
66
+ *
67
+ * @param request - The request {@link ListEmailsRequest}
68
+ * @returns A Promise of ListEmailsResponse
69
+ */
44
70
  this.listEmails = function (request) {
45
71
  if (request === void 0) {
46
72
  request = {};
47
73
  }
48
74
  return enrichForPagination('emails', _this.pageOfListEmails, request);
49
75
  };
76
+ /**
77
+ * Get statistics on the email statuses
78
+ *
79
+ * @param request - The request {@link GetStatisticsRequest}
80
+ * @returns A Promise of Statistics
81
+ */
50
82
  this.getStatistics = function (request) {
51
83
  if (request === void 0) {
52
84
  request = {};
@@ -54,25 +86,50 @@ class API extends API$1 {
54
86
  return _this.client.fetch({
55
87
  method: 'GET',
56
88
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/statistics`,
57
- urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['since', request.since], ['until', request.until])
89
+ urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['project_id', request.projectId], ['since', request.since], ['until', request.until])
58
90
  }, unmarshalStatistics);
59
91
  };
92
+ /**
93
+ * Try to cancel an email if it has not yet been sent
94
+ *
95
+ * @param request - The request {@link CancelEmailRequest}
96
+ * @returns A Promise of Email
97
+ */
60
98
  this.cancelEmail = request => this.client.fetch({
61
99
  body: '{}',
62
100
  headers: jsonContentHeaders,
63
101
  method: 'POST',
64
102
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}/cancel`
65
103
  }, unmarshalEmail);
104
+ /**
105
+ * Register a domain in a project
106
+ *
107
+ * @param request - The request {@link CreateDomainRequest}
108
+ * @returns A Promise of Domain
109
+ */
66
110
  this.createDomain = request => this.client.fetch({
67
111
  body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
68
112
  headers: jsonContentHeaders,
69
113
  method: 'POST',
70
114
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
71
115
  }, unmarshalDomain);
116
+ /**
117
+ * Get information about a domain
118
+ *
119
+ * @param request - The request {@link GetDomainRequest}
120
+ * @returns A Promise of Domain
121
+ */
72
122
  this.getDomain = request => this.client.fetch({
73
123
  method: 'GET',
74
124
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
75
125
  }, unmarshalDomain);
126
+ /**
127
+ * Waits for {@link Domain} to be in a final state.
128
+ *
129
+ * @param request - The request {@link GetDomainRequest}
130
+ * @param options - The waiting options
131
+ * @returns A Promise of Domain
132
+ */
76
133
  this.waitForDomain = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
77
134
  this.pageOfListDomains = function (request) {
78
135
  if (request === void 0) {
@@ -81,21 +138,39 @@ class API extends API$1 {
81
138
  return _this.client.fetch({
82
139
  method: 'GET',
83
140
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/domains`,
84
- urlParams: urlParams(['name', request.name], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['status', request.status])
141
+ urlParams: urlParams(['name', request.name], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status])
85
142
  }, unmarshalListDomainsResponse);
86
143
  };
144
+ /**
145
+ * List domains in a project and/or in an organization
146
+ *
147
+ * @param request - The request {@link ListDomainsRequest}
148
+ * @returns A Promise of ListDomainsResponse
149
+ */
87
150
  this.listDomains = function (request) {
88
151
  if (request === void 0) {
89
152
  request = {};
90
153
  }
91
154
  return enrichForPagination('domains', _this.pageOfListDomains, request);
92
155
  };
156
+ /**
157
+ * Revoke a domain
158
+ *
159
+ * @param request - The request {@link RevokeDomainRequest}
160
+ * @returns A Promise of Domain
161
+ */
93
162
  this.revokeDomain = request => this.client.fetch({
94
163
  body: '{}',
95
164
  headers: jsonContentHeaders,
96
165
  method: 'POST',
97
166
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/revoke`
98
167
  }, unmarshalDomain);
168
+ /**
169
+ * Ask for an immediate check of a domain (DNS check)
170
+ *
171
+ * @param request - The request {@link CheckDomainRequest}
172
+ * @returns A Promise of Domain
173
+ */
99
174
  this.checkDomain = request => this.client.fetch({
100
175
  body: '{}',
101
176
  headers: jsonContentHeaders,
@@ -104,6 +179,7 @@ class API extends API$1 {
104
179
  }, unmarshalDomain);
105
180
  }
106
181
  }
182
+ /** Lists the available regions of the API. */
107
183
  API.LOCALITIES = ['fr-par'];
108
184
 
109
185
  export { API };
@@ -29,6 +29,16 @@ class API extends API$1 {
29
29
  var _this;
30
30
  super(...arguments);
31
31
  _this = this;
32
+ /**
33
+ * Register a human and return a access-key and a secret-key that must be used
34
+ * in all other commands.
35
+ *
36
+ * Hint: you can use other test commands by setting the SCW_SECRET_KEY env
37
+ * variable.
38
+ *
39
+ * @param request - The request {@link RegisterRequest}
40
+ * @returns A Promise of RegisterResponse
41
+ */
32
42
  this.register = request => this.client.fetch({
33
43
  body: JSON.stringify(marshalRegisterRequest(request, this.client.settings)),
34
44
  headers: jsonContentHeaders,
@@ -42,42 +52,92 @@ class API extends API$1 {
42
52
  return _this.client.fetch({
43
53
  method: 'GET',
44
54
  path: `/test/v1/humans`,
45
- 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], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
55
+ urlParams: urlParams(['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])
46
56
  }, unmarshalListHumansResponse);
47
57
  };
58
+ /**
59
+ * List all your humans
60
+ *
61
+ * @param request - The request {@link ListHumansRequest}
62
+ * @returns A Promise of ListHumansResponse
63
+ */
48
64
  this.listHumans = function (request) {
49
65
  if (request === void 0) {
50
66
  request = {};
51
67
  }
52
68
  return enrichForPagination('humans', _this.pageOfListHumans, request);
53
69
  };
70
+ /**
71
+ * Get the human details associated with the given id.
72
+ *
73
+ * @param request - The request {@link GetHumanRequest}
74
+ * @returns A Promise of Human
75
+ */
54
76
  this.getHuman = request => this.client.fetch({
55
77
  method: 'GET',
56
78
  path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
57
79
  }, unmarshalHuman);
80
+ /**
81
+ * Waits for {@link Human} to be in a final state.
82
+ *
83
+ * @param request - The request {@link GetHumanRequest}
84
+ * @param options - The waiting options
85
+ * @returns A Promise of Human
86
+ */
58
87
  this.waitForHuman = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES.includes(res.status))), this.getHuman, request, options);
88
+ /**
89
+ * Create a new human
90
+ *
91
+ * @param request - The request {@link CreateHumanRequest}
92
+ * @returns A Promise of Human
93
+ */
59
94
  this.createHuman = request => this.client.fetch({
60
95
  body: JSON.stringify(marshalCreateHumanRequest(request, this.client.settings)),
61
96
  headers: jsonContentHeaders,
62
97
  method: 'POST',
63
98
  path: `/test/v1/humans`
64
99
  }, unmarshalHuman);
100
+ /**
101
+ * Update the human associated with the given id.
102
+ *
103
+ * @param request - The request {@link UpdateHumanRequest}
104
+ * @returns A Promise of Human
105
+ */
65
106
  this.updateHuman = request => this.client.fetch({
66
107
  body: JSON.stringify(marshalUpdateHumanRequest(request, this.client.settings)),
67
108
  headers: jsonContentHeaders,
68
109
  method: 'PATCH',
69
110
  path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
70
111
  }, unmarshalHuman);
112
+ /**
113
+ * Delete the human associated with the given id.
114
+ *
115
+ * @param request - The request {@link DeleteHumanRequest}
116
+ * @returns A Promise of Human
117
+ */
71
118
  this.deleteHuman = request => this.client.fetch({
72
119
  method: 'DELETE',
73
120
  path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
74
121
  }, unmarshalHuman);
122
+ /**
123
+ * Start a one hour running for the given human.
124
+ *
125
+ * @param request - The request {@link RunHumanRequest}
126
+ * @returns A Promise of Human
127
+ */
75
128
  this.runHuman = request => this.client.fetch({
76
129
  body: '{}',
77
130
  headers: jsonContentHeaders,
78
131
  method: 'POST',
79
132
  path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/run`
80
133
  }, unmarshalHuman);
134
+ /**
135
+ * Make a human smoke.
136
+ *
137
+ * @deprecated
138
+ * @param request - The request {@link SmokeHumanRequest}
139
+ * @returns A Promise of Human
140
+ */
81
141
  this.smokeHuman = function (request) {
82
142
  if (request === void 0) {
83
143
  request = {};
@@ -21,15 +21,27 @@ class API extends API$1 {
21
21
  return _this.client.fetch({
22
22
  method: 'GET',
23
23
  path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`,
24
- urlParams: urlParams(['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], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['tags', request.tags])
24
+ urlParams: urlParams(['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], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags])
25
25
  }, unmarshalListPrivateNetworksResponse);
26
26
  };
27
+ /**
28
+ * List private networks
29
+ *
30
+ * @param request - The request {@link ListPrivateNetworksRequest}
31
+ * @returns A Promise of ListPrivateNetworksResponse
32
+ */
27
33
  this.listPrivateNetworks = function (request) {
28
34
  if (request === void 0) {
29
35
  request = {};
30
36
  }
31
37
  return enrichForPagination('privateNetworks', _this.pageOfListPrivateNetworks, request);
32
38
  };
39
+ /**
40
+ * Create a private network
41
+ *
42
+ * @param request - The request {@link CreatePrivateNetworkRequest}
43
+ * @returns A Promise of PrivateNetwork
44
+ */
33
45
  this.createPrivateNetwork = function (request) {
34
46
  if (request === void 0) {
35
47
  request = {};
@@ -41,22 +53,40 @@ class API extends API$1 {
41
53
  path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`
42
54
  }, unmarshalPrivateNetwork);
43
55
  };
56
+ /**
57
+ * Get a private network
58
+ *
59
+ * @param request - The request {@link GetPrivateNetworkRequest}
60
+ * @returns A Promise of PrivateNetwork
61
+ */
44
62
  this.getPrivateNetwork = request => this.client.fetch({
45
63
  method: 'GET',
46
64
  path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
47
65
  }, unmarshalPrivateNetwork);
66
+ /**
67
+ * Update private network
68
+ *
69
+ * @param request - The request {@link UpdatePrivateNetworkRequest}
70
+ * @returns A Promise of PrivateNetwork
71
+ */
48
72
  this.updatePrivateNetwork = request => this.client.fetch({
49
73
  body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),
50
74
  headers: jsonContentHeaders,
51
75
  method: 'PATCH',
52
76
  path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
53
77
  }, unmarshalPrivateNetwork);
78
+ /**
79
+ * Delete a private network
80
+ *
81
+ * @param request - The request {@link DeletePrivateNetworkRequest}
82
+ */
54
83
  this.deletePrivateNetwork = request => this.client.fetch({
55
84
  method: 'DELETE',
56
85
  path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
57
86
  });
58
87
  }
59
88
  }
89
+ /** Lists the available zones of the API. */
60
90
  API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
61
91
 
62
92
  export { API };