@aws-sdk/client-outposts 3.30.0 → 3.34.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/CHANGELOG.md +38 -0
- package/Outposts.ts +27 -0
- package/OutpostsClient.ts +3 -0
- package/README.md +7 -7
- package/commands/CreateOrderCommand.ts +94 -0
- package/dist/cjs/Outposts.js +15 -0
- package/dist/cjs/Outposts.js.map +1 -1
- package/dist/cjs/OutpostsClient.js +13 -13
- package/dist/cjs/OutpostsClient.js.map +1 -1
- package/dist/cjs/commands/CreateOrderCommand.js +61 -0
- package/dist/cjs/commands/CreateOrderCommand.js.map +1 -0
- package/dist/cjs/commands/CreateOutpostCommand.js +3 -3
- package/dist/cjs/commands/CreateOutpostCommand.js.map +1 -1
- package/dist/cjs/commands/DeleteOutpostCommand.js +3 -3
- package/dist/cjs/commands/DeleteOutpostCommand.js.map +1 -1
- package/dist/cjs/commands/DeleteSiteCommand.js +3 -3
- package/dist/cjs/commands/DeleteSiteCommand.js.map +1 -1
- package/dist/cjs/commands/GetOutpostCommand.js +3 -3
- package/dist/cjs/commands/GetOutpostCommand.js.map +1 -1
- package/dist/cjs/commands/GetOutpostInstanceTypesCommand.js +3 -3
- package/dist/cjs/commands/GetOutpostInstanceTypesCommand.js.map +1 -1
- package/dist/cjs/commands/ListOutpostsCommand.js +3 -3
- package/dist/cjs/commands/ListOutpostsCommand.js.map +1 -1
- package/dist/cjs/commands/ListSitesCommand.js +3 -3
- package/dist/cjs/commands/ListSitesCommand.js.map +1 -1
- package/dist/cjs/commands/ListTagsForResourceCommand.js +3 -3
- package/dist/cjs/commands/ListTagsForResourceCommand.js.map +1 -1
- package/dist/cjs/commands/TagResourceCommand.js +3 -3
- package/dist/cjs/commands/TagResourceCommand.js.map +1 -1
- package/dist/cjs/commands/UntagResourceCommand.js +3 -3
- package/dist/cjs/commands/UntagResourceCommand.js.map +1 -1
- package/dist/cjs/endpoints.js +1 -1
- package/dist/cjs/endpoints.js.map +1 -1
- package/dist/cjs/index.js +17 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/models/index.js +1 -1
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/cjs/models/models_0.js +77 -13
- package/dist/cjs/models/models_0.js.map +1 -1
- package/dist/cjs/package.json +39 -39
- package/dist/cjs/protocols/Aws_restJson1.js +211 -44
- package/dist/cjs/protocols/Aws_restJson1.js.map +1 -1
- package/dist/cjs/runtimeConfig.browser.js +4 -4
- package/dist/cjs/runtimeConfig.browser.js.map +1 -1
- package/dist/cjs/runtimeConfig.js +8 -8
- package/dist/cjs/runtimeConfig.js.map +1 -1
- package/dist/cjs/runtimeConfig.native.js +1 -1
- package/dist/cjs/runtimeConfig.native.js.map +1 -1
- package/dist/es/Outposts.js +16 -8
- package/dist/es/Outposts.js.map +1 -1
- package/dist/es/OutpostsClient.js +1 -13
- package/dist/es/OutpostsClient.js.map +1 -1
- package/dist/es/commands/CreateOrderCommand.js +40 -0
- package/dist/es/commands/CreateOrderCommand.js.map +1 -0
- package/dist/es/commands/CreateOutpostCommand.js +2 -28
- package/dist/es/commands/CreateOutpostCommand.js.map +1 -1
- package/dist/es/commands/DeleteOutpostCommand.js +2 -27
- package/dist/es/commands/DeleteOutpostCommand.js.map +1 -1
- package/dist/es/commands/DeleteSiteCommand.js +2 -27
- package/dist/es/commands/DeleteSiteCommand.js.map +1 -1
- package/dist/es/commands/GetOutpostCommand.js +2 -27
- package/dist/es/commands/GetOutpostCommand.js.map +1 -1
- package/dist/es/commands/GetOutpostInstanceTypesCommand.js +2 -27
- package/dist/es/commands/GetOutpostInstanceTypesCommand.js.map +1 -1
- package/dist/es/commands/ListOutpostsCommand.js +2 -32
- package/dist/es/commands/ListOutpostsCommand.js.map +1 -1
- package/dist/es/commands/ListSitesCommand.js +2 -27
- package/dist/es/commands/ListSitesCommand.js.map +1 -1
- package/dist/es/commands/ListTagsForResourceCommand.js +2 -27
- package/dist/es/commands/ListTagsForResourceCommand.js.map +1 -1
- package/dist/es/commands/TagResourceCommand.js +2 -27
- package/dist/es/commands/TagResourceCommand.js.map +1 -1
- package/dist/es/commands/UntagResourceCommand.js +2 -27
- package/dist/es/commands/UntagResourceCommand.js.map +1 -1
- package/dist/es/endpoints.js +1 -1
- package/dist/es/endpoints.js.map +1 -1
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/models_0.js +51 -99
- package/dist/es/models/models_0.js.map +1 -1
- package/dist/es/package.json +39 -39
- package/dist/es/pagination/ListOutpostsPaginator.js +16 -28
- package/dist/es/pagination/ListOutpostsPaginator.js.map +1 -1
- package/dist/es/pagination/ListSitesPaginator.js +16 -28
- package/dist/es/pagination/ListSitesPaginator.js.map +1 -1
- package/dist/es/protocols/Aws_restJson1.js +421 -248
- package/dist/es/protocols/Aws_restJson1.js.map +1 -1
- package/dist/es/runtimeConfig.browser.js +0 -3
- package/dist/es/runtimeConfig.browser.js.map +1 -1
- package/dist/es/runtimeConfig.js +0 -3
- package/dist/es/runtimeConfig.js.map +1 -1
- package/dist/es/runtimeConfig.native.js +0 -3
- package/dist/es/runtimeConfig.native.js.map +1 -1
- package/dist/es/runtimeConfig.shared.js +0 -3
- package/dist/es/runtimeConfig.shared.js.map +1 -1
- package/dist/types/Outposts.d.ts +7 -0
- package/dist/types/OutpostsClient.d.ts +3 -2
- package/dist/types/commands/CreateOrderCommand.d.ts +35 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/models_0.d.ts +207 -54
- package/dist/types/protocols/Aws_restJson1.d.ts +3 -0
- package/dist/types/runtimeConfig.browser.d.ts +1 -0
- package/dist/types/runtimeConfig.d.ts +1 -0
- package/dist/types/runtimeConfig.native.d.ts +1 -0
- package/dist/types/ts3.4/Outposts.d.ts +7 -0
- package/dist/types/ts3.4/OutpostsClient.d.ts +3 -2
- package/dist/types/ts3.4/commands/CreateOrderCommand.d.ts +35 -0
- package/dist/types/ts3.4/index.d.ts +1 -0
- package/dist/types/ts3.4/models/models_0.d.ts +207 -54
- package/dist/types/ts3.4/protocols/Aws_restJson1.d.ts +3 -0
- package/dist/types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist/types/ts3.4/runtimeConfig.d.ts +1 -0
- package/dist/types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/index.ts +1 -0
- package/models/models_0.ts +239 -50
- package/package.json +39 -39
- package/protocols/Aws_restJson1.ts +195 -0
- package/tsconfig.es.json +0 -2
- package/tsconfig.json +3 -5
- package/tsconfig.types.json +8 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CreateOrderCommandInput, CreateOrderCommandOutput } from "../commands/CreateOrderCommand";
|
|
1
2
|
import { CreateOutpostCommandInput, CreateOutpostCommandOutput } from "../commands/CreateOutpostCommand";
|
|
2
3
|
import { DeleteOutpostCommandInput, DeleteOutpostCommandOutput } from "../commands/DeleteOutpostCommand";
|
|
3
4
|
import { DeleteSiteCommandInput, DeleteSiteCommandOutput } from "../commands/DeleteSiteCommand";
|
|
@@ -19,7 +20,10 @@ import {
|
|
|
19
20
|
ConflictException,
|
|
20
21
|
InstanceTypeItem,
|
|
21
22
|
InternalServerException,
|
|
23
|
+
LineItem,
|
|
24
|
+
LineItemRequest,
|
|
22
25
|
NotFoundException,
|
|
26
|
+
Order,
|
|
23
27
|
Outpost,
|
|
24
28
|
ServiceQuotaExceededException,
|
|
25
29
|
Site,
|
|
@@ -27,10 +31,13 @@ import {
|
|
|
27
31
|
} from "../models/models_0";
|
|
28
32
|
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
29
33
|
import {
|
|
34
|
+
expectInt32 as __expectInt32,
|
|
30
35
|
expectNonNull as __expectNonNull,
|
|
36
|
+
expectNumber as __expectNumber,
|
|
31
37
|
expectObject as __expectObject,
|
|
32
38
|
expectString as __expectString,
|
|
33
39
|
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
40
|
+
parseEpochTimestamp as __parseEpochTimestamp,
|
|
34
41
|
} from "@aws-sdk/smithy-client";
|
|
35
42
|
import {
|
|
36
43
|
Endpoint as __Endpoint,
|
|
@@ -40,6 +47,37 @@ import {
|
|
|
40
47
|
SmithyException as __SmithyException,
|
|
41
48
|
} from "@aws-sdk/types";
|
|
42
49
|
|
|
50
|
+
export const serializeAws_restJson1CreateOrderCommand = async (
|
|
51
|
+
input: CreateOrderCommandInput,
|
|
52
|
+
context: __SerdeContext
|
|
53
|
+
): Promise<__HttpRequest> => {
|
|
54
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
55
|
+
const headers: any = {
|
|
56
|
+
"content-type": "application/json",
|
|
57
|
+
};
|
|
58
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/orders";
|
|
59
|
+
let body: any;
|
|
60
|
+
body = JSON.stringify({
|
|
61
|
+
...(input.LineItems !== undefined &&
|
|
62
|
+
input.LineItems !== null && {
|
|
63
|
+
LineItems: serializeAws_restJson1LineItemRequestListDefinition(input.LineItems, context),
|
|
64
|
+
}),
|
|
65
|
+
...(input.OutpostIdentifier !== undefined &&
|
|
66
|
+
input.OutpostIdentifier !== null && { OutpostIdentifier: input.OutpostIdentifier }),
|
|
67
|
+
...(input.PaymentOption !== undefined && input.PaymentOption !== null && { PaymentOption: input.PaymentOption }),
|
|
68
|
+
...(input.PaymentTerm !== undefined && input.PaymentTerm !== null && { PaymentTerm: input.PaymentTerm }),
|
|
69
|
+
});
|
|
70
|
+
return new __HttpRequest({
|
|
71
|
+
protocol,
|
|
72
|
+
hostname,
|
|
73
|
+
port,
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers,
|
|
76
|
+
path: resolvedPath,
|
|
77
|
+
body,
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
43
81
|
export const serializeAws_restJson1CreateOutpostCommand = async (
|
|
44
82
|
input: CreateOutpostCommandInput,
|
|
45
83
|
context: __SerdeContext
|
|
@@ -339,6 +377,101 @@ export const serializeAws_restJson1UntagResourceCommand = async (
|
|
|
339
377
|
});
|
|
340
378
|
};
|
|
341
379
|
|
|
380
|
+
export const deserializeAws_restJson1CreateOrderCommand = async (
|
|
381
|
+
output: __HttpResponse,
|
|
382
|
+
context: __SerdeContext
|
|
383
|
+
): Promise<CreateOrderCommandOutput> => {
|
|
384
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
385
|
+
return deserializeAws_restJson1CreateOrderCommandError(output, context);
|
|
386
|
+
}
|
|
387
|
+
const contents: CreateOrderCommandOutput = {
|
|
388
|
+
$metadata: deserializeMetadata(output),
|
|
389
|
+
Order: undefined,
|
|
390
|
+
};
|
|
391
|
+
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
392
|
+
if (data.Order !== undefined && data.Order !== null) {
|
|
393
|
+
contents.Order = deserializeAws_restJson1Order(data.Order, context);
|
|
394
|
+
}
|
|
395
|
+
return Promise.resolve(contents);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
const deserializeAws_restJson1CreateOrderCommandError = async (
|
|
399
|
+
output: __HttpResponse,
|
|
400
|
+
context: __SerdeContext
|
|
401
|
+
): Promise<CreateOrderCommandOutput> => {
|
|
402
|
+
const parsedOutput: any = {
|
|
403
|
+
...output,
|
|
404
|
+
body: await parseBody(output.body, context),
|
|
405
|
+
};
|
|
406
|
+
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
407
|
+
let errorCode: string = "UnknownError";
|
|
408
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
409
|
+
switch (errorCode) {
|
|
410
|
+
case "AccessDeniedException":
|
|
411
|
+
case "com.amazonaws.outposts#AccessDeniedException":
|
|
412
|
+
response = {
|
|
413
|
+
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
414
|
+
name: errorCode,
|
|
415
|
+
$metadata: deserializeMetadata(output),
|
|
416
|
+
};
|
|
417
|
+
break;
|
|
418
|
+
case "ConflictException":
|
|
419
|
+
case "com.amazonaws.outposts#ConflictException":
|
|
420
|
+
response = {
|
|
421
|
+
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
422
|
+
name: errorCode,
|
|
423
|
+
$metadata: deserializeMetadata(output),
|
|
424
|
+
};
|
|
425
|
+
break;
|
|
426
|
+
case "InternalServerException":
|
|
427
|
+
case "com.amazonaws.outposts#InternalServerException":
|
|
428
|
+
response = {
|
|
429
|
+
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
430
|
+
name: errorCode,
|
|
431
|
+
$metadata: deserializeMetadata(output),
|
|
432
|
+
};
|
|
433
|
+
break;
|
|
434
|
+
case "NotFoundException":
|
|
435
|
+
case "com.amazonaws.outposts#NotFoundException":
|
|
436
|
+
response = {
|
|
437
|
+
...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
|
|
438
|
+
name: errorCode,
|
|
439
|
+
$metadata: deserializeMetadata(output),
|
|
440
|
+
};
|
|
441
|
+
break;
|
|
442
|
+
case "ServiceQuotaExceededException":
|
|
443
|
+
case "com.amazonaws.outposts#ServiceQuotaExceededException":
|
|
444
|
+
response = {
|
|
445
|
+
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
446
|
+
name: errorCode,
|
|
447
|
+
$metadata: deserializeMetadata(output),
|
|
448
|
+
};
|
|
449
|
+
break;
|
|
450
|
+
case "ValidationException":
|
|
451
|
+
case "com.amazonaws.outposts#ValidationException":
|
|
452
|
+
response = {
|
|
453
|
+
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
454
|
+
name: errorCode,
|
|
455
|
+
$metadata: deserializeMetadata(output),
|
|
456
|
+
};
|
|
457
|
+
break;
|
|
458
|
+
default:
|
|
459
|
+
const parsedBody = parsedOutput.body;
|
|
460
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
461
|
+
response = {
|
|
462
|
+
...parsedBody,
|
|
463
|
+
name: `${errorCode}`,
|
|
464
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
465
|
+
$fault: "client",
|
|
466
|
+
$metadata: deserializeMetadata(output),
|
|
467
|
+
} as any;
|
|
468
|
+
}
|
|
469
|
+
const message = response.message || response.Message || errorCode;
|
|
470
|
+
response.message = message;
|
|
471
|
+
delete response.Message;
|
|
472
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
473
|
+
};
|
|
474
|
+
|
|
342
475
|
export const deserializeAws_restJson1CreateOutpostCommand = async (
|
|
343
476
|
output: __HttpResponse,
|
|
344
477
|
context: __SerdeContext
|
|
@@ -1235,6 +1368,27 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (
|
|
|
1235
1368
|
return contents;
|
|
1236
1369
|
};
|
|
1237
1370
|
|
|
1371
|
+
const serializeAws_restJson1LineItemRequest = (input: LineItemRequest, context: __SerdeContext): any => {
|
|
1372
|
+
return {
|
|
1373
|
+
...(input.CatalogItemId !== undefined && input.CatalogItemId !== null && { CatalogItemId: input.CatalogItemId }),
|
|
1374
|
+
...(input.Quantity !== undefined && input.Quantity !== null && { Quantity: input.Quantity }),
|
|
1375
|
+
};
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
const serializeAws_restJson1LineItemRequestListDefinition = (
|
|
1379
|
+
input: LineItemRequest[],
|
|
1380
|
+
context: __SerdeContext
|
|
1381
|
+
): any => {
|
|
1382
|
+
return input
|
|
1383
|
+
.filter((e: any) => e != null)
|
|
1384
|
+
.map((entry) => {
|
|
1385
|
+
if (entry === null) {
|
|
1386
|
+
return null as any;
|
|
1387
|
+
}
|
|
1388
|
+
return serializeAws_restJson1LineItemRequest(entry, context);
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1238
1392
|
const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
|
|
1239
1393
|
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
|
|
1240
1394
|
if (value === null) {
|
|
@@ -1267,6 +1421,47 @@ const deserializeAws_restJson1InstanceTypeListDefinition = (
|
|
|
1267
1421
|
});
|
|
1268
1422
|
};
|
|
1269
1423
|
|
|
1424
|
+
const deserializeAws_restJson1LineItem = (output: any, context: __SerdeContext): LineItem => {
|
|
1425
|
+
return {
|
|
1426
|
+
CatalogItemId: __expectString(output.CatalogItemId),
|
|
1427
|
+
LineItemId: __expectString(output.LineItemId),
|
|
1428
|
+
Quantity: __expectInt32(output.Quantity),
|
|
1429
|
+
Status: __expectString(output.Status),
|
|
1430
|
+
} as any;
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
const deserializeAws_restJson1LineItemListDefinition = (output: any, context: __SerdeContext): LineItem[] => {
|
|
1434
|
+
return (output || [])
|
|
1435
|
+
.filter((e: any) => e != null)
|
|
1436
|
+
.map((entry: any) => {
|
|
1437
|
+
if (entry === null) {
|
|
1438
|
+
return null as any;
|
|
1439
|
+
}
|
|
1440
|
+
return deserializeAws_restJson1LineItem(entry, context);
|
|
1441
|
+
});
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
const deserializeAws_restJson1Order = (output: any, context: __SerdeContext): Order => {
|
|
1445
|
+
return {
|
|
1446
|
+
LineItems:
|
|
1447
|
+
output.LineItems !== undefined && output.LineItems !== null
|
|
1448
|
+
? deserializeAws_restJson1LineItemListDefinition(output.LineItems, context)
|
|
1449
|
+
: undefined,
|
|
1450
|
+
OrderFulfilledDate:
|
|
1451
|
+
output.OrderFulfilledDate !== undefined && output.OrderFulfilledDate !== null
|
|
1452
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.OrderFulfilledDate)))
|
|
1453
|
+
: undefined,
|
|
1454
|
+
OrderId: __expectString(output.OrderId),
|
|
1455
|
+
OrderSubmissionDate:
|
|
1456
|
+
output.OrderSubmissionDate !== undefined && output.OrderSubmissionDate !== null
|
|
1457
|
+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.OrderSubmissionDate)))
|
|
1458
|
+
: undefined,
|
|
1459
|
+
OutpostId: __expectString(output.OutpostId),
|
|
1460
|
+
PaymentOption: __expectString(output.PaymentOption),
|
|
1461
|
+
Status: __expectString(output.Status),
|
|
1462
|
+
} as any;
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1270
1465
|
const deserializeAws_restJson1Outpost = (output: any, context: __SerdeContext): Outpost => {
|
|
1271
1466
|
return {
|
|
1272
1467
|
AvailabilityZone: __expectString(output.AvailabilityZone),
|
package/tsconfig.es.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"alwaysStrict": true,
|
|
4
4
|
"target": "ES2018",
|
|
5
5
|
"module": "commonjs",
|
|
6
|
-
"declaration": true,
|
|
7
6
|
"strict": true,
|
|
8
7
|
"sourceMap": true,
|
|
9
8
|
"downlevelIteration": true,
|
|
@@ -12,9 +11,8 @@
|
|
|
12
11
|
"incremental": true,
|
|
13
12
|
"resolveJsonModule": true,
|
|
14
13
|
"esModuleInterop": true,
|
|
15
|
-
"declarationDir": "./dist/types",
|
|
16
14
|
"outDir": "dist/cjs",
|
|
17
|
-
"
|
|
15
|
+
"removeComments": true
|
|
18
16
|
},
|
|
19
17
|
"typedocOptions": {
|
|
20
18
|
"exclude": ["**/node_modules/**", "**/*.spec.ts", "**/protocols/*.ts", "**/e2e/*.ts", "**/endpoints.ts"],
|
|
@@ -24,9 +22,9 @@
|
|
|
24
22
|
"ignoreCompilerErrors": true,
|
|
25
23
|
"includeDeclarations": true,
|
|
26
24
|
"stripInternal": true,
|
|
27
|
-
"readme": "
|
|
25
|
+
"readme": "README.md",
|
|
28
26
|
"mode": "file",
|
|
29
|
-
"out": "
|
|
27
|
+
"out": "docs",
|
|
30
28
|
"theme": "minimal",
|
|
31
29
|
"plugin": ["@aws-sdk/client-documentation-generator"]
|
|
32
30
|
}
|