@aws-sdk/client-ebs 3.476.0 → 3.477.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.
@@ -1,142 +1,98 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_StartSnapshotCommand = exports.de_PutSnapshotBlockCommand = exports.de_ListSnapshotBlocksCommand = exports.de_ListChangedBlocksCommand = exports.de_GetSnapshotBlockCommand = exports.de_CompleteSnapshotCommand = exports.se_StartSnapshotCommand = exports.se_PutSnapshotBlockCommand = exports.se_ListSnapshotBlocksCommand = exports.se_ListChangedBlocksCommand = exports.se_GetSnapshotBlockCommand = exports.se_CompleteSnapshotCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
4
+ const core_1 = require("@smithy/core");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
7
  const EBSServiceException_1 = require("../models/EBSServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_CompleteSnapshotCommand = async (input, context) => {
10
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const b = (0, core_1.requestBuilder)(input, context);
11
11
  const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
12
- "x-amz-changedblockscount": [
13
- () => isSerializableHeaderValue(input.ChangedBlocksCount),
14
- () => input.ChangedBlocksCount.toString(),
15
- ],
16
- "x-amz-checksum": input.Checksum,
17
- "x-amz-checksum-algorithm": input.ChecksumAlgorithm,
18
- "x-amz-checksum-aggregation-method": input.ChecksumAggregationMethod,
12
+ [_xac]: [() => isSerializableHeaderValue(input[_CBC]), () => input[_CBC].toString()],
13
+ [_xac_]: input[_C],
14
+ [_xaca]: input[_CA],
15
+ [_xacam]: input[_CAM],
19
16
  });
20
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/completion/{SnapshotId}";
21
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
17
+ b.bp("/snapshots/completion/{SnapshotId}");
18
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
22
19
  let body;
23
- return new protocol_http_1.HttpRequest({
24
- protocol,
25
- hostname,
26
- port,
27
- method: "POST",
28
- headers,
29
- path: resolvedPath,
30
- body,
31
- });
20
+ b.m("POST").h(headers).b(body);
21
+ return b.build();
32
22
  };
33
23
  exports.se_CompleteSnapshotCommand = se_CompleteSnapshotCommand;
