@aws-sdk/client-s3outposts 3.34.0 → 3.37.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/S3Outposts.js +1 -5
  3. package/{dist/cjs → dist-cjs}/S3OutpostsClient.js +8 -17
  4. package/dist-cjs/commands/CreateEndpointCommand.js +36 -0
  5. package/dist-cjs/commands/DeleteEndpointCommand.js +36 -0
  6. package/dist-cjs/commands/ListEndpointsCommand.js +36 -0
  7. package/{dist/cjs → dist-cjs}/endpoints.js +1 -2
  8. package/{dist/cjs → dist-cjs}/index.js +0 -1
  9. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  10. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -37
  11. package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
  12. package/{dist/cjs → dist-cjs}/pagination/ListEndpointsPaginator.js +1 -12
  13. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +3 -9
  14. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  15. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  16. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  17. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  18. package/{dist/es → dist-es}/S3Outposts.js +1 -2
  19. package/{dist/es → dist-es}/S3OutpostsClient.js +1 -2
  20. package/{dist/es → dist-es}/commands/CreateEndpointCommand.js +2 -3
  21. package/{dist/es → dist-es}/commands/DeleteEndpointCommand.js +2 -3
  22. package/{dist/es → dist-es}/commands/ListEndpointsCommand.js +2 -3
  23. package/{dist/es → dist-es}/endpoints.js +1 -2
  24. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  25. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  26. package/{dist/es → dist-es}/models/models_0.js +0 -1
  27. package/dist-es/pagination/Interfaces.js +1 -0
  28. package/{dist/es → dist-es}/pagination/ListEndpointsPaginator.js +1 -2
  29. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +0 -1
  30. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -2
  31. package/{dist/es → dist-es}/runtimeConfig.js +1 -2
  32. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -1
  33. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -2
  34. package/{dist/types → dist-types}/S3Outposts.d.ts +2 -2
  35. package/{dist/types → dist-types}/S3OutpostsClient.d.ts +4 -4
  36. package/{dist/types → dist-types}/commands/CreateEndpointCommand.d.ts +3 -3
  37. package/{dist/types → dist-types}/commands/DeleteEndpointCommand.d.ts +3 -3
  38. package/{dist/types → dist-types}/commands/ListEndpointsCommand.d.ts +3 -3
  39. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  40. package/{index.ts → dist-types/index.d.ts} +0 -0
  41. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  42. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  43. package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
  44. package/{dist/types → dist-types}/pagination/ListEndpointsPaginator.d.ts +1 -1
  45. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
  46. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  47. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  48. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  49. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  50. package/dist-types/ts3.4/S3Outposts.d.ts +20 -0
  51. package/dist-types/ts3.4/S3OutpostsClient.d.ts +70 -0
  52. package/dist-types/ts3.4/commands/CreateEndpointCommand.d.ts +17 -0
  53. package/dist-types/ts3.4/commands/DeleteEndpointCommand.d.ts +17 -0
  54. package/dist-types/ts3.4/commands/ListEndpointsCommand.d.ts +17 -0
  55. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  56. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  57. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  58. package/dist-types/ts3.4/models/models_0.d.ts +152 -0
  59. package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
  60. package/{dist/types → dist-types}/ts3.4/pagination/ListEndpointsPaginator.d.ts +1 -1
  61. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
  62. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  63. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  64. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  65. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  66. package/package.json +45 -42
  67. package/S3Outposts.ts +0 -179
  68. package/S3OutpostsClient.ts +0 -238
  69. package/commands/CreateEndpointCommand.ts +0 -115
  70. package/commands/DeleteEndpointCommand.ts +0 -115
  71. package/commands/ListEndpointsCommand.ts +0 -113
  72. package/dist/cjs/S3Outposts.js.map +0 -1
  73. package/dist/cjs/S3OutpostsClient.js.map +0 -1
  74. package/dist/cjs/commands/CreateEndpointCommand.js +0 -82
  75. package/dist/cjs/commands/CreateEndpointCommand.js.map +0 -1
  76. package/dist/cjs/commands/DeleteEndpointCommand.js +0 -82
  77. package/dist/cjs/commands/DeleteEndpointCommand.js.map +0 -1
  78. package/dist/cjs/commands/ListEndpointsCommand.js +0 -80
  79. package/dist/cjs/commands/ListEndpointsCommand.js.map +0 -1
  80. package/dist/cjs/endpoints.js.map +0 -1
  81. package/dist/cjs/index.js.map +0 -1
  82. package/dist/cjs/models/index.js.map +0 -1
  83. package/dist/cjs/models/models_0.js.map +0 -1
  84. package/dist/cjs/package.json +0 -91
  85. package/dist/cjs/pagination/Interfaces.js.map +0 -1
  86. package/dist/cjs/pagination/ListEndpointsPaginator.js.map +0 -1
  87. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  88. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  89. package/dist/cjs/runtimeConfig.js.map +0 -1
  90. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  91. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  92. package/dist/es/S3Outposts.js.map +0 -1
  93. package/dist/es/S3OutpostsClient.js.map +0 -1
  94. package/dist/es/commands/CreateEndpointCommand.js.map +0 -1
  95. package/dist/es/commands/DeleteEndpointCommand.js.map +0 -1
  96. package/dist/es/commands/ListEndpointsCommand.js.map +0 -1
  97. package/dist/es/endpoints.js.map +0 -1
  98. package/dist/es/index.js +0 -9
  99. package/dist/es/index.js.map +0 -1
  100. package/dist/es/models/index.js +0 -2
  101. package/dist/es/models/index.js.map +0 -1
  102. package/dist/es/models/models_0.js.map +0 -1
  103. package/dist/es/package.json +0 -91
  104. package/dist/es/pagination/Interfaces.js +0 -2
  105. package/dist/es/pagination/Interfaces.js.map +0 -1
  106. package/dist/es/pagination/ListEndpointsPaginator.js.map +0 -1
  107. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  108. package/dist/es/runtimeConfig.browser.js.map +0 -1
  109. package/dist/es/runtimeConfig.js.map +0 -1
  110. package/dist/es/runtimeConfig.native.js.map +0 -1
  111. package/dist/es/runtimeConfig.shared.js.map +0 -1
  112. package/dist/types/ts3.4/S3Outposts.d.ts +0 -89
  113. package/dist/types/ts3.4/S3OutpostsClient.d.ts +0 -135
  114. package/dist/types/ts3.4/commands/CreateEndpointCommand.d.ts +0 -56
  115. package/dist/types/ts3.4/commands/DeleteEndpointCommand.d.ts +0 -56
  116. package/dist/types/ts3.4/commands/ListEndpointsCommand.d.ts +0 -54
  117. package/dist/types/ts3.4/models/models_0.d.ts +0 -245
  118. package/endpoints.ts +0 -57
  119. package/jest.config.js +0 -4
  120. package/models/models_0.ts +0 -312
  121. package/pagination/Interfaces.ts +0 -7
  122. package/pagination/ListEndpointsPaginator.ts +0 -58
  123. package/protocols/Aws_restJson1.ts +0 -556
  124. package/runtimeConfig.browser.ts +0 -40
  125. package/runtimeConfig.native.ts +0 -16
  126. package/runtimeConfig.shared.ts +0 -16
  127. package/runtimeConfig.ts +0 -45
  128. package/tsconfig.es.json +0 -10
  129. package/tsconfig.json +0 -31
  130. package/tsconfig.types.json +0 -8
