@scaleway/sdk 0.1.0-beta.36 → 0.1.0-beta.38

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.
@@ -1,8 +1,7 @@
1
1
  import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API as API$1 } from '../../../scw/api.js';
3
- import { unmarshalScwFile } from '../../../scw/custom-marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
3
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
6
5
  import { SSL_CERTIFICATE_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from './content.gen.js';
7
6
  import { unmarshalListDNSZonesResponse, marshalCreateDNSZoneRequest, unmarshalDNSZone, marshalUpdateDNSZoneRequest, marshalCloneDNSZoneRequest, unmarshalDeleteDNSZoneResponse, unmarshalListDNSZoneRecordsResponse, marshalUpdateDNSZoneRecordsRequest, unmarshalUpdateDNSZoneRecordsResponse, unmarshalListDNSZoneNameserversResponse, marshalUpdateDNSZoneNameserversRequest, unmarshalUpdateDNSZoneNameserversResponse, unmarshalClearDNSZoneRecordsResponse, marshalImportRawDNSZoneRequest, unmarshalImportRawDNSZoneResponse, marshalImportProviderDNSZoneRequest, unmarshalImportProviderDNSZoneResponse, marshalRefreshDNSZoneRequest, unmarshalRefreshDNSZoneResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, marshalCreateSSLCertificateRequest, unmarshalListSSLCertificatesResponse, unmarshalDeleteSSLCertificateResponse, unmarshalGetDNSZoneTsigKeyResponse, unmarshalListTasksResponse, marshalRegistrarApiBuyDomainsRequest, unmarshalOrderResponse, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiRegisterExternalDomainRequest, unmarshalRegisterExternalDomainResponse, unmarshalDeleteExternalDomainResponse, marshalRegistrarApiCheckContactsCompatibilityRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalListContactsResponse, unmarshalContact, marshalRegistrarApiUpdateContactRequest, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalDomain, marshalRegistrarApiUpdateDomainRequest, unmarshalGetDomainAuthCodeResponse, marshalRegistrarApiEnableDomainDNSSECRequest, unmarshalSearchAvailableDomainsResponse, marshalRegistrarApiCreateDomainHostRequest, unmarshalHost, unmarshalListDomainHostsResponse, marshalRegistrarApiUpdateDomainHostRequest } from './marshalling.gen.js';
8
7
 
@@ -78,8 +77,9 @@ class API extends API$1 {
78
77
  this.exportRawDNSZone = request => this.client.fetch({
79
78
  method: 'GET',
80
79
  path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`,
81
- urlParams: urlParams(['format', request.format ?? 'unknown_raw_format'])
82
- }, unmarshalScwFile);
80
+ urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']),
81
+ responseType: 'blob'
82
+ });
83
83
  this.importRawDNSZone = request => this.client.fetch({
84
84
  body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),
85
85
  headers: jsonContentHeaders,
@@ -162,12 +162,22 @@ class RegistrarAPI extends API$1 {
162
162
  var _this;
163
163
  super(...arguments);
164
164
  _this = this;
165
- this.pageOfListTasks = request => this.client.fetch({
166
- method: 'GET',
167
- path: `/domain/v2beta1/tasks`,
168
- urlParams: urlParams(['domain', request.domain], ['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])
169
- }, unmarshalListTasksResponse);
170
- this.listTasks = request => enrichForPagination('tasks', this.pageOfListTasks, request);
165
+ this.pageOfListTasks = function (request) {
166
+ if (request === void 0) {
167
+ request = {};
168
+ }
169
+ return _this.client.fetch({
170
+ method: 'GET',
171
+ path: `/domain/v2beta1/tasks`,
172
+ urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['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], ['statuses', request.statuses], ['types', request.types])
173
+ }, unmarshalListTasksResponse);
174
+ };
175
+ this.listTasks = function (request) {
176
+ if (request === void 0) {
177
+ request = {};
178
+ }
179
+ return enrichForPagination('tasks', _this.pageOfListTasks, request);
180
+ };
171
181
  this.buyDomains = request => this.client.fetch({
172
182
  body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),
173
183
  headers: jsonContentHeaders,
@@ -1023,6 +1023,8 @@ const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({
1023
1023
  }])
1024
1024
  });
1025
1025
  const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({
1026
+ domains: request.domains,
1027
+ tlds: request.tlds,
1026
1028
  ...resolveOneOf([{
1027
1029
  param: 'administrative_contact_id',
1028
1030
  value: request.administrativeContactId
@@ -1037,13 +1039,6 @@ const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults)
1037
1039
  param: 'owner_contact',
1038
1040
  value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined
1039
1041
  }]),
1040
- ...resolveOneOf([{
1041
- param: 'domain',
1042
- value: request.domain
1043
- }, {
1044
- param: 'tld',
1045
- value: request.tld
1046
- }]),
1047
1042
  ...resolveOneOf([{
1048
1043
  param: 'technical_contact_id',
1049
1044
  value: request.technicalContactId
@@ -2,8 +2,8 @@ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { NAMESPACE_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES, TRIGGER_INPUT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListFunctionsResponse, unmarshalFunction, marshalCreateFunctionRequest, marshalUpdateFunctionRequest, unmarshalListFunctionRuntimesResponse, unmarshalUploadURL, unmarshalDownloadURL, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest, marshalCreateTriggerInputRequest, unmarshalTriggerInput, unmarshalListTriggerInputsResponse, marshalSetTriggerInputsRequest, unmarshalSetTriggerInputsResponse, marshalUpdateTriggerInputRequest } from './marshalling.gen.js';
5
+ import { NAMESPACE_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
6
+ import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListFunctionsResponse, unmarshalFunction, marshalCreateFunctionRequest, marshalUpdateFunctionRequest, unmarshalListFunctionRuntimesResponse, unmarshalUploadURL, unmarshalDownloadURL, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  const jsonContentHeaders = {
@@ -230,12 +230,32 @@ class API extends API$1 {
230
230
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
231
231
  }, unmarshalTrigger);
232
232
  this.waitForTrigger = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
233
- this.pageOfListTriggers = request => this.client.fetch({
234
- method: 'GET',
235
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`,
236
- urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
237
- }, unmarshalListTriggersResponse);
238
- this.listTriggers = request => enrichForPagination('triggers', this.pageOfListTriggers, request);
233
+ this.pageOfListTriggers = function (request) {
234
+ if (request === void 0) {
235
+ request = {};
236
+ }
237
+ return _this.client.fetch({
238
+ method: 'GET',
239
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/triggers`,
240
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
241
+ default: _this.client.settings.defaultProjectId,
242
+ param: 'project_id',
243
+ value: request.projectId
244
+ }, {
245
+ param: 'function_id',
246
+ value: request.functionId
247
+ }, {
248
+ param: 'namespace_id',
249
+ value: request.namespaceId
250
+ }])))
251
+ }, unmarshalListTriggersResponse);
252
+ };
253
+ this.listTriggers = function (request) {
254
+ if (request === void 0) {
255
+ request = {};
256
+ }
257
+ return enrichForPagination('triggers', _this.pageOfListTriggers, request);
258
+ };
239
259
  this.updateTrigger = request => this.client.fetch({
240
260
  body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
241
261
  headers: jsonContentHeaders,
@@ -246,39 +266,6 @@ class API extends API$1 {
246
266
  method: 'DELETE',
247
267
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
248
268
  }, unmarshalTrigger);
249
- this.createTriggerInput = request => this.client.fetch({
250
- body: JSON.stringify(marshalCreateTriggerInputRequest(request, this.client.settings)),
251
- headers: jsonContentHeaders,
252
- method: 'POST',
253
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`
254
- }, unmarshalTriggerInput);
255
- this.getTriggerInput = request => this.client.fetch({
256
- method: 'GET',
257
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
258
- }, unmarshalTriggerInput);
259
- this.waitForTriggerInput = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TRIGGER_INPUT_TRANSIENT_STATUSES.includes(res.status))), this.getTriggerInput, request, options);
260
- this.pageOfListTriggerInputs = request => this.client.fetch({
261
- method: 'GET',
262
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`,
263
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['trigger_id', request.triggerId])
264
- }, unmarshalListTriggerInputsResponse);
265
- this.listTriggerInputs = request => enrichForPagination('inputs', this.pageOfListTriggerInputs, request);
266
- this.setTriggerInputs = request => this.client.fetch({
267
- body: JSON.stringify(marshalSetTriggerInputsRequest(request, this.client.settings)),
268
- headers: jsonContentHeaders,
269
- method: 'PUT',
270
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`
271
- }, unmarshalSetTriggerInputsResponse);
272
- this.updateTriggerInput = request => this.client.fetch({
273
- body: JSON.stringify(marshalUpdateTriggerInputRequest(request, this.client.settings)),
274
- headers: jsonContentHeaders,
275
- method: 'PATCH',
276
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
277
- }, unmarshalTriggerInput);
278
- this.deleteTriggerInput = request => this.client.fetch({
279
- method: 'DELETE',
280
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
281
- }, unmarshalTriggerInput);
282
269
  }
