@scaleway/sdk 3.0.0-alpha.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { EMAIL_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalEmail, unmarshalListEmailsResponse, unmarshalStatistics, marshalCreateDomainRequest, unmarshalDomain, unmarshalListDomainsResponse, unmarshalDomainLastStatus } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Transactional Email API. */
|
|
15
|
-
class API extends API$1 {
|
|
16
|
-
/** Lists the available regions of the API. */
|
|
17
|
-
static LOCALITIES = ['fr-par'];
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Send an email. You must specify the `region`, the sender and the
|
|
21
|
-
* recipient's information and the `project_id` to send an email from a
|
|
22
|
-
* checked domain. The subject of the email must contain at least 6
|
|
23
|
-
* characters.
|
|
24
|
-
*
|
|
25
|
-
* @param request - The request {@link CreateEmailRequest}
|
|
26
|
-
* @returns A Promise of CreateEmailResponse
|
|
27
|
-
*/
|
|
28
|
-
createEmail = request => this.client.fetch({
|
|
29
|
-
body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),
|
|
30
|
-
headers: jsonContentHeaders,
|
|
31
|
-
method: 'POST',
|
|
32
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`
|
|
33
|
-
}, unmarshalCreateEmailResponse);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Get an email. Retrieve information about a specific email using the
|
|
37
|
-
* `email_id` and `region` parameters.
|
|
38
|
-
*
|
|
39
|
-
* @param request - The request {@link GetEmailRequest}
|
|
40
|
-
* @returns A Promise of Email
|
|
41
|
-
*/
|
|
42
|
-
getEmail = request => this.client.fetch({
|
|
43
|
-
method: 'GET',
|
|
44
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}`
|
|
45
|
-
}, unmarshalEmail);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Waits for {@link Email} to be in a final state.
|
|
49
|
-
*
|
|
50
|
-
* @param request - The request {@link GetEmailRequest}
|
|
51
|
-
* @param options - The waiting options
|
|
52
|
-
* @returns A Promise of Email
|
|
53
|
-
*/
|
|
54
|
-
waitForEmail = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options);
|
|
55
|
-
pageOfListEmails = (() => {
|
|
56
|
-
var _this = this;
|
|
57
|
-
return function (request) {
|
|
58
|
-
if (request === void 0) {
|
|
59
|
-
request = {};
|
|
60
|
-
}
|
|
61
|
-
return _this.client.fetch({
|
|
62
|
-
method: 'GET',
|
|
63
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/emails`,
|
|
64
|
-
urlParams: urlParams(['domain_id', request.domainId], ['flags', request.flags], ['mail_from', request.mailFrom], ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['search', request.search], ['since', request.since], ['statuses', request.statuses], ['subject', request.subject], ['until', request.until])
|
|
65
|
-
}, unmarshalListEmailsResponse);
|
|
66
|
-
};
|
|
67
|
-
})();
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* List emails. Retrieve the list of emails sent from a specific domain or for
|
|
71
|
-
* a specific Project or Organization. You must specify the `region`.
|
|
72
|
-
*
|
|
73
|
-
* @param request - The request {@link ListEmailsRequest}
|
|
74
|
-
* @returns A Promise of ListEmailsResponse
|
|
75
|
-
*/
|
|
76
|
-
listEmails = (() => {
|
|
77
|
-
var _this2 = this;
|
|
78
|
-
return function (request) {
|
|
79
|
-
if (request === void 0) {
|
|
80
|
-
request = {};
|
|
81
|
-
}
|
|
82
|
-
return enrichForPagination('emails', _this2.pageOfListEmails, request);
|
|
83
|
-
};
|
|
84
|
-
})();
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Email statuses. Get information on your emails' statuses.
|
|
88
|
-
*
|
|
89
|
-
* @param request - The request {@link GetStatisticsRequest}
|
|
90
|
-
* @returns A Promise of Statistics
|
|
91
|
-
*/
|
|
92
|
-
getStatistics = (() => {
|
|
93
|
-
var _this3 = this;
|
|
94
|
-
return function (request) {
|
|
95
|
-
if (request === void 0) {
|
|
96
|
-
request = {};
|
|
97
|
-
}
|
|
98
|
-
return _this3.client.fetch({
|
|
99
|
-
method: 'GET',
|
|
100
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/statistics`,
|
|
101
|
-
urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['project_id', request.projectId], ['since', request.since], ['until', request.until])
|
|
102
|
-
}, unmarshalStatistics);
|
|
103
|
-
};
|
|
104
|
-
})();
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Cancel an email. You can cancel the sending of an email if it has not been
|
|
108
|
-
* sent yet. You must specify the `region` and the `email_id` of the email you
|
|
109
|
-
* want to cancel.
|
|
110
|
-
*
|
|
111
|
-
* @param request - The request {@link CancelEmailRequest}
|
|
112
|
-
* @returns A Promise of Email
|
|
113
|
-
*/
|
|
114
|
-
cancelEmail = request => this.client.fetch({
|
|
115
|
-
body: '{}',
|
|
116
|
-
headers: jsonContentHeaders,
|
|
117
|
-
method: 'POST',
|
|
118
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}/cancel`
|
|
119
|
-
}, unmarshalEmail);
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Register a domain in a project. You must specify the `region`, `project_id`
|
|
123
|
-
* and `domain_name` to register a domain in a specific Project.
|
|
124
|
-
*
|
|
125
|
-
* @param request - The request {@link CreateDomainRequest}
|
|
126
|
-
* @returns A Promise of Domain
|
|
127
|
-
*/
|
|
128
|
-
createDomain = request => this.client.fetch({
|
|
129
|
-
body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
|
|
130
|
-
headers: jsonContentHeaders,
|
|
131
|
-
method: 'POST',
|
|
132
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
|
|
133
|
-
}, unmarshalDomain);
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Get information about a domain. Retrieve information about a specific
|
|
137
|
-
* domain using the `region` and `domain_id` parameters.
|
|
138
|
-
*
|
|
139
|
-
* @param request - The request {@link GetDomainRequest}
|
|
140
|
-
* @returns A Promise of Domain
|
|
141
|
-
*/
|
|
142
|
-
getDomain = request => this.client.fetch({
|
|
143
|
-
method: 'GET',
|
|
144
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
|
|
145
|
-
}, unmarshalDomain);
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Waits for {@link Domain} to be in a final state.
|
|
149
|
-
*
|
|
150
|
-
* @param request - The request {@link GetDomainRequest}
|
|
151
|
-
* @param options - The waiting options
|
|
152
|
-
* @returns A Promise of Domain
|
|
153
|
-
*/
|
|
154
|
-
waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
|
|
155
|
-
pageOfListDomains = (() => {
|
|
156
|
-
var _this4 = this;
|
|
157
|
-
return function (request) {
|
|
158
|
-
if (request === void 0) {
|
|
159
|
-
request = {};
|
|
160
|
-
}
|
|
161
|
-
return _this4.client.fetch({
|
|
162
|
-
method: 'GET',
|
|
163
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/domains`,
|
|
164
|
-
urlParams: urlParams(['name', request.name], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status])
|
|
165
|
-
}, unmarshalListDomainsResponse);
|
|
166
|
-
};
|
|
167
|
-
})();
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* List domains. Retrieve domains in a specific project or in a specific
|
|
171
|
-
* Organization using the `region` parameter.
|
|
172
|
-
*
|
|
173
|
-
* @param request - The request {@link ListDomainsRequest}
|
|
174
|
-
* @returns A Promise of ListDomainsResponse
|
|
175
|
-
*/
|
|
176
|
-
listDomains = (() => {
|
|
177
|
-
var _this5 = this;
|
|
178
|
-
return function (request) {
|
|
179
|
-
if (request === void 0) {
|
|
180
|
-
request = {};
|
|
181
|
-
}
|
|
182
|
-
return enrichForPagination('domains', _this5.pageOfListDomains, request);
|
|
183
|
-
};
|
|
184
|
-
})();
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Delete a domain. You must specify the domain you want to delete by the
|
|
188
|
-
* `region` and `domain_id`. Deleting a domain is permanent and cannot be
|
|
189
|
-
* undone.
|
|
190
|
-
*
|
|
191
|
-
* @param request - The request {@link RevokeDomainRequest}
|
|
192
|
-
* @returns A Promise of Domain
|
|
193
|
-
*/
|
|
194
|
-
revokeDomain = request => this.client.fetch({
|
|
195
|
-
body: '{}',
|
|
196
|
-
headers: jsonContentHeaders,
|
|
197
|
-
method: 'POST',
|
|
198
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/revoke`
|
|
199
|
-
}, unmarshalDomain);
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Domain DNS check. Perform an immediate DNS check of a domain using the
|
|
203
|
-
* `region` and `domain_id` parameters.
|
|
204
|
-
*
|
|
205
|
-
* @param request - The request {@link CheckDomainRequest}
|
|
206
|
-
* @returns A Promise of Domain
|
|
207
|
-
*/
|
|
208
|
-
checkDomain = request => this.client.fetch({
|
|
209
|
-
body: '{}',
|
|
210
|
-
headers: jsonContentHeaders,
|
|
211
|
-
method: 'POST',
|
|
212
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/check`
|
|
213
|
-
}, unmarshalDomain);
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Display SPF and DKIM records status and potential errors. Display SPF and
|
|
217
|
-
* DKIM records status and potential errors, including the found records to
|
|
218
|
-
* make debugging easier.
|
|
219
|
-
*
|
|
220
|
-
* @param request - The request {@link GetDomainLastStatusRequest}
|
|
221
|
-
* @returns A Promise of DomainLastStatus
|
|
222
|
-
*/
|
|
223
|
-
getDomainLastStatus = request => this.client.fetch({
|
|
224
|
-
method: 'GET',
|
|
225
|
-
path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/verification`
|
|
226
|
-
}, unmarshalDomainLastStatus);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export { API };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link DomainStatus}. */
|
|
5
|
-
const DOMAIN_TRANSIENT_STATUSES = ['pending'];
|
|
6
|
-
|
|
7
|
-
/** Lists transient statutes of the enum {@link EmailStatus}. */
|
|
8
|
-
const EMAIL_TRANSIENT_STATUSES = ['new', 'sending'];
|
|
9
|
-
|
|
10
|
-
export { DOMAIN_TRANSIENT_STATUSES, EMAIL_TRANSIENT_STATUSES };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
-
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
3
|
-
|
|
4
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
6
|
-
const unmarshalEmailTry = data => {
|
|
7
|
-
if (!isJSONObject(data)) {
|
|
8
|
-
throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`);
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
code: data.code,
|
|
12
|
-
message: data.message,
|
|
13
|
-
rank: data.rank,
|
|
14
|
-
triedAt: unmarshalDate(data.tried_at)
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const unmarshalEmail = data => {
|
|
18
|
-
if (!isJSONObject(data)) {
|
|
19
|
-
throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
createdAt: unmarshalDate(data.created_at),
|
|
23
|
-
flags: data.flags,
|
|
24
|
-
id: data.id,
|
|
25
|
-
lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
|
|
26
|
-
mailFrom: data.mail_from,
|
|
27
|
-
mailRcpt: data.mail_rcpt,
|
|
28
|
-
messageId: data.message_id,
|
|
29
|
-
projectId: data.project_id,
|
|
30
|
-
rcptTo: data.rcpt_to ? data.rcpt_to : undefined,
|
|
31
|
-
rcptType: data.rcpt_type,
|
|
32
|
-
status: data.status,
|
|
33
|
-
statusDetails: data.status_details ? data.status_details : undefined,
|
|
34
|
-
subject: data.subject,
|
|
35
|
-
tryCount: data.try_count,
|
|
36
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const unmarshalDomainStatistics = data => {
|
|
40
|
-
if (!isJSONObject(data)) {
|
|
41
|
-
throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
canceledCount: data.canceled_count,
|
|
45
|
-
failedCount: data.failed_count,
|
|
46
|
-
sentCount: data.sent_count,
|
|
47
|
-
totalCount: data.total_count
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
const unmarshalDomain = data => {
|
|
51
|
-
if (!isJSONObject(data)) {
|
|
52
|
-
throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
createdAt: unmarshalDate(data.created_at),
|
|
56
|
-
dkimConfig: data.dkim_config,
|
|
57
|
-
id: data.id,
|
|
58
|
-
lastError: data.last_error ? data.last_error : undefined,
|
|
59
|
-
lastValidAt: unmarshalDate(data.last_valid_at),
|
|
60
|
-
name: data.name,
|
|
61
|
-
nextCheckAt: unmarshalDate(data.next_check_at),
|
|
62
|
-
organizationId: data.organization_id,
|
|
63
|
-
projectId: data.project_id,
|
|
64
|
-
region: data.region,
|
|
65
|
-
revokedAt: unmarshalDate(data.revoked_at),
|
|
66
|
-
spfConfig: data.spf_config,
|
|
67
|
-
statistics: unmarshalDomainStatistics(data.statistics),
|
|
68
|
-
status: data.status
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const unmarshalCreateEmailResponse = data => {
|
|
72
|
-
if (!isJSONObject(data)) {
|
|
73
|
-
throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
const unmarshalDomainLastStatusDkimRecord = data => {
|
|
80
|
-
if (!isJSONObject(data)) {
|
|
81
|
-
throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
error: data.error ? data.error : undefined,
|
|
85
|
-
lastValidAt: unmarshalDate(data.last_valid_at),
|
|
86
|
-
status: data.status
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
const unmarshalDomainLastStatusSpfRecord = data => {
|
|
90
|
-
if (!isJSONObject(data)) {
|
|
91
|
-
throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
error: data.error ? data.error : undefined,
|
|
95
|
-
lastValidAt: unmarshalDate(data.last_valid_at),
|
|
96
|
-
status: data.status
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const unmarshalDomainLastStatus = data => {
|
|
100
|
-
if (!isJSONObject(data)) {
|
|
101
|
-
throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
dkimRecord: unmarshalDomainLastStatusDkimRecord(data.dkim_record),
|
|
105
|
-
domainId: data.domain_id,
|
|
106
|
-
domainName: data.domain_name,
|
|
107
|
-
spfRecord: unmarshalDomainLastStatusSpfRecord(data.spf_record)
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
const unmarshalListDomainsResponse = data => {
|
|
111
|
-
if (!isJSONObject(data)) {
|
|
112
|
-
throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
|
|
116
|
-
totalCount: data.total_count
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
const unmarshalListEmailsResponse = data => {
|
|
120
|
-
if (!isJSONObject(data)) {
|
|
121
|
-
throw new TypeError(`Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`);
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
emails: unmarshalArrayOfObject(data.emails, unmarshalEmail),
|
|
125
|
-
totalCount: data.total_count
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
const unmarshalStatistics = data => {
|
|
129
|
-
if (!isJSONObject(data)) {
|
|
130
|
-
throw new TypeError(`Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`);
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
canceledCount: data.canceled_count,
|
|
134
|
-
failedCount: data.failed_count,
|
|
135
|
-
newCount: data.new_count,
|
|
136
|
-
sendingCount: data.sending_count,
|
|
137
|
-
sentCount: data.sent_count,
|
|
138
|
-
totalCount: data.total_count
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
142
|
-
accept_tos: request.acceptTos,
|
|
143
|
-
domain_name: request.domainName,
|
|
144
|
-
project_id: request.projectId ?? defaults.defaultProjectId
|
|
145
|
-
});
|
|
146
|
-
const marshalCreateEmailRequest = (request, defaults) => ({
|
|
147
|
-
attachments: request.attachments,
|
|
148
|
-
bcc: request.bcc,
|
|
149
|
-
cc: request.cc,
|
|
150
|
-
from: request.from,
|
|
151
|
-
html: request.html,
|
|
152
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
153
|
-
send_before: request.sendBefore,
|
|
154
|
-
subject: request.subject,
|
|
155
|
-
text: request.text,
|
|
156
|
-
to: request.to
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
export { marshalCreateDomainRequest, marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalDomainLastStatus, unmarshalEmail, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalStatistics };
|
package/dist/api/test/index.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { HUMAN_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalRegisterRequest, unmarshalRegisterResponse, unmarshalListHumansResponse, unmarshalHuman, marshalCreateHumanRequest, marshalUpdateHumanRequest } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Fake API.
|
|
16
|
-
*
|
|
17
|
-
* No Auth Service for end-to-end testing.
|
|
18
|
-
*/
|
|
19
|
-
class API extends API$1 {
|
|
20
|
-
/**
|
|
21
|
-
* Register a user. Register a human and return a access-key and a secret-key
|
|
22
|
-
* that must be used in all other commands.
|
|
23
|
-
*
|
|
24
|
-
* Hint: you can use other test commands by setting the SCW_SECRET_KEY env
|
|
25
|
-
* variable.
|
|
26
|
-
*
|
|
27
|
-
* @param request - The request {@link RegisterRequest}
|
|
28
|
-
* @returns A Promise of RegisterResponse
|
|
29
|
-
*/
|
|
30
|
-
register = request => this.client.fetch({
|
|
31
|
-
body: JSON.stringify(marshalRegisterRequest(request, this.client.settings)),
|
|
32
|
-
headers: jsonContentHeaders,
|
|
33
|
-
method: 'POST',
|
|
34
|
-
path: `/test/v1/register`
|
|
35
|
-
}, unmarshalRegisterResponse);
|
|
36
|
-
pageOfListHumans = (() => {
|
|
37
|
-
var _this = this;
|
|
38
|
-
return function (request) {
|
|
39
|
-
if (request === void 0) {
|
|
40
|
-
request = {};
|
|
41
|
-
}
|
|
42
|
-
return _this.client.fetch({
|
|
43
|
-
method: 'GET',
|
|
44
|
-
path: `/test/v1/humans`,
|
|
45
|
-
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
46
|
-
}, unmarshalListHumansResponse);
|
|
47
|
-
};
|
|
48
|
-
})();
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* List all your humans.
|
|
52
|
-
*
|
|
53
|
-
* @param request - The request {@link ListHumansRequest}
|
|
54
|
-
* @returns A Promise of ListHumansResponse
|
|
55
|
-
*/
|
|
56
|
-
listHumans = (() => {
|
|
57
|
-
var _this2 = this;
|
|
58
|
-
return function (request) {
|
|
59
|
-
if (request === void 0) {
|
|
60
|
-
request = {};
|
|
61
|
-
}
|
|
62
|
-
return enrichForPagination('humans', _this2.pageOfListHumans, request);
|
|
63
|
-
};
|
|
64
|
-
})();
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Get human details. Get the human details associated with the given id.
|
|
68
|
-
*
|
|
69
|
-
* @param request - The request {@link GetHumanRequest}
|
|
70
|
-
* @returns A Promise of Human
|
|
71
|
-
*/
|
|
72
|
-
getHuman = request => this.client.fetch({
|
|
73
|
-
method: 'GET',
|
|
74
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
75
|
-
}, unmarshalHuman);
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Waits for {@link Human} to be in a final state.
|
|
79
|
-
*
|
|
80
|
-
* @param request - The request {@link GetHumanRequest}
|
|
81
|
-
* @param options - The waiting options
|
|
82
|
-
* @returns A Promise of Human
|
|
83
|
-
*/
|
|
84
|
-
waitForHuman = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES.includes(res.status))), this.getHuman, request, options);
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Create a new human.
|
|
88
|
-
*
|
|
89
|
-
* @param request - The request {@link CreateHumanRequest}
|
|
90
|
-
* @returns A Promise of Human
|
|
91
|
-
*/
|
|
92
|
-
createHuman = request => this.client.fetch({
|
|
93
|
-
body: JSON.stringify(marshalCreateHumanRequest(request, this.client.settings)),
|
|
94
|
-
headers: jsonContentHeaders,
|
|
95
|
-
method: 'POST',
|
|
96
|
-
path: `/test/v1/humans`
|
|
97
|
-
}, unmarshalHuman);
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Update an existing human. Update the human associated with the given id.
|
|
101
|
-
*
|
|
102
|
-
* @param request - The request {@link UpdateHumanRequest}
|
|
103
|
-
* @returns A Promise of Human
|
|
104
|
-
*/
|
|
105
|
-
updateHuman = request => this.client.fetch({
|
|
106
|
-
body: JSON.stringify(marshalUpdateHumanRequest(request, this.client.settings)),
|
|
107
|
-
headers: jsonContentHeaders,
|
|
108
|
-
method: 'PATCH',
|
|
109
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
110
|
-
}, unmarshalHuman);
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Delete an existing human. Delete the human associated with the given id.
|
|
114
|
-
*
|
|
115
|
-
* @param request - The request {@link DeleteHumanRequest}
|
|
116
|
-
* @returns A Promise of Human
|
|
117
|
-
*/
|
|
118
|
-
deleteHuman = request => this.client.fetch({
|
|
119
|
-
method: 'DELETE',
|
|
120
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`
|
|
121
|
-
}, unmarshalHuman);
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Start a 1h running for the given human. Start a one hour running for the
|
|
125
|
-
* given human.
|
|
126
|
-
*
|
|
127
|
-
* @param request - The request {@link RunHumanRequest}
|
|
128
|
-
* @returns A Promise of Human
|
|
129
|
-
*/
|
|
130
|
-
runHuman = request => this.client.fetch({
|
|
131
|
-
body: '{}',
|
|
132
|
-
headers: jsonContentHeaders,
|
|
133
|
-
method: 'POST',
|
|
134
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/run`
|
|
135
|
-
}, unmarshalHuman);
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Make a human smoke.
|
|
139
|
-
*
|
|
140
|
-
* @deprecated
|
|
141
|
-
* @param request - The request {@link SmokeHumanRequest}
|
|
142
|
-
* @returns A Promise of Human
|
|
143
|
-
*/
|
|
144
|
-
smokeHuman = request => this.client.fetch({
|
|
145
|
-
body: '{}',
|
|
146
|
-
headers: jsonContentHeaders,
|
|
147
|
-
method: 'POST',
|
|
148
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/smoke`
|
|
149
|
-
}, unmarshalHuman);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export { API };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link HumanStatus}. */
|
|
5
|
-
const HUMAN_TRANSIENT_STATUSES = ['running'];
|
|
6
|
-
|
|
7
|
-
export { HUMAN_TRANSIENT_STATUSES };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
-
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
|
-
|
|
4
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
6
|
-
const unmarshalHuman = data => {
|
|
7
|
-
if (!isJSONObject(data)) {
|
|
8
|
-
throw new TypeError(`Unmarshalling the type 'Human' failed as data isn't a dictionary.`);
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
altitudeInMeter: data.altitude_in_meter,
|
|
12
|
-
altitudeInMillimeter: data.altitude_in_millimeter,
|
|
13
|
-
createdAt: unmarshalDate(data.created_at),
|
|
14
|
-
eyesColor: data.eyes_color,
|
|
15
|
-
fingersCount: data.fingers_count,
|
|
16
|
-
hairCount: data.hair_count,
|
|
17
|
-
height: data.height,
|
|
18
|
-
id: data.id,
|
|
19
|
-
isHappy: data.is_happy,
|
|
20
|
-
name: data.name,
|
|
21
|
-
organizationId: data.organization_id,
|
|
22
|
-
projectId: data.project_id,
|
|
23
|
-
shoeSize: data.shoe_size,
|
|
24
|
-
status: data.status,
|
|
25
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
const unmarshalListHumansResponse = data => {
|
|
29
|
-
if (!isJSONObject(data)) {
|
|
30
|
-
throw new TypeError(`Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
humans: unmarshalArrayOfObject(data.humans, unmarshalHuman),
|
|
34
|
-
totalCount: data.total_count
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const unmarshalRegisterResponse = data => {
|
|
38
|
-
if (!isJSONObject(data)) {
|
|
39
|
-
throw new TypeError(`Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.`);
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
accessKey: data.access_key,
|
|
43
|
-
secretKey: data.secret_key
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
const marshalCreateHumanRequest = (request, defaults) => ({
|
|
47
|
-
altitude_in_meter: request.altitudeInMeter,
|
|
48
|
-
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
49
|
-
eyes_color: request.eyesColor,
|
|
50
|
-
fingers_count: request.fingersCount,
|
|
51
|
-
hair_count: request.hairCount,
|
|
52
|
-
height: request.height,
|
|
53
|
-
is_happy: request.isHappy,
|
|
54
|
-
name: request.name,
|
|
55
|
-
shoe_size: request.shoeSize,
|
|
56
|
-
...resolveOneOf([{
|
|
57
|
-
param: 'organization_id',
|
|
58
|
-
value: request.organizationId
|
|
59
|
-
}, {
|
|
60
|
-
param: 'project_id',
|
|
61
|
-
value: request.projectId
|
|
62
|
-
}])
|
|
63
|
-
});
|
|
64
|
-
const marshalRegisterRequest = (request, defaults) => ({
|
|
65
|
-
username: request.username
|
|
66
|
-
});
|
|
67
|
-
const marshalUpdateHumanRequest = (request, defaults) => ({
|
|
68
|
-
altitude_in_meter: request.altitudeInMeter,
|
|
69
|
-
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
70
|
-
eyes_color: request.eyesColor,
|
|
71
|
-
fingers_count: request.fingersCount,
|
|
72
|
-
hair_count: request.hairCount,
|
|
73
|
-
height: request.height,
|
|
74
|
-
is_happy: request.isHappy,
|
|
75
|
-
name: request.name,
|
|
76
|
-
shoe_size: request.shoeSize
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
export { marshalCreateHumanRequest, marshalRegisterRequest, marshalUpdateHumanRequest, unmarshalHuman, unmarshalListHumansResponse, unmarshalRegisterResponse };
|
package/dist/api/vpc/index.js
DELETED