34
24
  const se_GetSnapshotBlockCommand = async (input, context) => {
35
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
25
+ const b = (0, core_1.requestBuilder)(input, context);
36
26
  const headers = {};
37
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
38
- "/snapshots/{SnapshotId}/blocks/{BlockIndex}";
39
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
40
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
27
+ b.bp("/snapshots/{SnapshotId}/blocks/{BlockIndex}");
28
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
29
+ b.p("BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
41
30
  const query = (0, smithy_client_1.map)({
42
- blockToken: [, (0, smithy_client_1.expectNonNull)(input.BlockToken, `BlockToken`)],
31
+ [_bT]: [, (0, smithy_client_1.expectNonNull)(input[_BT], `BlockToken`)],
43
32
  });
44
33
  let body;
45
- return new protocol_http_1.HttpRequest({
46
- protocol,
47
- hostname,
48
- port,
49
- method: "GET",
50
- headers,
51
- path: resolvedPath,
52
- query,
53
- body,
54
- });
34
+ b.m("GET").h(headers).q(query).b(body);
35
+ return b.build();
55
36
  };
56
37
  exports.se_GetSnapshotBlockCommand = se_GetSnapshotBlockCommand;
57
38
  const se_ListChangedBlocksCommand = async (input, context) => {
58
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
+ const b = (0, core_1.requestBuilder)(input, context);
59
40
  const headers = {};
60
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
61
- "/snapshots/{SecondSnapshotId}/changedblocks";
62
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SecondSnapshotId", () => input.SecondSnapshotId, "{SecondSnapshotId}", false);
41
+ b.bp("/snapshots/{SecondSnapshotId}/changedblocks");
42
+ b.p("SecondSnapshotId", () => input.SecondSnapshotId, "{SecondSnapshotId}", false);
63
43
  const query = (0, smithy_client_1.map)({
64
- firstSnapshotId: [, input.FirstSnapshotId],
65
- pageToken: [, input.NextToken],
66
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
67
- startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
44
+ [_fSI]: [, input[_FSI]],
45
+ [_pT]: [, input[_NT]],
46
+ [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
47
+ [_sBI]: [() => input.StartingBlockIndex !== void 0, () => input[_SBI].toString()],
68
48
  });
69
49
  let body;
70
- return new protocol_http_1.HttpRequest({
71
- protocol,
72
- hostname,
73
- port,
74
- method: "GET",
75
- headers,
76
- path: resolvedPath,
77
- query,
78
- body,
79
- });
50
+ b.m("GET").h(headers).q(query).b(body);
51
+ return b.build();
80
52
  };
81
53
  exports.se_ListChangedBlocksCommand = se_ListChangedBlocksCommand;
82
54
  const se_ListSnapshotBlocksCommand = async (input, context) => {
83
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
+ const b = (0, core_1.requestBuilder)(input, context);
84
56
  const headers = {};
85
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/{SnapshotId}/blocks";
86
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
57
+ b.bp("/snapshots/{SnapshotId}/blocks");
58
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
87
59
  const query = (0, smithy_client_1.map)({
88
- pageToken: [, input.NextToken],
89
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
90
- startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
60
+ [_pT]: [, input[_NT]],
61
+ [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
62
+ [_sBI]: [() => input.StartingBlockIndex !== void 0, () => input[_SBI].toString()],
91
63
  });
92
64
  let body;
93
- return new protocol_http_1.HttpRequest({
94
- protocol,
95
- hostname,
96
- port,
97
- method: "GET",
98
- headers,
99
- path: resolvedPath,
100
- query,
101
- body,
102
- });
65
+ b.m("GET").h(headers).q(query).b(body);
66
+ return b.build();
103
67
  };
104
68
  exports.se_ListSnapshotBlocksCommand = se_ListSnapshotBlocksCommand;
105
69
  const se_PutSnapshotBlockCommand = async (input, context) => {
106
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
70
+ const b = (0, core_1.requestBuilder)(input, context);
107
71
  const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
108
72
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
109
73
  "content-type": "application/octet-stream",
110
- "x-amz-data-length": [() => isSerializableHeaderValue(input.DataLength), () => input.DataLength.toString()],
111
- "x-amz-progress": [() => isSerializableHeaderValue(input.Progress), () => input.Progress.toString()],
112
- "x-amz-checksum": input.Checksum,
113
- "x-amz-checksum-algorithm": input.ChecksumAlgorithm,
114
- });
115
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
116
- "/snapshots/{SnapshotId}/blocks/{BlockIndex}";
117
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
118
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
74
+ [_xadl]: [() => isSerializableHeaderValue(input[_DL]), () => input[_DL].toString()],
75
+ [_xap]: [() => isSerializableHeaderValue(input[_P]), () => input[_P].toString()],
76
+ [_xac_]: input[_C],
77
+ [_xaca]: input[_CA],
78
+ });
79
+ b.bp("/snapshots/{SnapshotId}/blocks/{BlockIndex}");
80
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
81
+ b.p("BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
119
82
  let body;
120
83
  if (input.BlockData !== undefined) {
121
84
  body = input.BlockData;
122
85
  }
123
- return new protocol_http_1.HttpRequest({
124
- protocol,
125
- hostname,
126
- port,
127
- method: "PUT",
128
- headers,
129
- path: resolvedPath,
130
- body,
131
- });
86
+ b.m("PUT").h(headers).b(body);
87
+ return b.build();
132
88
  };
133
89
  exports.se_PutSnapshotBlockCommand = se_PutSnapshotBlockCommand;