283
270
  }
284
271
  API.LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
@@ -16,10 +16,7 @@ const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
16
16
  /** Lists transient statutes of the enum {@link TokenStatus}. */
17
17
  const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
18
18
 
19
- /** Lists transient statutes of the enum {@link TriggerInputStatus}. */
20
- const TRIGGER_INPUT_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
21
-
22
19
  /** Lists transient statutes of the enum {@link TriggerStatus}. */
23
20
  const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
24
21
 
25
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_INPUT_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
22
+ export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
@@ -1,4 +1,4 @@
1
1
  export { API } from './api.gen.js';
2
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_INPUT_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
2
+ export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
@@ -3,33 +3,6 @@ import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
4
4
 
5
5
  // This file was automatically generated. DO NOT EDIT.
6
- const unmarshalTriggerNatsDeadLetter = data => {
7
- if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'TriggerNatsDeadLetter' failed as data isn't a dictionary.`);
9
- }
10
- return {
11
- mnqNamespaceId: data.mnq_namespace_id,
12
- subject: data.subject
13
- };
14
- };
15
- const unmarshalTriggerRetryPolicy = data => {
16
- if (!isJSONObject(data)) {
17
- throw new TypeError(`Unmarshalling the type 'TriggerRetryPolicy' failed as data isn't a dictionary.`);
18
- }
19
- return {
20
- maxRetries: data.max_retries,
21
- retryPeriod: data.retry_period
22
- };
23
- };
24
- const unmarshalTriggerSqsDeadLetter = data => {
25
- if (!isJSONObject(data)) {
26
- throw new TypeError(`Unmarshalling the type 'TriggerSqsDeadLetter' failed as data isn't a dictionary.`);
27
- }
28
- return {
29
- mnqNamespaceId: data.mnq_namespace_id,
30
- queue: data.queue
31
- };
32
- };
33
6
  const unmarshalSecretHashedValue = data => {
34
7
  if (!isJSONObject(data)) {
35
8
  throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
@@ -39,38 +12,35 @@ const unmarshalSecretHashedValue = data => {
39
12
  key: data.key
40
13
  };
41
14
  };
42
- const unmarshalTriggerInputNatsClientConfig = data => {
15
+ const unmarshalTriggerMnqNatsClientConfig = data => {
43
16
  if (!isJSONObject(data)) {
44
- throw new TypeError(`Unmarshalling the type 'TriggerInputNatsClientConfig' failed as data isn't a dictionary.`);
17
+ throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
45
18
  }
46
19
  return {
20
+ mnqNamespaceId: data.mnq_namespace_id,
47
21
  subject: data.subject
48
22
  };
49
23
  };
50
- const unmarshalTriggerInputSqsClientConfig = data => {
24
+ const unmarshalTriggerMnqSqsClientConfig = data => {
51
25
  if (!isJSONObject(data)) {
52
- throw new TypeError(`Unmarshalling the type 'TriggerInputSqsClientConfig' failed as data isn't a dictionary.`);
26
+ throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
53
27
  }
54
28
  return {
29
+ mnqNamespaceId: data.mnq_namespace_id,
55
30
  queue: data.queue
56
31
  };
57
32
  };
58
- const unmarshalTriggerNatsFailureHandlingPolicy = data => {
33
+ const unmarshalTriggerSqsClientConfig = data => {
59
34
  if (!isJSONObject(data)) {
60
- throw new TypeError(`Unmarshalling the type 'TriggerNatsFailureHandlingPolicy' failed as data isn't a dictionary.`);
35
+ throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
61
36
  }
62
37
  return {
63
- natsDeadLetter: data.nats_dead_letter ? unmarshalTriggerNatsDeadLetter(data.nats_dead_letter) : undefined,
64
- retryPolicy: data.retry_policy ? unmarshalTriggerRetryPolicy(data.retry_policy) : undefined,
65
- sqsDeadLetter: data.sqs_dead_letter ? unmarshalTriggerSqsDeadLetter(data.sqs_dead_letter) : undefined
38
+ accessKey: data.access_key,
39
+ endpoint: data.endpoint,
40
+ queueUrl: data.queue_url,
41
+ secretKey: data.secret_key
66
42
  };
67
43
  };
68
- const unmarshalTriggerSqsFailureHandlingPolicy = data => {
69
- if (!isJSONObject(data)) {
70
- throw new TypeError(`Unmarshalling the type 'TriggerSqsFailureHandlingPolicy' failed as data isn't a dictionary.`);
71
- }
72
- return {};
73
- };
74
44
  const unmarshalCron = data => {
75
45
  if (!isJSONObject(data)) {
76
46
  throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
@@ -196,23 +166,11 @@ const unmarshalTrigger = data => {
196
166
  errorMessage: data.error_message,
197
167
  functionId: data.function_id,
198
168
  id: data.id,
169
+ inputType: data.input_type,
199
170
  name: data.name,
200
- natsFailureHandlingPolicy: data.nats_failure_handling_policy ? unmarshalTriggerNatsFailureHandlingPolicy(data.nats_failure_handling_policy) : undefined,
201
- sqsFailureHandlingPolicy: data.sqs_failure_handling_policy ? unmarshalTriggerSqsFailureHandlingPolicy(data.sqs_failure_handling_policy) : undefined,
202
- status: data.status,
203
- type: data.type
204
- };
205
- };
206
- const unmarshalTriggerInput = data => {
207
- if (!isJSONObject(data)) {
208
- throw new TypeError(`Unmarshalling the type 'TriggerInput' failed as data isn't a dictionary.`);
209
- }
210
- return {
211
- errorMessage: data.error_message,
212
- id: data.id,
213
- mnqNamespaceId: data.mnq_namespace_id,
214
- natsConfig: data.nats_config ? unmarshalTriggerInputNatsClientConfig(data.nats_config) : undefined,
215
- sqsConfig: data.sqs_config ? unmarshalTriggerInputSqsClientConfig(data.sqs_config) : undefined,
171
+ scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,
172
+ scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,
173
+ sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,
216
174
  status: data.status
217
175
  };
218
176
  };
@@ -288,15 +246,6 @@ const unmarshalListTokensResponse = data => {
288
246
  totalCount: data.total_count
289
247
  };
290
248
  };
291
- const unmarshalListTriggerInputsResponse = data => {
292
- if (!isJSONObject(data)) {
293
- throw new TypeError(`Unmarshalling the type 'ListTriggerInputsResponse' failed as data isn't a dictionary.`);
294
- }
295
- return {
296
- inputs: unmarshalArrayOfObject(data.inputs, unmarshalTriggerInput),
297
- totalCount: data.total_count
298
- };
299
- };
300
249
  const unmarshalListTriggersResponse = data => {
301
250
  if (!isJSONObject(data)) {
302
251
  throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
@@ -306,14 +255,6 @@ const unmarshalListTriggersResponse = data => {
306
255
  triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
307
256
  };
308
257
  };
309
- const unmarshalSetTriggerInputsResponse = data => {
310
- if (!isJSONObject(data)) {
311
- throw new TypeError(`Unmarshalling the type 'SetTriggerInputsResponse' failed as data isn't a dictionary.`);
312
- }
313
- return {
314
- triggerInputs: unmarshalArrayOfObject(data.trigger_inputs, unmarshalTriggerInput)
315
- };
316
- };
317
258
  const unmarshalUploadURL = data => {
318
259
  if (!isJSONObject(data)) {
319
260
  throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`);
@@ -323,51 +264,38 @@ const unmarshalUploadURL = data => {
323
264
  url: data.url
324
265
  };
325
266
  };
326
- const marshalCreateTriggerInputRequestNatsClientConfigSpec = (request, defaults) => ({
327
- subject: request.subject
328
- });
329
- const marshalCreateTriggerInputRequestSqsClientConfigSpec = (request, defaults) => ({
330
- queue: request.queue
331
- });
332
- const marshalCreateTriggerRequestNatsFailureHandlingPolicyNatsDeadLetter = (request, defaults) => ({
267
+ const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
333
268
  mnq_namespace_id: request.mnqNamespaceId,
334
269
  subject: request.subject
335
270
  });
336
- const marshalCreateTriggerRequestNatsFailureHandlingPolicyRetryPolicy = (request, defaults) => ({
337
- max_retries: request.maxRetries,
338
- retry_period: request.retryPeriod
339
- });
340
- const marshalCreateTriggerRequestNatsFailureHandlingPolicySqsDeadLetter = (request, defaults) => ({
271
+ const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
341
272
  mnq_namespace_id: request.mnqNamespaceId,
342
273
  queue: request.queue
343
274
  });
344
- const marshalCreateTriggerRequestNatsFailureHandlingPolicy = (request, defaults) => ({
345
- retry_policy: request.retryPolicy ? marshalCreateTriggerRequestNatsFailureHandlingPolicyRetryPolicy(request.retryPolicy) : undefined,
346
- ...resolveOneOf([{
347
- param: 'nats_dead_letter',
348
- value: request.natsDeadLetter ? marshalCreateTriggerRequestNatsFailureHandlingPolicyNatsDeadLetter(request.natsDeadLetter) : undefined
349
- }, {
350
- param: 'sqs_dead_letter',
351
- value: request.sqsDeadLetter ? marshalCreateTriggerRequestNatsFailureHandlingPolicySqsDeadLetter(request.sqsDeadLetter) : undefined
352
- }])
275
+ const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
276
+ access_key: request.accessKey,
277
+ endpoint: request.endpoint,
278
+ queue_url: request.queueUrl,
279
+ secret_key: request.secretKey
353
280
  });
354
- const marshalCreateTriggerRequestSqsFailureHandlingPolicy = (request, defaults) => ({});
355
281
  const marshalSecret = (request, defaults) => ({
356
282
  key: request.key,
357
283
  value: request.value
358
284
  });
359
- const marshalSetTriggerInputsRequestNatsConfigs = (request, defaults) => ({
360
- configs: request.configs.map(elt => marshalCreateTriggerInputRequestNatsClientConfigSpec(elt))
361
- });
362
- const marshalSetTriggerInputsRequestSqsConfigs = (request, defaults) => ({
363
- configs: request.configs.map(elt => marshalCreateTriggerInputRequestSqsClientConfigSpec(elt))
364
- });
365
- const marshalUpdateTriggerInputRequestNatsClientConfigSpec = (request, defaults) => ({
285
+ const marshalUpdateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
286
+ mnq_namespace_id: request.mnqNamespaceId,
366
287
  subject: request.subject
367
288
  });
368
- const marshalUpdateTriggerInputRequestSqsClientConfigSpec = (request, defaults) => ({
289
+ const marshalUpdateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
290
+ mnq_namespace_id: request.mnqNamespaceId,
369
291
  queue: request.queue
370
292
  });
293
+ const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
294
+ access_key: request.accessKey,
295
+ endpoint: request.endpoint,
296
+ queue_url: request.queueUrl,
297
+ secret_key: request.secretKey
298
+ });
371
299
  const marshalCreateCronRequest = (request, defaults) => ({
372
300
  args: request.args,
373
301
  function_id: request.functionId,
@@ -411,38 +339,19 @@ const marshalCreateTokenRequest = (request, defaults) => ({
411
339
  value: request.namespaceId
412
340
  }])
413
341
  });
414
- const marshalCreateTriggerInputRequest = (request, defaults) => ({
415
- mnq_namespace_id: request.mnqNamespaceId,
416
- trigger_id: request.triggerId,
417
- ...resolveOneOf([{
418
- param: 'nats_config',
419
- value: request.natsConfig ? marshalCreateTriggerInputRequestNatsClientConfigSpec(request.natsConfig) : undefined
420
- }, {
421
- param: 'sqs_config',
422
- value: request.sqsConfig ? marshalCreateTriggerInputRequestSqsClientConfigSpec(request.sqsConfig) : undefined
423
- }])
424
- });
425
342
  const marshalCreateTriggerRequest = (request, defaults) => ({
426
343
  description: request.description,
427
344
  function_id: request.functionId,
428
345
  name: request.name,
429
- type: request.type ?? 'unknown_trigger_type',
430
346
  ...resolveOneOf([{
431
- param: 'nats_failure_handling_policy',
432
- value: request.natsFailureHandlingPolicy ? marshalCreateTriggerRequestNatsFailureHandlingPolicy(request.natsFailureHandlingPolicy) : undefined
347
+ param: 'scw_sqs_config',
348
+ value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
433
349
  }, {
434
- param: 'sqs_failure_handling_policy',
435
- value: request.sqsFailureHandlingPolicy ? marshalCreateTriggerRequestSqsFailureHandlingPolicy(request.sqsFailureHandlingPolicy) : undefined
436
- }])
437
- });
438
- const marshalSetTriggerInputsRequest = (request, defaults) => ({
439
- trigger_input_id: request.triggerInputId,
440
- ...resolveOneOf([{
441
- param: 'sqs',
442
- value: request.sqs ? marshalSetTriggerInputsRequestSqsConfigs(request.sqs) : undefined
350
+ param: 'sqs_config',
351
+ value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
443
352
  }, {
444
- param: 'nats',
445
- value: request.nats ? marshalSetTriggerInputsRequestNatsConfigs(request.nats) : undefined
353
+ param: 'scw_nats_config',
354
+ value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
446
355
  }])
447
356
  });
448
357
  const marshalUpdateCronRequest = (request, defaults) => ({
@@ -470,25 +379,19 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
470
379
  environment_variables: request.environmentVariables,
471
380
  secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
472
381
  });
473
- const marshalUpdateTriggerInputRequest = (request, defaults) => ({
474
- ...resolveOneOf([{
475
- param: 'nats_config',
476
- value: request.natsConfig ? marshalUpdateTriggerInputRequestNatsClientConfigSpec(request.natsConfig) : undefined
477
- }, {
478
- param: 'sqs_config',
479
- value: request.sqsConfig ? marshalUpdateTriggerInputRequestSqsClientConfigSpec(request.sqsConfig) : undefined
480
- }])
481
- });
482
382
  const marshalUpdateTriggerRequest = (request, defaults) => ({
483
383
  description: request.description,
484
384
  name: request.name,
485
385
  ...resolveOneOf([{
486
- param: 'nats_config',
487
- value: request.natsConfig ? marshalCreateTriggerRequestNatsFailureHandlingPolicy(request.natsConfig) : undefined
386
+ param: 'scw_sqs_config',
387
+ value: request.scwSqsConfig ? marshalUpdateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
488
388
  }, {
489
389
  param: 'sqs_config',
490
- value: request.sqsConfig ? marshalCreateTriggerRequestSqsFailureHandlingPolicy(request.sqsConfig) : undefined
390
+ value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
391
+ }, {
392
+ param: 'scw_nats_config',
393
+ value: request.scwNatsConfig ? marshalUpdateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
491
394
  }])
492
395
  });
493
396
 
494
- export { marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateFunctionRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerInputRequest, marshalCreateTriggerRequest, marshalSetTriggerInputsRequest, marshalUpdateCronRequest, marshalUpdateFunctionRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerInputRequest, marshalUpdateTriggerRequest, unmarshalCron, unmarshalDomain, unmarshalDownloadURL, unmarshalFunction, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggerInputsResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalSetTriggerInputsResponse, unmarshalToken, unmarshalTrigger, unmarshalTriggerInput, unmarshalUploadURL };
397
+ export { marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateFunctionRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateCronRequest, marshalUpdateFunctionRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalCron, unmarshalDomain, unmarshalDownloadURL, unmarshalFunction, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger, unmarshalUploadURL };
@@ -241,7 +241,7 @@ class API extends API$1 {
241
241
  return _this.client.fetch({
242
242
  method: 'GET',
243
243
  path: `/iam/v1alpha1/api-keys`,
244
- urlParams: urlParams(['editable', request.editable], ['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], ...Object.entries(resolveOneOf([{
244
+ urlParams: urlParams(['access_key', request.accessKey], ['bearer_id', request.bearerId], ['bearer_type', request.bearerType ?? 'unknown_bearer_type'], ['description', request.description], ['editable', request.editable], ['expired', request.expired], ['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], ...Object.entries(resolveOneOf([{
245
245
  param: 'application_id',
246
246
  value: request.applicationId
247
247
  }, {
@@ -216,7 +216,6 @@ const marshalRuleSpecs = (request, defaults) => ({
216
216
  param: 'project_ids',
217
217
  value: request.projectIds
218
218
  }, {
219
- default: defaults.defaultOrganizationId,
220
219
  param: 'organization_id',
221
220
  value: request.organizationId
222
221
  }])
@@ -256,7 +255,7 @@ const marshalCreatePolicyRequest = (request, defaults) => ({
256
255
  description: request.description,
257
256
  name: request.name || randomName('pol'),
258
257
  organization_id: request.organizationId ?? defaults.defaultOrganizationId,
259
- rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) : undefined,
258
+ rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt)) : undefined,
260
259
  ...resolveOneOf([{
261
260
  param: 'user_id',
262
261
  value: request.userId
@@ -291,7 +290,7 @@ const marshalSetGroupMembersRequest = (request, defaults) => ({
291
290
  });
292
291
  const marshalSetRulesRequest = (request, defaults) => ({
293
292
  policy_id: request.policyId,
294
- rules: request.rules.map(elt => marshalRuleSpecs(elt, defaults))
293
+ rules: request.rules.map(elt => marshalRuleSpecs(elt))
295
294
  });
296
295
  const marshalUpdateAPIKeyRequest = (request, defaults) => ({
297
296
  default_project_id: request.defaultProjectId,
@@ -51,6 +51,9 @@ const CreateSSHKeyRequest = {
51
51
  }
52
52
  };
53
53
  const ListAPIKeysRequest = {
54
+ description: {
55
+ maxLength: 200
56
+ },
54
57
  page: {
55
58
  greaterThanOrEqual: 1
56
59
  },
@@ -1013,11 +1013,9 @@ const marshalVolumeTemplate = (request, defaults) => ({
1013
1013
  size: request.size,
1014
1014
  volume_type: request.volumeType,
1015
1015
  ...resolveOneOf([{
1016
- default: defaults.defaultProjectId,
1017
1016
  param: 'project',
1018
1017
  value: request.project
1019
1018
  }, {
1020
- default: defaults.defaultOrganizationId,
1021
1019
  param: 'organization',
1022
1020
  value: request.organization
1023
1021
  }])
@@ -1029,7 +1027,7 @@ const marshalCreateImageRequest = (request, defaults) => ({
1029
1027
  let [key, value] = _ref2;
1030
1028
  return {
1031
1029
  ...acc,
1032
- [key]: marshalVolumeTemplate(value, defaults)
1030
+ [key]: marshalVolumeTemplate(value)
1033
1031
  };
1034
1032
  }, {}) : undefined,
1035
1033
  name: request.name || randomName('img'),
@@ -1,8 +1,7 @@
1
1
  import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API as API$1 } from '../../../scw/api.js';
3
- import { unmarshalScwFile } from '../../../scw/custom-marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
6
5
  import { CLUSTER_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES } from './content.gen.js';
7
6
  import { unmarshalListClustersResponse, marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, marshalUpgradeClusterRequest, unmarshalListClusterAvailableVersionsResponse, unmarshalListPoolsResponse, marshalCreatePoolRequest, unmarshalPool, marshalUpgradePoolRequest, marshalUpdatePoolRequest, unmarshalListNodesResponse, unmarshalNode, unmarshalListVersionsResponse, unmarshalVersion } from './marshalling.gen.js';
8
7
 
@@ -67,8 +66,10 @@ class API extends API$1 {
67
66
  }, unmarshalListClusterAvailableVersionsResponse);
68
67
  this._getClusterKubeConfig = request => this.client.fetch({
69
68
  method: 'GET',
70
- path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`
71
- }, unmarshalScwFile);
69
+ path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`,
70
+ urlParams: urlParams(['dl', 1]),
71
+ responseType: 'blob'
72
+ });
72
73
  this.resetClusterAdminToken = request => this.client.fetch({
73
74
  body: '{}',
74
75
  headers: jsonContentHeaders,
@@ -508,7 +508,7 @@ const marshalAclSpec = (request, defaults) => ({
508
508
  action: marshalAclAction(request.action),
509
509
  description: request.description,
510
510
  index: request.index,
511
- match: marshalAclMatch(request.match),
511
+ match: request.match ? marshalAclMatch(request.match) : undefined,
512
512
  name: request.name
513
513
  });
514
514
  const marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({
@@ -582,7 +582,7 @@ const marshalCreateAclRequest = (request, defaults) => ({
582
582
  action: marshalAclAction(request.action),
583
583
  description: request.description,
584
584
  index: request.index,
585
- match: marshalAclMatch(request.match),
585
+ match: request.match ? marshalAclMatch(request.match) : undefined,
586
586
  name: request.name || randomName('acl')
587
587
  });
588
588
  const marshalCreateBackendRequest = (request, defaults) => ({
@@ -692,7 +692,7 @@ const marshalUpdateAclRequest = (request, defaults) => ({
692
692
  action: marshalAclAction(request.action),
693
693
  description: request.description,
694
694
  index: request.index,
695
- match: marshalAclMatch(request.match),
695
+ match: request.match ? marshalAclMatch(request.match) : undefined,
696
696
  name: request.name
697
697
  });
698
698
  const marshalUpdateBackendRequest = (request, defaults) => ({
@@ -792,7 +792,7 @@ const marshalZonedApiCreateAclRequest = (request, defaults) => ({
792
792
  action: marshalAclAction(request.action),
793
793
  description: request.description,
794
794
  index: request.index,
795
- match: marshalAclMatch(request.match),
795
+ match: request.match ? marshalAclMatch(request.match) : undefined,
796
796
  name: request.name || randomName('acl')
797
797
  });
798
798
  const marshalZonedApiCreateBackendRequest = (request, defaults) => ({
@@ -905,7 +905,7 @@ const marshalZonedApiUpdateAclRequest = (request, defaults) => ({
905
905
  action: marshalAclAction(request.action),
906
906
  description: request.description,
907
907
  index: request.index,
908
- match: marshalAclMatch(request.match),
908
+ match: request.match ? marshalAclMatch(request.match) : undefined,
909
909
  name: request.name
910
910
  });
911
911
  const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({