@scaleway/sdk 0.1.0-beta.12 → 0.1.0-beta.14

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.
@@ -2,7 +2,7 @@ import { API } from '../../../scw/api.js';
2
2
  import { unmarshalScwFile } from '../../../scw/custom-marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
4
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
5
- 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 } from './marshalling.gen.js';
5
+ 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';
6
6
 
7
7
  // This file was automatically generated. DO NOT EDIT.
8
8
  const jsonContentHeaders = {
@@ -388,6 +388,33 @@ class DomainRegistrarV2Beta1GenAPI extends API {
388
388
  path: `/domain/v2beta1/search-domains`,
389
389
  urlParams: urlParams(['domains', request.domains], ['tlds', request.tlds])
390
390
  }, unmarshalSearchAvailableDomainsResponse);
391
+
392
+ this.createDomainHost = request => this.client.fetch({
393
+ body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),
394
+ headers: jsonContentHeaders,
395
+ method: 'POST',
396
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`
397
+ }, unmarshalHost);
398
+
399
+ this.pageOfListDomainHosts = request => this.client.fetch({
400
+ method: 'GET',
401
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`,
402
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
403
+ }, unmarshalListDomainHostsResponse);
404
+
405
+ this.listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request);
406
+
407
+ this.updateDomainHost = request => this.client.fetch({
408
+ body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),
409
+ headers: jsonContentHeaders,
410
+ method: 'PATCH',
411
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
412
+ }, unmarshalHost);
413
+
414
+ this.deleteDomainHost = request => this.client.fetch({
415
+ method: 'DELETE',
416
+ path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`
417
+ }, unmarshalHost);
391
418
  }
392
419
 
393
420
  }
@@ -3,5 +3,8 @@
3
3
 
4
4
  /** Lists transient statutes of the enum {@link DNSZoneStatus}. */
5
5
  const DNS_ZONE_TRANSIENT_STATUSES = ['pending'];
6
+ /** Lists transient statutes of the enum {@link HostStatus}. */
6
7
 
7
- export { DNS_ZONE_TRANSIENT_STATUSES };
8
+ const HOST_TRANSIENT_STATUSES = ['updating', 'deleting'];
9
+
10
+ export { DNS_ZONE_TRANSIENT_STATUSES, HOST_TRANSIENT_STATUSES };
@@ -1,2 +1,2 @@
1
1
  export { DomainV2Beta1GenAPI as API, DomainRegistrarV2Beta1GenAPI as RegistrarAPI } from './api.gen.js';
2
- export { DNS_ZONE_TRANSIENT_STATUSES } from './content.gen.js';
2
+ export { DNS_ZONE_TRANSIENT_STATUSES, HOST_TRANSIENT_STATUSES } from './content.gen.js';
@@ -483,6 +483,19 @@ const unmarshalDomainSummary = data => {
483
483
  };
484
484
  };
485
485
 
486
+ const unmarshalHost = data => {
487
+ if (!isJSONObject(data)) {
488
+ throw new TypeError(`Unmarshalling the type 'Host' failed as data isn't a dictionary.`);
489
+ }
490
+
491
+ return {
492
+ domain: data.domain,
493
+ ips: data.ips,
494
+ name: data.name,
495
+ status: data.status
496
+ };
497
+ };
498
+
486
499
  const unmarshalNameserver = data => {
487
500
  if (!isJSONObject(data)) {
488
501
  throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`);
@@ -727,6 +740,16 @@ const unmarshalListDNSZonesResponse = data => {
727
740
  totalCount: data.total_count
728
741
  };
729
742
  };
743
+ const unmarshalListDomainHostsResponse = data => {
744
+ if (!isJSONObject(data)) {
745
+ throw new TypeError(`Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`);
746
+ }
747
+
748
+ return {
749
+ hosts: unmarshalArrayOfObject(data.hosts, unmarshalHost),
750
+ totalCount: data.total_count
751
+ };
752
+ };
730
753
  const unmarshalListDomainsResponse = data => {
731
754
  if (!isJSONObject(data)) {
732
755
  throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
@@ -1173,6 +1196,10 @@ const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults)
1173
1196
  value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined
1174
1197
  }])
1175
1198
  });
1199
+ const marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({
1200
+ ips: request.ips,
1201
+ name: request.name
1202
+ });
1176
1203
  const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({
1177
1204
  ds_record: request.dsRecord ? marshalDSRecord(request.dsRecord) : undefined
1178
1205
  });
@@ -1241,6 +1268,9 @@ const marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({
1241
1268
  whois_opt_in: request.whoisOptIn,
1242
1269
  zip: request.zip
1243
1270
  });
1271
+ const marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({
1272
+ ips: request.ips
1273
+ });
1244
1274
  const marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({ ...resolveOneOf([{
1245
1275
  param: 'administrative_contact_id',
1246
1276
  value: request.administrativeContactId
@@ -1277,4 +1307,4 @@ const marshalUpdateDNSZoneRequest = (request, defaults) => ({
1277
1307
  project_id: request.projectId ?? defaults.defaultProjectId
1278
1308
  });
1279
1309
 
1280
- export { marshalCloneDNSZoneRequest, marshalCreateDNSZoneRequest, marshalCreateSSLCertificateRequest, marshalImportProviderDNSZoneRequest, marshalImportRawDNSZoneRequest, marshalRefreshDNSZoneRequest, marshalRegistrarApiBuyDomainsRequest, marshalRegistrarApiCheckContactsCompatibilityRequest, marshalRegistrarApiEnableDomainDNSSECRequest, marshalRegistrarApiRegisterExternalDomainRequest, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiUpdateContactRequest, marshalRegistrarApiUpdateDomainRequest, marshalUpdateDNSZoneNameserversRequest, marshalUpdateDNSZoneRecordsRequest, marshalUpdateDNSZoneRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalClearDNSZoneRecordsResponse, unmarshalContact, unmarshalDNSZone, unmarshalDeleteDNSZoneResponse, unmarshalDeleteExternalDomainResponse, unmarshalDeleteSSLCertificateResponse, unmarshalDomain, unmarshalGetDNSZoneTsigKeyResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalGetDomainAuthCodeResponse, unmarshalImportProviderDNSZoneResponse, unmarshalImportRawDNSZoneResponse, unmarshalListContactsResponse, unmarshalListDNSZoneNameserversResponse, unmarshalListDNSZoneRecordsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZonesResponse, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalListSSLCertificatesResponse, unmarshalListTasksResponse, unmarshalOrderResponse, unmarshalRefreshDNSZoneResponse, unmarshalRegisterExternalDomainResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, unmarshalSearchAvailableDomainsResponse, unmarshalUpdateDNSZoneNameserversResponse, unmarshalUpdateDNSZoneRecordsResponse };
1310
+ export { marshalCloneDNSZoneRequest, marshalCreateDNSZoneRequest, marshalCreateSSLCertificateRequest, marshalImportProviderDNSZoneRequest, marshalImportRawDNSZoneRequest, marshalRefreshDNSZoneRequest, marshalRegistrarApiBuyDomainsRequest, marshalRegistrarApiCheckContactsCompatibilityRequest, marshalRegistrarApiCreateDomainHostRequest, marshalRegistrarApiEnableDomainDNSSECRequest, marshalRegistrarApiRegisterExternalDomainRequest, marshalRegistrarApiRenewDomainsRequest, marshalRegistrarApiTradeDomainRequest, marshalRegistrarApiTransferInDomainRequest, marshalRegistrarApiUpdateContactRequest, marshalRegistrarApiUpdateDomainHostRequest, marshalRegistrarApiUpdateDomainRequest, marshalUpdateDNSZoneNameserversRequest, marshalUpdateDNSZoneRecordsRequest, marshalUpdateDNSZoneRequest, unmarshalCheckContactsCompatibilityResponse, unmarshalClearDNSZoneRecordsResponse, unmarshalContact, unmarshalDNSZone, unmarshalDeleteDNSZoneResponse, unmarshalDeleteExternalDomainResponse, unmarshalDeleteSSLCertificateResponse, unmarshalDomain, unmarshalGetDNSZoneTsigKeyResponse, unmarshalGetDNSZoneVersionDiffResponse, unmarshalGetDomainAuthCodeResponse, unmarshalHost, unmarshalImportProviderDNSZoneResponse, unmarshalImportRawDNSZoneResponse, unmarshalListContactsResponse, unmarshalListDNSZoneNameserversResponse, unmarshalListDNSZoneRecordsResponse, unmarshalListDNSZoneVersionRecordsResponse, unmarshalListDNSZoneVersionsResponse, unmarshalListDNSZonesResponse, unmarshalListDomainHostsResponse, unmarshalListDomainsResponse, unmarshalListRenewableDomainsResponse, unmarshalListSSLCertificatesResponse, unmarshalListTasksResponse, unmarshalOrderResponse, unmarshalRefreshDNSZoneResponse, unmarshalRegisterExternalDomainResponse, unmarshalRestoreDNSZoneVersionResponse, unmarshalSSLCertificate, unmarshalSearchAvailableDomainsResponse, unmarshalUpdateDNSZoneNameserversResponse, unmarshalUpdateDNSZoneRecordsResponse };
@@ -2,8 +2,8 @@ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API } 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 } 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 } from './marshalling.gen.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';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  const jsonContentHeaders = {
@@ -268,6 +268,81 @@ class FunctionV1Beta1GenAPI extends API {
268
268
  method: 'DELETE',
269
269
  path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
270
270
  }, unmarshalToken);
271
+
272
+ this.createTrigger = request => this.client.fetch({
273
+ body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
274
+ headers: jsonContentHeaders,
275
+ method: 'POST',
276
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`
277
+ }, unmarshalTrigger);
278
+
279
+ this.getTrigger = request => this.client.fetch({
280
+ method: 'GET',
281
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
282
+ }, unmarshalTrigger);
283
+
284
+ this.waitForTrigger = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
285
+
286
+ this.pageOfListTriggers = request => this.client.fetch({
287
+ method: 'GET',
288
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`,
289
+ urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
290
+ }, unmarshalListTriggersResponse);
291
+
292
+ this.listTriggers = request => enrichForPagination('triggers', this.pageOfListTriggers, request);
293
+
294
+ this.updateTrigger = request => this.client.fetch({
295
+ body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
296
+ headers: jsonContentHeaders,
297
+ method: 'PATCH',
298
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
299
+ }, unmarshalTrigger);
300
+
301
+ this.deleteTrigger = request => this.client.fetch({
302
+ method: 'DELETE',
303
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
304
+ }, unmarshalTrigger);
305
+
306
+ this.createTriggerInput = request => this.client.fetch({
307
+ body: JSON.stringify(marshalCreateTriggerInputRequest(request, this.client.settings)),
308
+ headers: jsonContentHeaders,
309
+ method: 'POST',
310
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`
311
+ }, unmarshalTriggerInput);
312
+
313
+ this.getTriggerInput = request => this.client.fetch({
314
+ method: 'GET',
315
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
316
+ }, unmarshalTriggerInput);
317
+
318
+ 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);
319
+
320
+ this.pageOfListTriggerInputs = request => this.client.fetch({
321
+ method: 'GET',
322
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`,
323
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['trigger_id', request.triggerId])
324
+ }, unmarshalListTriggerInputsResponse);
325
+
326
+ this.listTriggerInputs = request => enrichForPagination('inputs', this.pageOfListTriggerInputs, request);
327
+
328
+ this.setTriggerInputs = request => this.client.fetch({
329
+ body: JSON.stringify(marshalSetTriggerInputsRequest(request, this.client.settings)),
330
+ headers: jsonContentHeaders,
331
+ method: 'PUT',
332
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs`
333
+ }, unmarshalSetTriggerInputsResponse);
334
+
335
+ this.updateTriggerInput = request => this.client.fetch({
336
+ body: JSON.stringify(marshalUpdateTriggerInputRequest(request, this.client.settings)),
337
+ headers: jsonContentHeaders,
338
+ method: 'PATCH',
339
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
340
+ }, unmarshalTriggerInput);
341
+
342
+ this.deleteTriggerInput = request => this.client.fetch({
343
+ method: 'DELETE',
344
+ path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/trigger-inputs/${validatePathParam('triggerInputId', request.triggerInputId)}`
345
+ }, unmarshalTriggerInput);
271
346
  }
272
347
 
273
348
  }
@@ -15,5 +15,11 @@ const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
15
15
  /** Lists transient statutes of the enum {@link TokenStatus}. */
16
16
 
17
17
  const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
18
+ /** Lists transient statutes of the enum {@link TriggerInputStatus}. */
18
19
 
19
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES };
20
+ const TRIGGER_INPUT_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
21
+ /** Lists transient statutes of the enum {@link TriggerStatus}. */
22
+
23
+ const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
24
+
25
+ export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_INPUT_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
@@ -1,2 +1,2 @@
1
1
  export { FunctionV1Beta1GenAPI as API } from './api.gen.js';
2
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES } from './content.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';
@@ -4,6 +4,39 @@ import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../he
4
4
 
5
5
  // This file was automatically generated. DO NOT EDIT.
6
6
 
7
+ const unmarshalTriggerNatsDeadLetter = data => {
8
+ if (!isJSONObject(data)) {
9
+ throw new TypeError(`Unmarshalling the type 'TriggerNatsDeadLetter' failed as data isn't a dictionary.`);
10
+ }
11
+
12
+ return {
13
+ mnqNamespaceId: data.mnq_namespace_id,
14
+ subject: data.subject
15
+ };
16
+ };
17
+
18
+ const unmarshalTriggerRetryPolicy = data => {
19
+ if (!isJSONObject(data)) {
20
+ throw new TypeError(`Unmarshalling the type 'TriggerRetryPolicy' failed as data isn't a dictionary.`);
21
+ }
22
+
23
+ return {
24
+ maxRetries: data.max_retries,
25
+ retryPeriod: data.retry_period
26
+ };
27
+ };
28
+
29
+ const unmarshalTriggerSqsDeadLetter = data => {
30
+ if (!isJSONObject(data)) {
31
+ throw new TypeError(`Unmarshalling the type 'TriggerSqsDeadLetter' failed as data isn't a dictionary.`);
32
+ }
33
+
34
+ return {
35
+ mnqNamespaceId: data.mnq_namespace_id,
36
+ queue: data.queue
37
+ };
38
+ };
39
+
7
40
  const unmarshalSecretHashedValue = data => {
8
41
  if (!isJSONObject(data)) {
9
42
  throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
@@ -15,6 +48,46 @@ const unmarshalSecretHashedValue = data => {
15
48
  };
16
49
  };
17
50
 
51
+ const unmarshalTriggerInputNatsClientConfig = data => {
52
+ if (!isJSONObject(data)) {
53
+ throw new TypeError(`Unmarshalling the type 'TriggerInputNatsClientConfig' failed as data isn't a dictionary.`);
54
+ }
55
+
56
+ return {
57
+ subject: data.subject
58
+ };
59
+ };
60
+
61
+ const unmarshalTriggerInputSqsClientConfig = data => {
62
+ if (!isJSONObject(data)) {
63
+ throw new TypeError(`Unmarshalling the type 'TriggerInputSqsClientConfig' failed as data isn't a dictionary.`);
64
+ }
65
+
66
+ return {
67
+ queue: data.queue
68
+ };
69
+ };
70
+
71
+ const unmarshalTriggerNatsFailureHandlingPolicy = data => {
72
+ if (!isJSONObject(data)) {
73
+ throw new TypeError(`Unmarshalling the type 'TriggerNatsFailureHandlingPolicy' failed as data isn't a dictionary.`);
74
+ }
75
+
76
+ return {
77
+ natsDeadLetter: data.nats_dead_letter ? unmarshalTriggerNatsDeadLetter(data.nats_dead_letter) : undefined,
78
+ retryPolicy: data.retry_policy ? unmarshalTriggerRetryPolicy(data.retry_policy) : undefined,
79
+ sqsDeadLetter: data.sqs_dead_letter ? unmarshalTriggerSqsDeadLetter(data.sqs_dead_letter) : undefined
80
+ };
81
+ };
82
+
83
+ const unmarshalTriggerSqsFailureHandlingPolicy = data => {
84
+ if (!isJSONObject(data)) {
85
+ throw new TypeError(`Unmarshalling the type 'TriggerSqsFailureHandlingPolicy' failed as data isn't a dictionary.`);
86
+ }
87
+
88
+ return {};
89
+ };
90
+
18
91
  const unmarshalCron = data => {
19
92
  if (!isJSONObject(data)) {
20
93
  throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
@@ -141,6 +214,37 @@ const unmarshalToken = data => {
141
214
  token: data.token
142
215
  };
143
216
  };
217
+ const unmarshalTrigger = data => {
218
+ if (!isJSONObject(data)) {
219
+ throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
220
+ }
221
+
222
+ return {
223
+ description: data.description,
224
+ errorMessage: data.error_message,
225
+ functionId: data.function_id,
226
+ id: data.id,
227
+ name: data.name,
228
+ natsFailureHandlingPolicy: data.nats_failure_handling_policy ? unmarshalTriggerNatsFailureHandlingPolicy(data.nats_failure_handling_policy) : undefined,
229
+ sqsFailureHandlingPolicy: data.sqs_failure_handling_policy ? unmarshalTriggerSqsFailureHandlingPolicy(data.sqs_failure_handling_policy) : undefined,
230
+ status: data.status,
231
+ type: data.type
232
+ };
233
+ };
234
+ const unmarshalTriggerInput = data => {
235
+ if (!isJSONObject(data)) {
236
+ throw new TypeError(`Unmarshalling the type 'TriggerInput' failed as data isn't a dictionary.`);
237
+ }
238
+
239
+ return {
240
+ errorMessage: data.error_message,
241
+ id: data.id,
242
+ mnqNamespaceId: data.mnq_namespace_id,
243
+ natsConfig: data.nats_config ? unmarshalTriggerInputNatsClientConfig(data.nats_config) : undefined,
244
+ sqsConfig: data.sqs_config ? unmarshalTriggerInputSqsClientConfig(data.sqs_config) : undefined,
245
+ status: data.status
246
+ };
247
+ };
144
248
  const unmarshalDownloadURL = data => {
145
249
  if (!isJSONObject(data)) {
146
250
  throw new TypeError(`Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`);
@@ -221,6 +325,35 @@ const unmarshalListTokensResponse = data => {
221
325
  totalCount: data.total_count
222
326
  };
223
327
  };
328
+ const unmarshalListTriggerInputsResponse = data => {
329
+ if (!isJSONObject(data)) {
330
+ throw new TypeError(`Unmarshalling the type 'ListTriggerInputsResponse' failed as data isn't a dictionary.`);
331
+ }
332
+
333
+ return {
334
+ inputs: unmarshalArrayOfObject(data.inputs, unmarshalTriggerInput),
335
+ totalCount: data.total_count
336
+ };
337
+ };
338
+ const unmarshalListTriggersResponse = data => {
339
+ if (!isJSONObject(data)) {
340
+ throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
341
+ }
342
+
343
+ return {
344
+ totalCount: data.total_count,
345
+ triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
346
+ };
347
+ };
348
+ const unmarshalSetTriggerInputsResponse = data => {
349
+ if (!isJSONObject(data)) {
350
+ throw new TypeError(`Unmarshalling the type 'SetTriggerInputsResponse' failed as data isn't a dictionary.`);
351
+ }
352
+
353
+ return {
354
+ triggerInputs: unmarshalArrayOfObject(data.trigger_inputs, unmarshalTriggerInput)
355
+ };
356
+ };
224
357
  const unmarshalUploadURL = data => {
225
358
  if (!isJSONObject(data)) {
226
359
  throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`);
@@ -232,11 +365,63 @@ const unmarshalUploadURL = data => {
232
365
  };
233
366
  };
234
367
 
368
+ const marshalCreateTriggerInputRequestNatsClientConfigSpec = (request, defaults) => ({
369
+ subject: request.subject
370
+ });
371
+
372
+ const marshalCreateTriggerInputRequestSqsClientConfigSpec = (request, defaults) => ({
373
+ queue: request.queue
374
+ });
375
+
376
+ const marshalCreateTriggerRequestNatsFailureHandlingPolicyNatsDeadLetter = (request, defaults) => ({
377
+ mnq_namespace_id: request.mnqNamespaceId,
378
+ subject: request.subject
379
+ });
380
+
381
+ const marshalCreateTriggerRequestNatsFailureHandlingPolicyRetryPolicy = (request, defaults) => ({
382
+ max_retries: request.maxRetries,
383
+ retry_period: request.retryPeriod
384
+ });
385
+
386
+ const marshalCreateTriggerRequestNatsFailureHandlingPolicySqsDeadLetter = (request, defaults) => ({
387
+ mnq_namespace_id: request.mnqNamespaceId,
388
+ queue: request.queue
389
+ });
390
+
391
+ const marshalCreateTriggerRequestNatsFailureHandlingPolicy = (request, defaults) => ({
392
+ retry_policy: request.retryPolicy ? marshalCreateTriggerRequestNatsFailureHandlingPolicyRetryPolicy(request.retryPolicy) : undefined,
393
+ ...resolveOneOf([{
394
+ param: 'nats_dead_letter',
395
+ value: request.natsDeadLetter ? marshalCreateTriggerRequestNatsFailureHandlingPolicyNatsDeadLetter(request.natsDeadLetter) : undefined
396
+ }, {
397
+ param: 'sqs_dead_letter',
398
+ value: request.sqsDeadLetter ? marshalCreateTriggerRequestNatsFailureHandlingPolicySqsDeadLetter(request.sqsDeadLetter) : undefined
399
+ }])
400
+ });
401
+
402
+ const marshalCreateTriggerRequestSqsFailureHandlingPolicy = (request, defaults) => ({});
403
+
235
404
  const marshalSecret = (request, defaults) => ({
236
405
  key: request.key,
237
406
  value: request.value
238
407
  });
239
408
 
409
+ const marshalSetTriggerInputsRequestNatsConfigs = (request, defaults) => ({
410
+ configs: request.configs.map(elt => marshalCreateTriggerInputRequestNatsClientConfigSpec(elt))
411
+ });
412
+
413
+ const marshalSetTriggerInputsRequestSqsConfigs = (request, defaults) => ({
414
+ configs: request.configs.map(elt => marshalCreateTriggerInputRequestSqsClientConfigSpec(elt))
415
+ });
416
+
417
+ const marshalUpdateTriggerInputRequestNatsClientConfigSpec = (request, defaults) => ({
418
+ subject: request.subject
419
+ });
420
+
421
+ const marshalUpdateTriggerInputRequestSqsClientConfigSpec = (request, defaults) => ({
422
+ queue: request.queue
423
+ });
424
+
240
425
  const marshalCreateCronRequest = (request, defaults) => ({
241
426
  args: request.args,
242
427
  function_id: request.functionId,
@@ -279,6 +464,40 @@ const marshalCreateTokenRequest = (request, defaults) => ({
279
464
  value: request.namespaceId
280
465
  }])
281
466
  });
467
+ const marshalCreateTriggerInputRequest = (request, defaults) => ({
468
+ mnq_namespace_id: request.mnqNamespaceId,
469
+ trigger_id: request.triggerId,
470
+ ...resolveOneOf([{
471
+ param: 'nats_config',
472
+ value: request.natsConfig ? marshalCreateTriggerInputRequestNatsClientConfigSpec(request.natsConfig) : undefined
473
+ }, {
474
+ param: 'sqs_config',
475
+ value: request.sqsConfig ? marshalCreateTriggerInputRequestSqsClientConfigSpec(request.sqsConfig) : undefined
476
+ }])
477
+ });
478
+ const marshalCreateTriggerRequest = (request, defaults) => ({
479
+ description: request.description,
480
+ function_id: request.functionId,
481
+ name: request.name,
482
+ type: request.type,
483
+ ...resolveOneOf([{
484
+ param: 'nats_failure_handling_policy',
485
+ value: request.natsFailureHandlingPolicy ? marshalCreateTriggerRequestNatsFailureHandlingPolicy(request.natsFailureHandlingPolicy) : undefined
486
+ }, {
487
+ param: 'sqs_failure_handling_policy',
488
+ value: request.sqsFailureHandlingPolicy ? marshalCreateTriggerRequestSqsFailureHandlingPolicy(request.sqsFailureHandlingPolicy) : undefined
489
+ }])
490
+ });
491
+ const marshalSetTriggerInputsRequest = (request, defaults) => ({
492
+ trigger_input_id: request.triggerInputId,
493
+ ...resolveOneOf([{
494
+ param: 'sqs',
495
+ value: request.sqs ? marshalSetTriggerInputsRequestSqsConfigs(request.sqs) : undefined
496
+ }, {
497
+ param: 'nats',
498
+ value: request.nats ? marshalSetTriggerInputsRequestNatsConfigs(request.nats) : undefined
499
+ }])
500
+ });
282
501
  const marshalUpdateCronRequest = (request, defaults) => ({
283
502
  args: request.args,
284
503
  function_id: request.functionId,
@@ -303,5 +522,24 @@ const marshalUpdateNamespaceRequest = (request, defaults) => ({
303
522
  environment_variables: request.environmentVariables,
304
523
  secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
305
524
  });
525
+ const marshalUpdateTriggerInputRequest = (request, defaults) => ({ ...resolveOneOf([{
526
+ param: 'nats_config',
527
+ value: request.natsConfig ? marshalUpdateTriggerInputRequestNatsClientConfigSpec(request.natsConfig) : undefined
528
+ }, {
529
+ param: 'sqs_config',
530
+ value: request.sqsConfig ? marshalUpdateTriggerInputRequestSqsClientConfigSpec(request.sqsConfig) : undefined
531
+ }])
532
+ });
533
+ const marshalUpdateTriggerRequest = (request, defaults) => ({
534
+ description: request.description,
535
+ name: request.name,
536
+ ...resolveOneOf([{
537
+ param: 'nats_config',
538
+ value: request.natsConfig ? marshalCreateTriggerRequestNatsFailureHandlingPolicy(request.natsConfig) : undefined
539
+ }, {
540
+ param: 'sqs_config',
541
+ value: request.sqsConfig ? marshalCreateTriggerRequestSqsFailureHandlingPolicy(request.sqsConfig) : undefined
542
+ }])
543
+ });
306
544
 
307
- export { marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateFunctionRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalUpdateCronRequest, marshalUpdateFunctionRequest, marshalUpdateNamespaceRequest, unmarshalCron, unmarshalDomain, unmarshalDownloadURL, unmarshalFunction, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalNamespace, unmarshalToken, unmarshalUploadURL };
545
+ 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 };
@@ -85,6 +85,11 @@ class IamV1Alpha1GenAPI extends API {
85
85
  path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
86
86
  }, unmarshalUser);
87
87
 
88
+ this.deleteUser = request => this.client.fetch({
89
+ method: 'DELETE',
90
+ path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
91
+ });
92
+
88
93
  this.pageOfListApplications = function (request) {
89
94
  if (request === void 0) {
90
95
  request = {};
@@ -14,7 +14,7 @@ const SECURITY_GROUP_TRANSIENT_STATUSES = ['syncing'];
14
14
  const SERVER_TRANSIENT_STATUSES = ['starting', 'stopping'];
15
15
  /** Lists transient statutes of the enum {@link SnapshotState}. */
16
16
 
17
- const SNAPSHOT_TRANSIENT_STATUSES = ['snapshotting'];
17
+ const SNAPSHOT_TRANSIENT_STATUSES = ['snapshotting', 'importing', 'exporting'];
18
18
  /** Lists transient statutes of the enum {@link TaskStatus}. */
19
19
 
20
20
  const TASK_TRANSIENT_STATUSES = ['pending', 'started', 'retry'];
@@ -203,6 +203,7 @@ const unmarshalBackend = data => {
203
203
  pool: data.pool,
204
204
  proxyProtocol: data.proxy_protocol,
205
205
  sendProxyV2: data.send_proxy_v2,
206
+ sslBridging: data.ssl_bridging,
206
207
  stickySessions: data.sticky_sessions,
207
208
  stickySessionsCookieName: data.sticky_sessions_cookie_name,
208
209
  timeoutConnect: data.timeout_connect,
@@ -639,6 +640,7 @@ const marshalCreateBackendRequest = (request, defaults) => ({
639
640
  proxy_protocol: request.proxyProtocol,
640
641
  send_proxy_v2: request.sendProxyV2,
641
642
  server_ip: request.serverIp,
643
+ ssl_bridging: request.sslBridging,
642
644
  sticky_sessions: request.stickySessions,
643
645
  sticky_sessions_cookie_name: request.stickySessionsCookieName,
644
646
  timeout_connect: request.timeoutConnect,
@@ -743,6 +745,7 @@ const marshalUpdateBackendRequest = (request, defaults) => ({
743
745
  on_marked_down_action: request.onMarkedDownAction,
744
746
  proxy_protocol: request.proxyProtocol,
745
747
  send_proxy_v2: request.sendProxyV2,
748
+ ssl_bridging: request.sslBridging,
746
749
  sticky_sessions: request.stickySessions,
747
750
  sticky_sessions_cookie_name: request.stickySessionsCookieName,
748
751
  timeout_connect: request.timeoutConnect,
@@ -840,6 +843,7 @@ const marshalZonedApiCreateBackendRequest = (request, defaults) => ({
840
843
  proxy_protocol: request.proxyProtocol,
841
844
  send_proxy_v2: request.sendProxyV2,
842
845
  server_ip: request.serverIp,
846
+ ssl_bridging: request.sslBridging,
843
847
  sticky_sessions: request.stickySessions,
844
848
  sticky_sessions_cookie_name: request.stickySessionsCookieName,
845
849
  timeout_connect: request.timeoutConnect,
@@ -947,6 +951,7 @@ const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({
947
951
  on_marked_down_action: request.onMarkedDownAction,
948
952
  proxy_protocol: request.proxyProtocol,
949
953
  send_proxy_v2: request.sendProxyV2,
954
+ ssl_bridging: request.sslBridging,
950
955
  sticky_sessions: request.stickySessions,
951
956
  sticky_sessions_cookie_name: request.stickySessionsCookieName,
952
957
  timeout_connect: request.timeoutConnect,
@@ -28,7 +28,7 @@ class MnqV1Alpha1GenAPI extends API {
28
28
  return _this.client.fetch({
29
29
  method: 'GET',
30
30
  path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
31
- urlParams: urlParams(['order_by', request.orderBy ?? 'id_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
31
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
32
32
  }, unmarshalListNamespacesResponse);
33
33
  };
34
34
 
@@ -1,5 +1,5 @@
1
1
  import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
2
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
5
 
@@ -92,12 +92,14 @@ const unmarshalNamespace = data => {
92
92
  }
93
93
 
94
94
  return {
95
+ createdAt: unmarshalDate(data.created_at),
95
96
  endpoint: data.endpoint,
96
97
  id: data.id,
97
98
  name: data.name,
98
99
  projectId: data.project_id,
99
100
  protocol: data.protocol,
100
- region: data.region
101
+ region: data.region,
102
+ updatedAt: unmarshalDate(data.updated_at)
101
103
  };
102
104
  };
103
105
  const unmarshalCredential = data => {