134
90
  const se_StartSnapshotCommand = async (input, context) => {
135
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
+ const b = (0, core_1.requestBuilder)(input, context);
136
92
  const headers = {
137
93
  "content-type": "application/json",
138
94
  };
139
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots";
95
+ b.bp("/snapshots");
140
96
  let body;
141
97
  body = JSON.stringify((0, smithy_client_1.take)(input, {
142
98
  ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -148,15 +104,8 @@ const se_StartSnapshotCommand = async (input, context) => {
148
104
  Timeout: [],
149
105
  VolumeSize: [],
150
106
  }));
151
- return new protocol_http_1.HttpRequest({
152
- protocol,
153
- hostname,
154
- port,
155
- method: "POST",
156
- headers,
157
- path: resolvedPath,
158
- body,
159
- });
107
+ b.m("POST").h(headers).b(body);
108
+ return b.build();
160
109
  };
161
110
  exports.se_StartSnapshotCommand = se_StartSnapshotCommand;
162
111
  const de_CompleteSnapshotCommand = async (output, context) => {
@@ -214,12 +163,9 @@ const de_GetSnapshotBlockCommand = async (output, context) => {
214
163
  }
215
164
  const contents = (0, smithy_client_1.map)({
216
165
  $metadata: deserializeMetadata(output),
217
- DataLength: [
218
- () => void 0 !== output.headers["x-amz-data-length"],
219
- () => (0, smithy_client_1.strictParseInt32)(output.headers["x-amz-data-length"]),
220
- ],
221
- Checksum: [, output.headers["x-amz-checksum"]],
222
- ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
166
+ [_DL]: [() => void 0 !== output.headers[_xadl], () => (0, smithy_client_1.strictParseInt32)(output.headers[_xadl])],
167
+ [_C]: [, output.headers[_xac_]],
168
+ [_CA]: [, output.headers[_xaca]],
223
169
  });
224
170
  const data = output.body;
225
171
  context.sdkStreamMixin(data);
@@ -373,8 +319,8 @@ const de_PutSnapshotBlockCommand = async (output, context) => {
373
319
  }
374
320
  const contents = (0, smithy_client_1.map)({
375
321
  $metadata: deserializeMetadata(output),
376
- Checksum: [, output.headers["x-amz-checksum"]],
377
- ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
322
+ [_C]: [, output.headers[_xac_]],
323
+ [_CA]: [, output.headers[_xaca]],
378
324
  });
379
325
  await (0, smithy_client_1.collectBody)(output.body, context);
380
326
  return contents;
@@ -601,6 +547,28 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
601
547
  value !== "" &&
602
548
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
603
549
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
550
+ const _BT = "BlockToken";
551
+ const _C = "Checksum";
552
+ const _CA = "ChecksumAlgorithm";
553
+ const _CAM = "ChecksumAggregationMethod";
554
+ const _CBC = "ChangedBlocksCount";
555
+ const _DL = "DataLength";
556
+ const _FSI = "FirstSnapshotId";
557
+ const _MR = "MaxResults";
558
+ const _NT = "NextToken";
559
+ const _P = "Progress";
560
+ const _SBI = "StartingBlockIndex";
561
+ const _bT = "blockToken";
562
+ const _fSI = "firstSnapshotId";
563
+ const _mR = "maxResults";
564
+ const _pT = "pageToken";
565
+ const _sBI = "startingBlockIndex";
566
+ const _xac = "x-amz-changedblockscount";
567
+ const _xac_ = "x-amz-checksum";
568
+ const _xaca = "x-amz-checksum-algorithm";
569
+ const _xacam = "x-amz-checksum-aggregation-method";
570
+ const _xadl = "x-amz-data-length";
571
+ const _xap = "x-amz-progress";
604
572
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
605
573
  if (encoded.length) {
606
574
  return JSON.parse(encoded);
@@ -1,134 +1,90 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { EBSServiceException as __BaseException } from "../models/EBSServiceException";
5
5
  import { AccessDeniedException, ConcurrentLimitExceededException, ConflictException, InternalServerException, RequestThrottledException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
6
6
  export const se_CompleteSnapshotCommand = async (input, context) => {
7
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const b = rb(input, context);
8
8
  const headers = map({}, isSerializableHeaderValue, {
9
- "x-amz-changedblockscount": [
10
- () => isSerializableHeaderValue(input.ChangedBlocksCount),
11
- () => input.ChangedBlocksCount.toString(),
12
- ],
13
- "x-amz-checksum": input.Checksum,
14
- "x-amz-checksum-algorithm": input.ChecksumAlgorithm,
15
- "x-amz-checksum-aggregation-method": input.ChecksumAggregationMethod,
9
+ [_xac]: [() => isSerializableHeaderValue(input[_CBC]), () => input[_CBC].toString()],
10
+ [_xac_]: input[_C],
11
+ [_xaca]: input[_CA],
12
+ [_xacam]: input[_CAM],
16
13
  });
17
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/completion/{SnapshotId}";
18
- resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
14
+ b.bp("/snapshots/completion/{SnapshotId}");
15
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
19
16
  let body;
20
- return new __HttpRequest({
21
- protocol,
22
- hostname,
23
- port,
24
- method: "POST",
25
- headers,
26
- path: resolvedPath,
27
- body,
28
- });
17
+ b.m("POST").h(headers).b(body);
18
+ return b.build();
29
19
  };
30
20
  export const se_GetSnapshotBlockCommand = async (input, context) => {
31
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
21
+ const b = rb(input, context);
32
22
  const headers = {};
33
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
34
- "/snapshots/{SnapshotId}/blocks/{BlockIndex}";
35
- resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
36
- resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
23
+ b.bp("/snapshots/{SnapshotId}/blocks/{BlockIndex}");
24
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
25
+ b.p("BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
37
26
  const query = map({
38
- blockToken: [, __expectNonNull(input.BlockToken, `BlockToken`)],
27
+ [_bT]: [, __expectNonNull(input[_BT], `BlockToken`)],
39
28
  });
40
29
  let body;
41
- return new __HttpRequest({
42
- protocol,
43
- hostname,
44
- port,
45
- method: "GET",
46
- headers,
47
- path: resolvedPath,
48
- query,
49
- body,
50
- });
30
+ b.m("GET").h(headers).q(query).b(body);
31
+ return b.build();
51
32
  };
52
33
  export const se_ListChangedBlocksCommand = async (input, context) => {
53
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
34
+ const b = rb(input, context);
54
35
  const headers = {};
55
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
56
- "/snapshots/{SecondSnapshotId}/changedblocks";
57
- resolvedPath = __resolvedPath(resolvedPath, input, "SecondSnapshotId", () => input.SecondSnapshotId, "{SecondSnapshotId}", false);
36
+ b.bp("/snapshots/{SecondSnapshotId}/changedblocks");
37
+ b.p("SecondSnapshotId", () => input.SecondSnapshotId, "{SecondSnapshotId}", false);
58
38
  const query = map({
59
- firstSnapshotId: [, input.FirstSnapshotId],
60
- pageToken: [, input.NextToken],
61
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
62
- startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
39
+ [_fSI]: [, input[_FSI]],
40
+ [_pT]: [, input[_NT]],
41
+ [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
42
+ [_sBI]: [() => input.StartingBlockIndex !== void 0, () => input[_SBI].toString()],
63
43
  });
64
44
  let body;
65
- return new __HttpRequest({
66
- protocol,
67
- hostname,
68
- port,
69
- method: "GET",
70
- headers,
71
- path: resolvedPath,
72
- query,
73
- body,
74
- });
45
+ b.m("GET").h(headers).q(query).b(body);
46
+ return b.build();
75
47
  };
76
48
  export const se_ListSnapshotBlocksCommand = async (input, context) => {
77
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
49
+ const b = rb(input, context);
78
50
  const headers = {};
79
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots/{SnapshotId}/blocks";
80
- resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
51
+ b.bp("/snapshots/{SnapshotId}/blocks");
52
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
81
53
  const query = map({
82
- pageToken: [, input.NextToken],
83
- maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
84
- startingBlockIndex: [() => input.StartingBlockIndex !== void 0, () => input.StartingBlockIndex.toString()],
54
+ [_pT]: [, input[_NT]],
55
+ [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
56
+ [_sBI]: [() => input.StartingBlockIndex !== void 0, () => input[_SBI].toString()],
85
57
  });
86
58
  let body;
87
- return new __HttpRequest({
88
- protocol,
89
- hostname,
90
- port,
91
- method: "GET",
92
- headers,
93
- path: resolvedPath,
94
- query,
95
- body,
96
- });
59
+ b.m("GET").h(headers).q(query).b(body);
60
+ return b.build();
97
61
  };
98
62
  export const se_PutSnapshotBlockCommand = async (input, context) => {
99
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
+ const b = rb(input, context);
100
64
  const headers = map({}, isSerializableHeaderValue, {
101
65
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
102
66
  "content-type": "application/octet-stream",
103
- "x-amz-data-length": [() => isSerializableHeaderValue(input.DataLength), () => input.DataLength.toString()],
104
- "x-amz-progress": [() => isSerializableHeaderValue(input.Progress), () => input.Progress.toString()],
105
- "x-amz-checksum": input.Checksum,
106
- "x-amz-checksum-algorithm": input.ChecksumAlgorithm,
107
- });
108
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
109
- "/snapshots/{SnapshotId}/blocks/{BlockIndex}";
110
- resolvedPath = __resolvedPath(resolvedPath, input, "SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
111
- resolvedPath = __resolvedPath(resolvedPath, input, "BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
67
+ [_xadl]: [() => isSerializableHeaderValue(input[_DL]), () => input[_DL].toString()],
68
+ [_xap]: [() => isSerializableHeaderValue(input[_P]), () => input[_P].toString()],
69
+ [_xac_]: input[_C],
70
+ [_xaca]: input[_CA],
71
+ });
72
+ b.bp("/snapshots/{SnapshotId}/blocks/{BlockIndex}");
73
+ b.p("SnapshotId", () => input.SnapshotId, "{SnapshotId}", false);
74
+ b.p("BlockIndex", () => input.BlockIndex.toString(), "{BlockIndex}", false);
112
75
  let body;
113
76
  if (input.BlockData !== undefined) {
114
77
  body = input.BlockData;
115
78
  }
116
- return new __HttpRequest({
117
- protocol,
118
- hostname,
119
- port,
120
- method: "PUT",
121
- headers,
122
- path: resolvedPath,
123
- body,
124
- });
79
+ b.m("PUT").h(headers).b(body);
80
+ return b.build();
125
81
  };
126
82
  export const se_StartSnapshotCommand = async (input, context) => {
127
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
83
+ const b = rb(input, context);
128
84
  const headers = {
129
85
  "content-type": "application/json",
130
86
  };
131
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/snapshots";
87
+ b.bp("/snapshots");
132
88
  let body;
133
89
  body = JSON.stringify(take(input, {
134
90
  ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -140,15 +96,8 @@ export const se_StartSnapshotCommand = async (input, context) => {
140
96
  Timeout: [],
141
97
  VolumeSize: [],
142
98
  }));
143
- return new __HttpRequest({
144
- protocol,
145
- hostname,
146
- port,
147
- method: "POST",
148
- headers,
149
- path: resolvedPath,
150
- body,
151
- });
99
+ b.m("POST").h(headers).b(body);
100
+ return b.build();
152
101
  };
153
102
  export const de_CompleteSnapshotCommand = async (output, context) => {
154
103
  if (output.statusCode !== 202 && output.statusCode >= 300) {
@@ -204,12 +153,9 @@ export const de_GetSnapshotBlockCommand = async (output, context) => {
204
153
  }
205
154
  const contents = map({
206
155
  $metadata: deserializeMetadata(output),
207
- DataLength: [
208
- () => void 0 !== output.headers["x-amz-data-length"],
209
- () => __strictParseInt32(output.headers["x-amz-data-length"]),
210
- ],
211
- Checksum: [, output.headers["x-amz-checksum"]],
212
- ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
156
+ [_DL]: [() => void 0 !== output.headers[_xadl], () => __strictParseInt32(output.headers[_xadl])],
157
+ [_C]: [, output.headers[_xac_]],
158
+ [_CA]: [, output.headers[_xaca]],
213
159
  });
214
160
  const data = output.body;
215
161
  context.sdkStreamMixin(data);
@@ -360,8 +306,8 @@ export const de_PutSnapshotBlockCommand = async (output, context) => {
360
306
  }
361
307
  const contents = map({
362
308
  $metadata: deserializeMetadata(output),
363
- Checksum: [, output.headers["x-amz-checksum"]],
364
- ChecksumAlgorithm: [, output.headers["x-amz-checksum-algorithm"]],
309
+ [_C]: [, output.headers[_xac_]],
310
+ [_CA]: [, output.headers[_xaca]],
365
311
  });
366
312
  await collectBody(output.body, context);
367
313
  return contents;
@@ -586,6 +532,28 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
586
532
  value !== "" &&
587
533
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
588
534
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
535
+ const _BT = "BlockToken";
536
+ const _C = "Checksum";
537
+ const _CA = "ChecksumAlgorithm";
538
+ const _CAM = "ChecksumAggregationMethod";
539
+ const _CBC = "ChangedBlocksCount";
540
+ const _DL = "DataLength";
541
+ const _FSI = "FirstSnapshotId";
542
+ const _MR = "MaxResults";
543
+ const _NT = "NextToken";
544
+ const _P = "Progress";
545
+ const _SBI = "StartingBlockIndex";
546
+ const _bT = "blockToken";
547
+ const _fSI = "firstSnapshotId";
548
+ const _mR = "maxResults";
549
+ const _pT = "pageToken";
550
+ const _sBI = "startingBlockIndex";
551
+ const _xac = "x-amz-changedblockscount";
552
+ const _xac_ = "x-amz-checksum";
553
+ const _xaca = "x-amz-checksum-algorithm";
554
+ const _xacam = "x-amz-checksum-aggregation-method";
555
+ const _xadl = "x-amz-data-length";
556
+ const _xap = "x-amz-progress";
589
557
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
590
558
  if (encoded.length) {
591
559
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ebs",
3
3
  "description": "AWS SDK for JavaScript Ebs Client for Node.js, Browser and React Native",
4
- "version": "3.476.0",
4
+ "version": "3.477.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.476.0",
24
- "@aws-sdk/core": "3.476.0",
25
- "@aws-sdk/credential-provider-node": "3.476.0",
23
+ "@aws-sdk/client-sts": "3.477.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.477.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -34,6 +34,7 @@
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",