@@ -1,556 +0,0 @@
1
- import { CreateEndpointCommandInput, CreateEndpointCommandOutput } from "../commands/CreateEndpointCommand";
2
- import { DeleteEndpointCommandInput, DeleteEndpointCommandOutput } from "../commands/DeleteEndpointCommand";
3
- import { ListEndpointsCommandInput, ListEndpointsCommandOutput } from "../commands/ListEndpointsCommand";
4
- import {
5
- AccessDeniedException,
6
- ConflictException,
7
- Endpoint,
8
- InternalServerException,
9
- NetworkInterface,
10
- ResourceNotFoundException,
11
- ValidationException,
12
- } from "../models/models_0";
13
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
14
- import {
15
- expectNonNull as __expectNonNull,
16
- expectNumber as __expectNumber,
17
- expectObject as __expectObject,
18
- expectString as __expectString,
19
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
20
- parseEpochTimestamp as __parseEpochTimestamp,
21
- } from "@aws-sdk/smithy-client";
22
- import {
23
- Endpoint as __Endpoint,
24
- MetadataBearer as __MetadataBearer,
25
- ResponseMetadata as __ResponseMetadata,
26
- SerdeContext as __SerdeContext,
27
- SmithyException as __SmithyException,
28
- } from "@aws-sdk/types";
29
-
30
- export const serializeAws_restJson1CreateEndpointCommand = async (
31
- input: CreateEndpointCommandInput,
32
- context: __SerdeContext
33
- ): Promise<__HttpRequest> => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
- const headers: any = {
36
- "content-type": "application/json",
37
- };
38
- let resolvedPath =
39
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/CreateEndpoint";
40
- let body: any;
41
- body = JSON.stringify({
42
- ...(input.AccessType !== undefined && input.AccessType !== null && { AccessType: input.AccessType }),
43
- ...(input.CustomerOwnedIpv4Pool !== undefined &&
44
- input.CustomerOwnedIpv4Pool !== null && { CustomerOwnedIpv4Pool: input.CustomerOwnedIpv4Pool }),
45
- ...(input.OutpostId !== undefined && input.OutpostId !== null && { OutpostId: input.OutpostId }),
46
- ...(input.SecurityGroupId !== undefined &&
47
- input.SecurityGroupId !== null && { SecurityGroupId: input.SecurityGroupId }),
48
- ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
49
- });
50
- return new __HttpRequest({
51
- protocol,
52
- hostname,
53
- port,
54
- method: "POST",
55
- headers,
56
- path: resolvedPath,
57
- body,
58
- });
59
- };
60
-
61
- export const serializeAws_restJson1DeleteEndpointCommand = async (
62
- input: DeleteEndpointCommandInput,
63
- context: __SerdeContext
64
- ): Promise<__HttpRequest> => {
65
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
- const headers: any = {};
67
- let resolvedPath =
68
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/DeleteEndpoint";
69
- const query: any = {
70
- ...(input.EndpointId !== undefined && { endpointId: input.EndpointId }),
71
- ...(input.OutpostId !== undefined && { outpostId: input.OutpostId }),
72
- };
73
- let body: any;
74
- return new __HttpRequest({
75
- protocol,
76
- hostname,
77
- port,
78
- method: "DELETE",
79
- headers,
80
- path: resolvedPath,
81
- query,
82
- body,
83
- });
84
- };
85
-
86
- export const serializeAws_restJson1ListEndpointsCommand = async (
87
- input: ListEndpointsCommandInput,
88
- context: __SerdeContext
89
- ): Promise<__HttpRequest> => {
90
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
- const headers: any = {};
92
- let resolvedPath =
93
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/S3Outposts/ListEndpoints";
94
- const query: any = {
95
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
96
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
97
- };
98
- let body: any;
99
- return new __HttpRequest({
100
- protocol,
101
- hostname,
102
- port,
103
- method: "GET",
104
- headers,
105
- path: resolvedPath,
106
- query,
107
- body,
108
- });
109
- };
110
-
111
- export const deserializeAws_restJson1CreateEndpointCommand = async (
112
- output: __HttpResponse,
113
- context: __SerdeContext
114
- ): Promise<CreateEndpointCommandOutput> => {
115
- if (output.statusCode !== 200 && output.statusCode >= 300) {
116
- return deserializeAws_restJson1CreateEndpointCommandError(output, context);
117
- }
118
- const contents: CreateEndpointCommandOutput = {
119
- $metadata: deserializeMetadata(output),
120
- EndpointArn: undefined,
121
- };
122
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
123
- if (data.EndpointArn !== undefined && data.EndpointArn !== null) {
124
- contents.EndpointArn = __expectString(data.EndpointArn);
125
- }
126
- return Promise.resolve(contents);
127
- };
128
-
129
- const deserializeAws_restJson1CreateEndpointCommandError = async (
130
- output: __HttpResponse,
131
- context: __SerdeContext
132
- ): Promise<CreateEndpointCommandOutput> => {
133
- const parsedOutput: any = {
134
- ...output,
135
- body: await parseBody(output.body, context),
136
- };
137
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
138
- let errorCode: string = "UnknownError";
139
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
140
- switch (errorCode) {
141
- case "AccessDeniedException":
142
- case "com.amazonaws.s3outposts#AccessDeniedException":
143
- response = {
144
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
145
- name: errorCode,
146
- $metadata: deserializeMetadata(output),
147
- };
148
- break;
149
- case "ConflictException":
150
- case "com.amazonaws.s3outposts#ConflictException":
151
- response = {
152
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
153
- name: errorCode,
154
- $metadata: deserializeMetadata(output),
155
- };
156
- break;
157
- case "InternalServerException":
158
- case "com.amazonaws.s3outposts#InternalServerException":
159
- response = {
160
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
161
- name: errorCode,
162
- $metadata: deserializeMetadata(output),
163
- };
164
- break;
165
- case "ResourceNotFoundException":
166
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
167
- response = {
168
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
169
- name: errorCode,
170
- $metadata: deserializeMetadata(output),
171
- };
172
- break;
173
- case "ValidationException":
174
- case "com.amazonaws.s3outposts#ValidationException":
175
- response = {
176
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
177
- name: errorCode,
178
- $metadata: deserializeMetadata(output),
179
- };
180
- break;
181
- default:
182
- const parsedBody = parsedOutput.body;
183
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
184
- response = {
185
- ...parsedBody,
186
- name: `${errorCode}`,
187
- message: parsedBody.message || parsedBody.Message || errorCode,
188
- $fault: "client",
189
- $metadata: deserializeMetadata(output),
190
- } as any;
191
- }
192
- const message = response.message || response.Message || errorCode;
193
- response.message = message;
194
- delete response.Message;
195
- return Promise.reject(Object.assign(new Error(message), response));
196
- };
197
-
198
- export const deserializeAws_restJson1DeleteEndpointCommand = async (
199
- output: __HttpResponse,
200
- context: __SerdeContext
201
- ): Promise<DeleteEndpointCommandOutput> => {
202
- if (output.statusCode !== 200 && output.statusCode >= 300) {
203
- return deserializeAws_restJson1DeleteEndpointCommandError(output, context);
204
- }
205
- const contents: DeleteEndpointCommandOutput = {
206
- $metadata: deserializeMetadata(output),
207
- };
208
- await collectBody(output.body, context);
209
- return Promise.resolve(contents);
210
- };
211
-
212
- const deserializeAws_restJson1DeleteEndpointCommandError = async (
213
- output: __HttpResponse,
214
- context: __SerdeContext
215
- ): Promise<DeleteEndpointCommandOutput> => {
216
- const parsedOutput: any = {
217
- ...output,
218
- body: await parseBody(output.body, context),
219
- };
220
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
221
- let errorCode: string = "UnknownError";
222
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
223
- switch (errorCode) {
224
- case "AccessDeniedException":
225
- case "com.amazonaws.s3outposts#AccessDeniedException":
226
- response = {
227
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
228
- name: errorCode,
229
- $metadata: deserializeMetadata(output),
230
- };
231
- break;
232
- case "InternalServerException":
233
- case "com.amazonaws.s3outposts#InternalServerException":
234
- response = {
235
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
236
- name: errorCode,
237
- $metadata: deserializeMetadata(output),
238
- };
239
- break;
240
- case "ResourceNotFoundException":
241
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
242
- response = {
243
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
244
- name: errorCode,
245
- $metadata: deserializeMetadata(output),
246
- };
247
- break;
248
- case "ValidationException":
249
- case "com.amazonaws.s3outposts#ValidationException":
250
- response = {
251
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
252
- name: errorCode,
253
- $metadata: deserializeMetadata(output),
254
- };
255
- break;
256
- default:
257
- const parsedBody = parsedOutput.body;
258
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
259
- response = {
260
- ...parsedBody,
261
- name: `${errorCode}`,
262
- message: parsedBody.message || parsedBody.Message || errorCode,
263
- $fault: "client",
264
- $metadata: deserializeMetadata(output),
265
- } as any;
266
- }
267
- const message = response.message || response.Message || errorCode;
268
- response.message = message;
269
- delete response.Message;
270
- return Promise.reject(Object.assign(new Error(message), response));
271
- };
272
-
273
- export const deserializeAws_restJson1ListEndpointsCommand = async (
274
- output: __HttpResponse,
275
- context: __SerdeContext
276
- ): Promise<ListEndpointsCommandOutput> => {
277
- if (output.statusCode !== 200 && output.statusCode >= 300) {
278
- return deserializeAws_restJson1ListEndpointsCommandError(output, context);
279
- }
280
- const contents: ListEndpointsCommandOutput = {
281
- $metadata: deserializeMetadata(output),
282
- Endpoints: undefined,
283
- NextToken: undefined,
284
- };
285
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
286
- if (data.Endpoints !== undefined && data.Endpoints !== null) {
287
- contents.Endpoints = deserializeAws_restJson1Endpoints(data.Endpoints, context);
288
- }
289
- if (data.NextToken !== undefined && data.NextToken !== null) {
290
- contents.NextToken = __expectString(data.NextToken);
291
- }
292
- return Promise.resolve(contents);
293
- };
294
-
295
- const deserializeAws_restJson1ListEndpointsCommandError = async (
296
- output: __HttpResponse,
297
- context: __SerdeContext
298
- ): Promise<ListEndpointsCommandOutput> => {
299
- const parsedOutput: any = {
300
- ...output,
301
- body: await parseBody(output.body, context),
302
- };
303
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
304
- let errorCode: string = "UnknownError";
305
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
306
- switch (errorCode) {
307
- case "AccessDeniedException":
308
- case "com.amazonaws.s3outposts#AccessDeniedException":
309
- response = {
310
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
311
- name: errorCode,
312
- $metadata: deserializeMetadata(output),
313
- };
314
- break;
315
- case "InternalServerException":
316
- case "com.amazonaws.s3outposts#InternalServerException":
317
- response = {
318
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
319
- name: errorCode,
320
- $metadata: deserializeMetadata(output),
321
- };
322
- break;
323
- case "ResourceNotFoundException":
324
- case "com.amazonaws.s3outposts#ResourceNotFoundException":
325
- response = {
326
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
327
- name: errorCode,
328
- $metadata: deserializeMetadata(output),
329
- };
330
- break;
331
- case "ValidationException":
332
- case "com.amazonaws.s3outposts#ValidationException":
333
- response = {
334
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
335
- name: errorCode,
336
- $metadata: deserializeMetadata(output),
337
- };
338
- break;
339
- default:
340
- const parsedBody = parsedOutput.body;
341
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
342
- response = {
343
- ...parsedBody,
344
- name: `${errorCode}`,
345
- message: parsedBody.message || parsedBody.Message || errorCode,
346
- $fault: "client",
347
- $metadata: deserializeMetadata(output),
348
- } as any;
349
- }
350
- const message = response.message || response.Message || errorCode;
351
- response.message = message;
352
- delete response.Message;
353
- return Promise.reject(Object.assign(new Error(message), response));
354
- };
355
-
356
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
357
- parsedOutput: any,
358
- context: __SerdeContext
359
- ): Promise<AccessDeniedException> => {
360
- const contents: AccessDeniedException = {
361
- name: "AccessDeniedException",
362
- $fault: "client",
363
- $metadata: deserializeMetadata(parsedOutput),
364
- Message: undefined,
365
- };
366
- const data: any = parsedOutput.body;
367
- if (data.Message !== undefined && data.Message !== null) {
368
- contents.Message = __expectString(data.Message);
369
- }
370
- return contents;
371
- };
372
-
373
- const deserializeAws_restJson1ConflictExceptionResponse = async (
374
- parsedOutput: any,
375
- context: __SerdeContext
376
- ): Promise<ConflictException> => {
377
- const contents: ConflictException = {
378
- name: "ConflictException",
379
- $fault: "client",
380
- $metadata: deserializeMetadata(parsedOutput),
381
- Message: undefined,
382
- };
383
- const data: any = parsedOutput.body;
384
- if (data.Message !== undefined && data.Message !== null) {
385
- contents.Message = __expectString(data.Message);
386
- }
387
- return contents;
388
- };
389
-
390
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
391
- parsedOutput: any,
392
- context: __SerdeContext
393
- ): Promise<InternalServerException> => {
394
- const contents: InternalServerException = {
395
- name: "InternalServerException",
396
- $fault: "server",
397
- $metadata: deserializeMetadata(parsedOutput),
398
- Message: undefined,
399
- };
400
- const data: any = parsedOutput.body;
401
- if (data.Message !== undefined && data.Message !== null) {
402
- contents.Message = __expectString(data.Message);
403
- }
404
- return contents;
405
- };
406
-
407
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
408
- parsedOutput: any,
409
- context: __SerdeContext
410
- ): Promise<ResourceNotFoundException> => {
411
- const contents: ResourceNotFoundException = {
412
- name: "ResourceNotFoundException",
413
- $fault: "client",
414
- $metadata: deserializeMetadata(parsedOutput),
415
- Message: undefined,
416
- };
417
- const data: any = parsedOutput.body;
418
- if (data.Message !== undefined && data.Message !== null) {
419
- contents.Message = __expectString(data.Message);
420
- }
421
- return contents;
422
- };
423
-
424
- const deserializeAws_restJson1ValidationExceptionResponse = async (
425
- parsedOutput: any,
426
- context: __SerdeContext
427
- ): Promise<ValidationException> => {
428
- const contents: ValidationException = {
429
- name: "ValidationException",
430
- $fault: "client",
431
- $metadata: deserializeMetadata(parsedOutput),
432
- Message: undefined,
433
- };
434
- const data: any = parsedOutput.body;
435
- if (data.Message !== undefined && data.Message !== null) {
436
- contents.Message = __expectString(data.Message);
437
- }
438
- return contents;
439
- };
440
-
441
- const deserializeAws_restJson1Endpoint = (output: any, context: __SerdeContext): Endpoint => {
442
- return {
443
- AccessType: __expectString(output.AccessType),
444
- CidrBlock: __expectString(output.CidrBlock),
445
- CreationTime:
446
- output.CreationTime !== undefined && output.CreationTime !== null
447
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
448
- : undefined,
449
- CustomerOwnedIpv4Pool: __expectString(output.CustomerOwnedIpv4Pool),
450
- EndpointArn: __expectString(output.EndpointArn),
451
- NetworkInterfaces:
452
- output.NetworkInterfaces !== undefined && output.NetworkInterfaces !== null
453
- ? deserializeAws_restJson1NetworkInterfaces(output.NetworkInterfaces, context)
454
- : undefined,
455
- OutpostsId: __expectString(output.OutpostsId),
456
- SecurityGroupId: __expectString(output.SecurityGroupId),
457
- Status: __expectString(output.Status),
458
- SubnetId: __expectString(output.SubnetId),
459
- VpcId: __expectString(output.VpcId),
460
- } as any;
461
- };
462
-
463
- const deserializeAws_restJson1Endpoints = (output: any, context: __SerdeContext): Endpoint[] => {
464
- return (output || [])
465
- .filter((e: any) => e != null)
466
- .map((entry: any) => {
467
- if (entry === null) {
468
- return null as any;
469
- }
470
- return deserializeAws_restJson1Endpoint(entry, context);
471
- });
472
- };
473
-
474
- const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => {
475
- return {
476
- NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
477
- } as any;
478
- };
479
-
480
- const deserializeAws_restJson1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => {
481
- return (output || [])
482
- .filter((e: any) => e != null)
483
- .map((entry: any) => {
484
- if (entry === null) {
485
- return null as any;
486
- }
487
- return deserializeAws_restJson1NetworkInterface(entry, context);
488
- });
489
- };
490
-
491
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
492
- httpStatusCode: output.statusCode,
493
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
494
- extendedRequestId: output.headers["x-amz-id-2"],
495
- cfId: output.headers["x-amz-cf-id"],
496
- });
497
-
498
- // Collect low-level response body stream to Uint8Array.
499
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
500
- if (streamBody instanceof Uint8Array) {
501
- return Promise.resolve(streamBody);
502
- }
503
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
504
- };
505
-
506
- // Encode Uint8Array data into string with utf-8.
507
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
508
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
509
-
510
- const isSerializableHeaderValue = (value: any): boolean =>
511
- value !== undefined &&
512
- value !== null &&
513
- value !== "" &&
514
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
515
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
516
-
517
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
518
- collectBodyString(streamBody, context).then((encoded) => {
519
- if (encoded.length) {
520
- return JSON.parse(encoded);
521
- }
522
- return {};
523
- });
524
-
525
- /**
526
- * Load an error code for the aws.rest-json-1.1 protocol.
527
- */
528
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
529
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
530
-
531
- const sanitizeErrorCode = (rawValue: string): string => {
532
- let cleanValue = rawValue;
533
- if (cleanValue.indexOf(":") >= 0) {
534
- cleanValue = cleanValue.split(":")[0];
535
- }
536
- if (cleanValue.indexOf("#") >= 0) {
537
- cleanValue = cleanValue.split("#")[1];
538
- }
539
- return cleanValue;
540
- };
541
-
542
- const headerKey = findKey(output.headers, "x-amzn-errortype");
543
- if (headerKey !== undefined) {
544
- return sanitizeErrorCode(output.headers[headerKey]);
545
- }
546
-
547
- if (data.code !== undefined) {
548
- return sanitizeErrorCode(data.code);
549
- }
550
-
551
- if (data["__type"] !== undefined) {
552
- return sanitizeErrorCode(data["__type"]);
553
- }
554
-
555
- return "";
556
- };
@@ -1,40 +0,0 @@
1
- import packageInfo from "./package.json";
2
-
3
- import { Sha256 } from "@aws-crypto/sha256-browser";
4
- import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
5
- import { invalidProvider } from "@aws-sdk/invalid-dependency";
6
- import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
7
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
8
- import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
9
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
10
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
11
- import { S3OutpostsClientConfig } from "./S3OutpostsClient";
12
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
-
14
- /**
15
- * @internal
16
- */
17
- export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
18
- const clientSharedValues = getSharedRuntimeConfig(config);
19
- return {
20
- ...clientSharedValues,
21
- ...config,
22
- runtime: "browser",
23
- base64Decoder: config?.base64Decoder ?? fromBase64,
24
- base64Encoder: config?.base64Encoder ?? toBase64,
25
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
26
- credentialDefaultProvider:
27
- config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
28
- defaultUserAgentProvider:
29
- config?.defaultUserAgentProvider ??
30
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
31
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
32
- region: config?.region ?? invalidProvider("Region is missing"),
33
- requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
34
- retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
35
- sha256: config?.sha256 ?? Sha256,
36
- streamCollector: config?.streamCollector ?? streamCollector,
37
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
38
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
39
- };
40
- };
@@ -1,16 +0,0 @@
1
- import { Sha256 } from "@aws-crypto/sha256-js";
2
- import { S3OutpostsClientConfig } from "./S3OutpostsClient";
3
- import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
-
5
- /**
6
- * @internal
7
- */
8
- export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
9
- const browserDefaults = getBrowserRuntimeConfig(config);
10
- return {
11
- ...browserDefaults,
12
- ...config,
13
- runtime: "react-native",
14
- sha256: config?.sha256 ?? Sha256,
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- import { defaultRegionInfoProvider } from "./endpoints";
2
- import { Logger as __Logger } from "@aws-sdk/types";
3
- import { parseUrl } from "@aws-sdk/url-parser";
4
- import { S3OutpostsClientConfig } from "./S3OutpostsClient";
5
-
6
- /**
7
- * @internal
8
- */
9
- export const getRuntimeConfig = (config: S3OutpostsClientConfig) => ({
10
- apiVersion: "2017-07-25",
11
- disableHostPrefix: config?.disableHostPrefix ?? false,
12
- logger: config?.logger ?? ({} as __Logger),
13
- regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
14
- serviceId: config?.serviceId ?? "S3Outposts",
15
- urlParser: config?.urlParser ?? parseUrl,
16
- });
package/runtimeConfig.ts DELETED
@@ -1,45 +0,0 @@
1
- import packageInfo from "./package.json";
2
-
3
- import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
4
- import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
5
- import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
6
- import { Hash } from "@aws-sdk/hash-node";
7
- import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
8
- import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
9
- import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
10
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
11
- import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
12
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
13
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
14
- import { S3OutpostsClientConfig } from "./S3OutpostsClient";
15
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
16
- import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
17
-
18
- /**
19
- * @internal
20
- */
21
- export const getRuntimeConfig = (config: S3OutpostsClientConfig) => {
22
- emitWarningIfUnsupportedVersion(process.version);
23
- const clientSharedValues = getSharedRuntimeConfig(config);
24
- return {
25
- ...clientSharedValues,
26
- ...config,
27
- runtime: "node",
28
- base64Decoder: config?.base64Decoder ?? fromBase64,
29
- base64Encoder: config?.base64Encoder ?? toBase64,
30
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
31
- credentialDefaultProvider:
32
- config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
33
- defaultUserAgentProvider:
34
- config?.defaultUserAgentProvider ??
35
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
36
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
37
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
38
- requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
39
- retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
40
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
41
- streamCollector: config?.streamCollector ?? streamCollector,
42
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
43
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
44
- };
45
- };
package/tsconfig.es.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "module": "esnext",
6
- "moduleResolution": "node",
7
- "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"],
8
- "outDir": "dist/es"
9
- }
10
- }