@aws-sdk/client-account 3.267.0 → 3.270.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/Account.js +60 -0
- package/dist-cjs/commands/DisableRegionCommand.js +46 -0
- package/dist-cjs/commands/EnableRegionCommand.js +46 -0
- package/dist-cjs/commands/GetRegionOptStatusCommand.js +46 -0
- package/dist-cjs/commands/ListRegionsCommand.js +46 -0
- package/dist-cjs/commands/index.js +4 -0
- package/dist-cjs/endpoint/ruleset.js +3 -3
- package/dist-cjs/index.js +1 -0
- package/dist-cjs/models/models_0.js +62 -1
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListRegionsPaginator.js +36 -0
- package/dist-cjs/pagination/index.js +5 -0
- package/dist-cjs/protocols/Aws_restJson1.js +330 -1
- package/dist-es/Account.js +60 -0
- package/dist-es/commands/DisableRegionCommand.js +42 -0
- package/dist-es/commands/EnableRegionCommand.js +42 -0
- package/dist-es/commands/GetRegionOptStatusCommand.js +42 -0
- package/dist-es/commands/ListRegionsCommand.js +42 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/endpoint/ruleset.js +3 -3
- package/dist-es/index.js +1 -0
- package/dist-es/models/models_0.js +52 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListRegionsPaginator.js +32 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +322 -1
- package/dist-types/Account.d.ts +38 -8
- package/dist-types/AccountClient.d.ts +6 -2
- package/dist-types/commands/DeleteAlternateContactCommand.d.ts +2 -2
- package/dist-types/commands/DisableRegionCommand.d.ts +37 -0
- package/dist-types/commands/EnableRegionCommand.d.ts +37 -0
- package/dist-types/commands/GetAlternateContactCommand.d.ts +2 -2
- package/dist-types/commands/GetContactInformationCommand.d.ts +1 -1
- package/dist-types/commands/GetRegionOptStatusCommand.d.ts +37 -0
- package/dist-types/commands/ListRegionsCommand.d.ts +39 -0
- package/dist-types/commands/PutAlternateContactCommand.d.ts +2 -2
- package/dist-types/commands/PutContactInformationCommand.d.ts +1 -1
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +259 -6
- package/dist-types/pagination/Interfaces.d.ts +6 -0
- package/dist-types/pagination/ListRegionsPaginator.d.ts +4 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +12 -0
- package/dist-types/ts3.4/Account.d.ts +68 -0
- package/dist-types/ts3.4/AccountClient.d.ts +24 -0
- package/dist-types/ts3.4/commands/DisableRegionCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/EnableRegionCommand.d.ts +32 -0
- package/dist-types/ts3.4/commands/GetRegionOptStatusCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/ListRegionsCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +74 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
- package/dist-types/ts3.4/pagination/ListRegionsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +48 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeAws_restJson1PutContactInformationCommand = exports.deserializeAws_restJson1PutAlternateContactCommand = exports.deserializeAws_restJson1GetContactInformationCommand = exports.deserializeAws_restJson1GetAlternateContactCommand = exports.deserializeAws_restJson1DeleteAlternateContactCommand = exports.serializeAws_restJson1PutContactInformationCommand = exports.serializeAws_restJson1PutAlternateContactCommand = exports.serializeAws_restJson1GetContactInformationCommand = exports.serializeAws_restJson1GetAlternateContactCommand = exports.serializeAws_restJson1DeleteAlternateContactCommand = void 0;
|
|
3
|
+
exports.deserializeAws_restJson1PutContactInformationCommand = exports.deserializeAws_restJson1PutAlternateContactCommand = exports.deserializeAws_restJson1ListRegionsCommand = exports.deserializeAws_restJson1GetRegionOptStatusCommand = exports.deserializeAws_restJson1GetContactInformationCommand = exports.deserializeAws_restJson1GetAlternateContactCommand = exports.deserializeAws_restJson1EnableRegionCommand = exports.deserializeAws_restJson1DisableRegionCommand = exports.deserializeAws_restJson1DeleteAlternateContactCommand = exports.serializeAws_restJson1PutContactInformationCommand = exports.serializeAws_restJson1PutAlternateContactCommand = exports.serializeAws_restJson1ListRegionsCommand = exports.serializeAws_restJson1GetRegionOptStatusCommand = exports.serializeAws_restJson1GetContactInformationCommand = exports.serializeAws_restJson1GetAlternateContactCommand = exports.serializeAws_restJson1EnableRegionCommand = exports.serializeAws_restJson1DisableRegionCommand = exports.serializeAws_restJson1DeleteAlternateContactCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const AccountServiceException_1 = require("../models/AccountServiceException");
|
|
@@ -27,6 +27,50 @@ const serializeAws_restJson1DeleteAlternateContactCommand = async (input, contex
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
exports.serializeAws_restJson1DeleteAlternateContactCommand = serializeAws_restJson1DeleteAlternateContactCommand;
|
|
30
|
+
const serializeAws_restJson1DisableRegionCommand = async (input, context) => {
|
|
31
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
+
const headers = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
};
|
|
35
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/disableRegion";
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify({
|
|
38
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
39
|
+
...(input.RegionName != null && { RegionName: input.RegionName }),
|
|
40
|
+
});
|
|
41
|
+
return new protocol_http_1.HttpRequest({
|
|
42
|
+
protocol,
|
|
43
|
+
hostname,
|
|
44
|
+
port,
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers,
|
|
47
|
+
path: resolvedPath,
|
|
48
|
+
body,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.serializeAws_restJson1DisableRegionCommand = serializeAws_restJson1DisableRegionCommand;
|
|
52
|
+
const serializeAws_restJson1EnableRegionCommand = async (input, context) => {
|
|
53
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
54
|
+
const headers = {
|
|
55
|
+
"content-type": "application/json",
|
|
56
|
+
};
|
|
57
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/enableRegion";
|
|
58
|
+
let body;
|
|
59
|
+
body = JSON.stringify({
|
|
60
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
61
|
+
...(input.RegionName != null && { RegionName: input.RegionName }),
|
|
62
|
+
});
|
|
63
|
+
return new protocol_http_1.HttpRequest({
|
|
64
|
+
protocol,
|
|
65
|
+
hostname,
|
|
66
|
+
port,
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers,
|
|
69
|
+
path: resolvedPath,
|
|
70
|
+
body,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
exports.serializeAws_restJson1EnableRegionCommand = serializeAws_restJson1EnableRegionCommand;
|
|
30
74
|
const serializeAws_restJson1GetAlternateContactCommand = async (input, context) => {
|
|
31
75
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
76
|
const headers = {
|
|
@@ -70,6 +114,54 @@ const serializeAws_restJson1GetContactInformationCommand = async (input, context
|
|
|
70
114
|
});
|
|
71
115
|
};
|
|
72
116
|
exports.serializeAws_restJson1GetContactInformationCommand = serializeAws_restJson1GetContactInformationCommand;
|
|
117
|
+
const serializeAws_restJson1GetRegionOptStatusCommand = async (input, context) => {
|
|
118
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
119
|
+
const headers = {
|
|
120
|
+
"content-type": "application/json",
|
|
121
|
+
};
|
|
122
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getRegionOptStatus";
|
|
123
|
+
let body;
|
|
124
|
+
body = JSON.stringify({
|
|
125
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
126
|
+
...(input.RegionName != null && { RegionName: input.RegionName }),
|
|
127
|
+
});
|
|
128
|
+
return new protocol_http_1.HttpRequest({
|
|
129
|
+
protocol,
|
|
130
|
+
hostname,
|
|
131
|
+
port,
|
|
132
|
+
method: "POST",
|
|
133
|
+
headers,
|
|
134
|
+
path: resolvedPath,
|
|
135
|
+
body,
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
exports.serializeAws_restJson1GetRegionOptStatusCommand = serializeAws_restJson1GetRegionOptStatusCommand;
|
|
139
|
+
const serializeAws_restJson1ListRegionsCommand = async (input, context) => {
|
|
140
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
141
|
+
const headers = {
|
|
142
|
+
"content-type": "application/json",
|
|
143
|
+
};
|
|
144
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listRegions";
|
|
145
|
+
let body;
|
|
146
|
+
body = JSON.stringify({
|
|
147
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
148
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
149
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
150
|
+
...(input.RegionOptStatusContains != null && {
|
|
151
|
+
RegionOptStatusContains: serializeAws_restJson1RegionOptStatusList(input.RegionOptStatusContains, context),
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
return new protocol_http_1.HttpRequest({
|
|
155
|
+
protocol,
|
|
156
|
+
hostname,
|
|
157
|
+
port,
|
|
158
|
+
method: "POST",
|
|
159
|
+
headers,
|
|
160
|
+
path: resolvedPath,
|
|
161
|
+
body,
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
exports.serializeAws_restJson1ListRegionsCommand = serializeAws_restJson1ListRegionsCommand;
|
|
73
165
|
const serializeAws_restJson1PutAlternateContactCommand = async (input, context) => {
|
|
74
166
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
75
167
|
const headers = {
|
|
@@ -163,6 +255,92 @@ const deserializeAws_restJson1DeleteAlternateContactCommandError = async (output
|
|
|
163
255
|
});
|
|
164
256
|
}
|
|
165
257
|
};
|
|
258
|
+
const deserializeAws_restJson1DisableRegionCommand = async (output, context) => {
|
|
259
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
260
|
+
return deserializeAws_restJson1DisableRegionCommandError(output, context);
|
|
261
|
+
}
|
|
262
|
+
const contents = map({
|
|
263
|
+
$metadata: deserializeMetadata(output),
|
|
264
|
+
});
|
|
265
|
+
await collectBody(output.body, context);
|
|
266
|
+
return contents;
|
|
267
|
+
};
|
|
268
|
+
exports.deserializeAws_restJson1DisableRegionCommand = deserializeAws_restJson1DisableRegionCommand;
|
|
269
|
+
const deserializeAws_restJson1DisableRegionCommandError = async (output, context) => {
|
|
270
|
+
const parsedOutput = {
|
|
271
|
+
...output,
|
|
272
|
+
body: await parseErrorBody(output.body, context),
|
|
273
|
+
};
|
|
274
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
275
|
+
switch (errorCode) {
|
|
276
|
+
case "AccessDeniedException":
|
|
277
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
278
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
279
|
+
case "ConflictException":
|
|
280
|
+
case "com.amazonaws.account#ConflictException":
|
|
281
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
282
|
+
case "InternalServerException":
|
|
283
|
+
case "com.amazonaws.account#InternalServerException":
|
|
284
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
285
|
+
case "TooManyRequestsException":
|
|
286
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
287
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
288
|
+
case "ValidationException":
|
|
289
|
+
case "com.amazonaws.account#ValidationException":
|
|
290
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
291
|
+
default:
|
|
292
|
+
const parsedBody = parsedOutput.body;
|
|
293
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
294
|
+
output,
|
|
295
|
+
parsedBody,
|
|
296
|
+
exceptionCtor: AccountServiceException_1.AccountServiceException,
|
|
297
|
+
errorCode,
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const deserializeAws_restJson1EnableRegionCommand = async (output, context) => {
|
|
302
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
303
|
+
return deserializeAws_restJson1EnableRegionCommandError(output, context);
|
|
304
|
+
}
|
|
305
|
+
const contents = map({
|
|
306
|
+
$metadata: deserializeMetadata(output),
|
|
307
|
+
});
|
|
308
|
+
await collectBody(output.body, context);
|
|
309
|
+
return contents;
|
|
310
|
+
};
|
|
311
|
+
exports.deserializeAws_restJson1EnableRegionCommand = deserializeAws_restJson1EnableRegionCommand;
|
|
312
|
+
const deserializeAws_restJson1EnableRegionCommandError = async (output, context) => {
|
|
313
|
+
const parsedOutput = {
|
|
314
|
+
...output,
|
|
315
|
+
body: await parseErrorBody(output.body, context),
|
|
316
|
+
};
|
|
317
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
318
|
+
switch (errorCode) {
|
|
319
|
+
case "AccessDeniedException":
|
|
320
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
321
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
322
|
+
case "ConflictException":
|
|
323
|
+
case "com.amazonaws.account#ConflictException":
|
|
324
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
325
|
+
case "InternalServerException":
|
|
326
|
+
case "com.amazonaws.account#InternalServerException":
|
|
327
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
328
|
+
case "TooManyRequestsException":
|
|
329
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
330
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
331
|
+
case "ValidationException":
|
|
332
|
+
case "com.amazonaws.account#ValidationException":
|
|
333
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
334
|
+
default:
|
|
335
|
+
const parsedBody = parsedOutput.body;
|
|
336
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
337
|
+
output,
|
|
338
|
+
parsedBody,
|
|
339
|
+
exceptionCtor: AccountServiceException_1.AccountServiceException,
|
|
340
|
+
errorCode,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
};
|
|
166
344
|
const deserializeAws_restJson1GetAlternateContactCommand = async (output, context) => {
|
|
167
345
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
168
346
|
return deserializeAws_restJson1GetAlternateContactCommandError(output, context);
|
|
@@ -255,6 +433,98 @@ const deserializeAws_restJson1GetContactInformationCommandError = async (output,
|
|
|
255
433
|
});
|
|
256
434
|
}
|
|
257
435
|
};
|
|
436
|
+
const deserializeAws_restJson1GetRegionOptStatusCommand = async (output, context) => {
|
|
437
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
438
|
+
return deserializeAws_restJson1GetRegionOptStatusCommandError(output, context);
|
|
439
|
+
}
|
|
440
|
+
const contents = map({
|
|
441
|
+
$metadata: deserializeMetadata(output),
|
|
442
|
+
});
|
|
443
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
444
|
+
if (data.RegionName != null) {
|
|
445
|
+
contents.RegionName = (0, smithy_client_1.expectString)(data.RegionName);
|
|
446
|
+
}
|
|
447
|
+
if (data.RegionOptStatus != null) {
|
|
448
|
+
contents.RegionOptStatus = (0, smithy_client_1.expectString)(data.RegionOptStatus);
|
|
449
|
+
}
|
|
450
|
+
return contents;
|
|
451
|
+
};
|
|
452
|
+
exports.deserializeAws_restJson1GetRegionOptStatusCommand = deserializeAws_restJson1GetRegionOptStatusCommand;
|
|
453
|
+
const deserializeAws_restJson1GetRegionOptStatusCommandError = async (output, context) => {
|
|
454
|
+
const parsedOutput = {
|
|
455
|
+
...output,
|
|
456
|
+
body: await parseErrorBody(output.body, context),
|
|
457
|
+
};
|
|
458
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
459
|
+
switch (errorCode) {
|
|
460
|
+
case "AccessDeniedException":
|
|
461
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
462
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
463
|
+
case "InternalServerException":
|
|
464
|
+
case "com.amazonaws.account#InternalServerException":
|
|
465
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
466
|
+
case "TooManyRequestsException":
|
|
467
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
468
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
469
|
+
case "ValidationException":
|
|
470
|
+
case "com.amazonaws.account#ValidationException":
|
|
471
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
472
|
+
default:
|
|
473
|
+
const parsedBody = parsedOutput.body;
|
|
474
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
475
|
+
output,
|
|
476
|
+
parsedBody,
|
|
477
|
+
exceptionCtor: AccountServiceException_1.AccountServiceException,
|
|
478
|
+
errorCode,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
const deserializeAws_restJson1ListRegionsCommand = async (output, context) => {
|
|
483
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
484
|
+
return deserializeAws_restJson1ListRegionsCommandError(output, context);
|
|
485
|
+
}
|
|
486
|
+
const contents = map({
|
|
487
|
+
$metadata: deserializeMetadata(output),
|
|
488
|
+
});
|
|
489
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
490
|
+
if (data.NextToken != null) {
|
|
491
|
+
contents.NextToken = (0, smithy_client_1.expectString)(data.NextToken);
|
|
492
|
+
}
|
|
493
|
+
if (data.Regions != null) {
|
|
494
|
+
contents.Regions = deserializeAws_restJson1RegionOptList(data.Regions, context);
|
|
495
|
+
}
|
|
496
|
+
return contents;
|
|
497
|
+
};
|
|
498
|
+
exports.deserializeAws_restJson1ListRegionsCommand = deserializeAws_restJson1ListRegionsCommand;
|
|
499
|
+
const deserializeAws_restJson1ListRegionsCommandError = async (output, context) => {
|
|
500
|
+
const parsedOutput = {
|
|
501
|
+
...output,
|
|
502
|
+
body: await parseErrorBody(output.body, context),
|
|
503
|
+
};
|
|
504
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
505
|
+
switch (errorCode) {
|
|
506
|
+
case "AccessDeniedException":
|
|
507
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
508
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
509
|
+
case "InternalServerException":
|
|
510
|
+
case "com.amazonaws.account#InternalServerException":
|
|
511
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
512
|
+
case "TooManyRequestsException":
|
|
513
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
514
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
515
|
+
case "ValidationException":
|
|
516
|
+
case "com.amazonaws.account#ValidationException":
|
|
517
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
518
|
+
default:
|
|
519
|
+
const parsedBody = parsedOutput.body;
|
|
520
|
+
(0, smithy_client_1.throwDefaultError)({
|
|
521
|
+
output,
|
|
522
|
+
parsedBody,
|
|
523
|
+
exceptionCtor: AccountServiceException_1.AccountServiceException,
|
|
524
|
+
errorCode,
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
};
|
|
258
528
|
const deserializeAws_restJson1PutAlternateContactCommand = async (output, context) => {
|
|
259
529
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
260
530
|
return deserializeAws_restJson1PutAlternateContactCommandError(output, context);
|
|
@@ -348,6 +618,18 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
|
|
|
348
618
|
});
|
|
349
619
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
350
620
|
};
|
|
621
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
622
|
+
const contents = map({});
|
|
623
|
+
const data = parsedOutput.body;
|
|
624
|
+
if (data.message != null) {
|
|
625
|
+
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
626
|
+
}
|
|
627
|
+
const exception = new models_0_1.ConflictException({
|
|
628
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
629
|
+
...contents,
|
|
630
|
+
});
|
|
631
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
632
|
+
};
|
|
351
633
|
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
352
634
|
const contents = map({});
|
|
353
635
|
const data = parsedOutput.body;
|
|
@@ -387,9 +669,15 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
|
|
|
387
669
|
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
388
670
|
const contents = map({});
|
|
389
671
|
const data = parsedOutput.body;
|
|
672
|
+
if (data.fieldList != null) {
|
|
673
|
+
contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
|
|
674
|
+
}
|
|
390
675
|
if (data.message != null) {
|
|
391
676
|
contents.message = (0, smithy_client_1.expectString)(data.message);
|
|
392
677
|
}
|
|
678
|
+
if (data.reason != null) {
|
|
679
|
+
contents.reason = (0, smithy_client_1.expectString)(data.reason);
|
|
680
|
+
}
|
|
393
681
|
const exception = new models_0_1.ValidationException({
|
|
394
682
|
$metadata: deserializeMetadata(parsedOutput),
|
|
395
683
|
...contents,
|
|
@@ -412,6 +700,13 @@ const serializeAws_restJson1ContactInformation = (input, context) => {
|
|
|
412
700
|
...(input.WebsiteUrl != null && { WebsiteUrl: input.WebsiteUrl }),
|
|
413
701
|
};
|
|
414
702
|
};
|
|
703
|
+
const serializeAws_restJson1RegionOptStatusList = (input, context) => {
|
|
704
|
+
return input
|
|
705
|
+
.filter((e) => e != null)
|
|
706
|
+
.map((entry) => {
|
|
707
|
+
return entry;
|
|
708
|
+
});
|
|
709
|
+
};
|
|
415
710
|
const deserializeAws_restJson1AlternateContact = (output, context) => {
|
|
416
711
|
return {
|
|
417
712
|
AlternateContactType: (0, smithy_client_1.expectString)(output.AlternateContactType),
|
|
@@ -437,6 +732,40 @@ const deserializeAws_restJson1ContactInformation = (output, context) => {
|
|
|
437
732
|
WebsiteUrl: (0, smithy_client_1.expectString)(output.WebsiteUrl),
|
|
438
733
|
};
|
|
439
734
|
};
|
|
735
|
+
const deserializeAws_restJson1Region = (output, context) => {
|
|
736
|
+
return {
|
|
737
|
+
RegionName: (0, smithy_client_1.expectString)(output.RegionName),
|
|
738
|
+
RegionOptStatus: (0, smithy_client_1.expectString)(output.RegionOptStatus),
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
const deserializeAws_restJson1RegionOptList = (output, context) => {
|
|
742
|
+
const retVal = (output || [])
|
|
743
|
+
.filter((e) => e != null)
|
|
744
|
+
.map((entry) => {
|
|
745
|
+
if (entry === null) {
|
|
746
|
+
return null;
|
|
747
|
+
}
|
|
748
|
+
return deserializeAws_restJson1Region(entry, context);
|
|
749
|
+
});
|
|
750
|
+
return retVal;
|
|
751
|
+
};
|
|
752
|
+
const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
|
|
753
|
+
return {
|
|
754
|
+
message: (0, smithy_client_1.expectString)(output.message),
|
|
755
|
+
name: (0, smithy_client_1.expectString)(output.name),
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
|
|
759
|
+
const retVal = (output || [])
|
|
760
|
+
.filter((e) => e != null)
|
|
761
|
+
.map((entry) => {
|
|
762
|
+
if (entry === null) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
return deserializeAws_restJson1ValidationExceptionField(entry, context);
|
|
766
|
+
});
|
|
767
|
+
return retVal;
|
|
768
|
+
};
|
|
440
769
|
const deserializeMetadata = (output) => ({
|
|
441
770
|
httpStatusCode: output.statusCode,
|
|
442
771
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-es/Account.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AccountClient } from "./AccountClient";
|
|
2
2
|
import { DeleteAlternateContactCommand, } from "./commands/DeleteAlternateContactCommand";
|
|
3
|
+
import { DisableRegionCommand, } from "./commands/DisableRegionCommand";
|
|
4
|
+
import { EnableRegionCommand, } from "./commands/EnableRegionCommand";
|
|
3
5
|
import { GetAlternateContactCommand, } from "./commands/GetAlternateContactCommand";
|
|
4
6
|
import { GetContactInformationCommand, } from "./commands/GetContactInformationCommand";
|
|
7
|
+
import { GetRegionOptStatusCommand, } from "./commands/GetRegionOptStatusCommand";
|
|
8
|
+
import { ListRegionsCommand } from "./commands/ListRegionsCommand";
|
|
5
9
|
import { PutAlternateContactCommand, } from "./commands/PutAlternateContactCommand";
|
|
6
10
|
import { PutContactInformationCommand, } from "./commands/PutContactInformationCommand";
|
|
7
11
|
export class Account extends AccountClient {
|
|
@@ -19,6 +23,34 @@ export class Account extends AccountClient {
|
|
|
19
23
|
return this.send(command, optionsOrCb);
|
|
20
24
|
}
|
|
21
25
|
}
|
|
26
|
+
disableRegion(args, optionsOrCb, cb) {
|
|
27
|
+
const command = new DisableRegionCommand(args);
|
|
28
|
+
if (typeof optionsOrCb === "function") {
|
|
29
|
+
this.send(command, optionsOrCb);
|
|
30
|
+
}
|
|
31
|
+
else if (typeof cb === "function") {
|
|
32
|
+
if (typeof optionsOrCb !== "object")
|
|
33
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
34
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return this.send(command, optionsOrCb);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
enableRegion(args, optionsOrCb, cb) {
|
|
41
|
+
const command = new EnableRegionCommand(args);
|
|
42
|
+
if (typeof optionsOrCb === "function") {
|
|
43
|
+
this.send(command, optionsOrCb);
|
|
44
|
+
}
|
|
45
|
+
else if (typeof cb === "function") {
|
|
46
|
+
if (typeof optionsOrCb !== "object")
|
|
47
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
48
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return this.send(command, optionsOrCb);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
22
54
|
getAlternateContact(args, optionsOrCb, cb) {
|
|
23
55
|
const command = new GetAlternateContactCommand(args);
|
|
24
56
|
if (typeof optionsOrCb === "function") {
|
|
@@ -47,6 +79,34 @@ export class Account extends AccountClient {
|
|
|
47
79
|
return this.send(command, optionsOrCb);
|
|
48
80
|
}
|
|
49
81
|
}
|
|
82
|
+
getRegionOptStatus(args, optionsOrCb, cb) {
|
|
83
|
+
const command = new GetRegionOptStatusCommand(args);
|
|
84
|
+
if (typeof optionsOrCb === "function") {
|
|
85
|
+
this.send(command, optionsOrCb);
|
|
86
|
+
}
|
|
87
|
+
else if (typeof cb === "function") {
|
|
88
|
+
if (typeof optionsOrCb !== "object")
|
|
89
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
90
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return this.send(command, optionsOrCb);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
listRegions(args, optionsOrCb, cb) {
|
|
97
|
+
const command = new ListRegionsCommand(args);
|
|
98
|
+
if (typeof optionsOrCb === "function") {
|
|
99
|
+
this.send(command, optionsOrCb);
|
|
100
|
+
}
|
|
101
|
+
else if (typeof cb === "function") {
|
|
102
|
+
if (typeof optionsOrCb !== "object")
|
|
103
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
104
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
return this.send(command, optionsOrCb);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
50
110
|
putAlternateContact(args, optionsOrCb, cb) {
|
|
51
111
|
const command = new PutAlternateContactCommand(args);
|
|
52
112
|
if (typeof optionsOrCb === "function") {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { DisableRegionRequestFilterSensitiveLog } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1DisableRegionCommand, serializeAws_restJson1DisableRegionCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class DisableRegionCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, DisableRegionCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "AccountClient";
|
|
25
|
+
const commandName = "DisableRegionCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: DisableRegionRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: (output) => output,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1DisableRegionCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1DisableRegionCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { EnableRegionRequestFilterSensitiveLog } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1EnableRegionCommand, serializeAws_restJson1EnableRegionCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class EnableRegionCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, EnableRegionCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "AccountClient";
|
|
25
|
+
const commandName = "EnableRegionCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: EnableRegionRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: (output) => output,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1EnableRegionCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1EnableRegionCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { GetRegionOptStatusRequestFilterSensitiveLog, GetRegionOptStatusResponseFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1GetRegionOptStatusCommand, serializeAws_restJson1GetRegionOptStatusCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class GetRegionOptStatusCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, GetRegionOptStatusCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "AccountClient";
|
|
25
|
+
const commandName = "GetRegionOptStatusCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: GetRegionOptStatusRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: GetRegionOptStatusResponseFilterSensitiveLog,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1GetRegionOptStatusCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1GetRegionOptStatusCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { ListRegionsRequestFilterSensitiveLog, ListRegionsResponseFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1ListRegionsCommand, serializeAws_restJson1ListRegionsCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class ListRegionsCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, ListRegionsCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "AccountClient";
|
|
25
|
+
const commandName = "ListRegionsCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: ListRegionsRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: ListRegionsResponseFilterSensitiveLog,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1ListRegionsCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1ListRegionsCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from "./DeleteAlternateContactCommand";
|
|
2
|
+
export * from "./DisableRegionCommand";
|
|
3
|
+
export * from "./EnableRegionCommand";
|
|
2
4
|
export * from "./GetAlternateContactCommand";
|
|
3
5
|
export * from "./GetContactInformationCommand";
|
|
6
|
+
export * from "./GetRegionOptStatusCommand";
|
|
7
|
+
export * from "./ListRegionsCommand";
|
|
4
8
|
export * from "./PutAlternateContactCommand";
|
|
5
9
|
export * from "./PutContactInformationCommand";
|