@aws-sdk/client-taxsettings 3.590.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 (119) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +272 -0
  3. package/dist-cjs/TaxSettings.js +25 -0
  4. package/dist-cjs/TaxSettingsClient.js +56 -0
  5. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  6. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  7. package/dist-cjs/commands/BatchDeleteTaxRegistrationCommand.js +29 -0
  8. package/dist-cjs/commands/BatchPutTaxRegistrationCommand.js +29 -0
  9. package/dist-cjs/commands/DeleteTaxRegistrationCommand.js +28 -0
  10. package/dist-cjs/commands/GetTaxRegistrationCommand.js +29 -0
  11. package/dist-cjs/commands/GetTaxRegistrationDocumentCommand.js +28 -0
  12. package/dist-cjs/commands/ListTaxRegistrationsCommand.js +29 -0
  13. package/dist-cjs/commands/PutTaxRegistrationCommand.js +29 -0
  14. package/dist-cjs/commands/index.js +10 -0
  15. package/dist-cjs/endpoint/EndpointParameters.js +18 -0
  16. package/dist-cjs/endpoint/endpointResolver.js +14 -0
  17. package/dist-cjs/endpoint/ruleset.js +7 -0
  18. package/dist-cjs/extensionConfiguration.js +2 -0
  19. package/dist-cjs/index.js +11 -0
  20. package/dist-cjs/models/TaxSettingsServiceException.js +12 -0
  21. package/dist-cjs/models/index.js +4 -0
  22. package/dist-cjs/models/models_0.js +198 -0
  23. package/dist-cjs/pagination/Interfaces.js +2 -0
  24. package/dist-cjs/pagination/ListTaxRegistrationsPaginator.js +7 -0
  25. package/dist-cjs/pagination/index.js +5 -0
  26. package/dist-cjs/protocols/Aws_restJson1.js +311 -0
  27. package/dist-cjs/runtimeConfig.browser.js +39 -0
  28. package/dist-cjs/runtimeConfig.js +49 -0
  29. package/dist-cjs/runtimeConfig.native.js +15 -0
  30. package/dist-cjs/runtimeConfig.shared.js +34 -0
  31. package/dist-cjs/runtimeExtensions.js +25 -0
  32. package/dist-es/TaxSettings.js +21 -0
  33. package/dist-es/TaxSettingsClient.js +52 -0
  34. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  35. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  36. package/dist-es/commands/BatchDeleteTaxRegistrationCommand.js +25 -0
  37. package/dist-es/commands/BatchPutTaxRegistrationCommand.js +25 -0
  38. package/dist-es/commands/DeleteTaxRegistrationCommand.js +24 -0
  39. package/dist-es/commands/GetTaxRegistrationCommand.js +25 -0
  40. package/dist-es/commands/GetTaxRegistrationDocumentCommand.js +24 -0
  41. package/dist-es/commands/ListTaxRegistrationsCommand.js +25 -0
  42. package/dist-es/commands/PutTaxRegistrationCommand.js +25 -0
  43. package/dist-es/commands/index.js +7 -0
  44. package/dist-es/endpoint/EndpointParameters.js +14 -0
  45. package/dist-es/endpoint/endpointResolver.js +10 -0
  46. package/dist-es/endpoint/ruleset.js +4 -0
  47. package/dist-es/extensionConfiguration.js +1 -0
  48. package/dist-es/index.js +6 -0
  49. package/dist-es/models/TaxSettingsServiceException.js +8 -0
  50. package/dist-es/models/index.js +1 -0
  51. package/dist-es/models/models_0.js +178 -0
  52. package/dist-es/pagination/Interfaces.js +1 -0
  53. package/dist-es/pagination/ListTaxRegistrationsPaginator.js +4 -0
  54. package/dist-es/pagination/index.js +2 -0
  55. package/dist-es/protocols/Aws_restJson1.js +294 -0
  56. package/dist-es/runtimeConfig.browser.js +34 -0
  57. package/dist-es/runtimeConfig.js +44 -0
  58. package/dist-es/runtimeConfig.native.js +11 -0
  59. package/dist-es/runtimeConfig.shared.js +30 -0
  60. package/dist-es/runtimeExtensions.js +21 -0
  61. package/dist-types/TaxSettings.d.ts +73 -0
  62. package/dist-types/TaxSettingsClient.d.ts +189 -0
  63. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  64. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  65. package/dist-types/commands/BatchDeleteTaxRegistrationCommand.d.ts +81 -0
  66. package/dist-types/commands/BatchPutTaxRegistrationCommand.d.ts +346 -0
  67. package/dist-types/commands/DeleteTaxRegistrationCommand.d.ts +73 -0
  68. package/dist-types/commands/GetTaxRegistrationCommand.d.ts +158 -0
  69. package/dist-types/commands/GetTaxRegistrationDocumentCommand.d.ts +74 -0
  70. package/dist-types/commands/ListTaxRegistrationsCommand.d.ts +186 -0
  71. package/dist-types/commands/PutTaxRegistrationCommand.d.ts +336 -0
  72. package/dist-types/commands/index.d.ts +7 -0
  73. package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
  74. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  75. package/dist-types/endpoint/ruleset.d.ts +2 -0
  76. package/dist-types/extensionConfiguration.d.ts +9 -0
  77. package/dist-types/index.d.ts +25 -0
  78. package/dist-types/models/TaxSettingsServiceException.d.ts +13 -0
  79. package/dist-types/models/index.d.ts +1 -0
  80. package/dist-types/models/models_0.d.ts +1476 -0
  81. package/dist-types/pagination/Interfaces.d.ts +8 -0
  82. package/dist-types/pagination/ListTaxRegistrationsPaginator.d.ts +7 -0
  83. package/dist-types/pagination/index.d.ts +2 -0
  84. package/dist-types/protocols/Aws_restJson1.d.ts +65 -0
  85. package/dist-types/runtimeConfig.browser.d.ts +45 -0
  86. package/dist-types/runtimeConfig.d.ts +45 -0
  87. package/dist-types/runtimeConfig.native.d.ts +44 -0
  88. package/dist-types/runtimeConfig.shared.d.ts +21 -0
  89. package/dist-types/runtimeExtensions.d.ts +17 -0
  90. package/dist-types/ts3.4/TaxSettings.d.ts +129 -0
  91. package/dist-types/ts3.4/TaxSettingsClient.d.ts +162 -0
  92. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  93. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  94. package/dist-types/ts3.4/commands/BatchDeleteTaxRegistrationCommand.d.ts +39 -0
  95. package/dist-types/ts3.4/commands/BatchPutTaxRegistrationCommand.d.ts +39 -0
  96. package/dist-types/ts3.4/commands/DeleteTaxRegistrationCommand.d.ts +39 -0
  97. package/dist-types/ts3.4/commands/GetTaxRegistrationCommand.d.ts +39 -0
  98. package/dist-types/ts3.4/commands/GetTaxRegistrationDocumentCommand.d.ts +39 -0
  99. package/dist-types/ts3.4/commands/ListTaxRegistrationsCommand.d.ts +39 -0
  100. package/dist-types/ts3.4/commands/PutTaxRegistrationCommand.d.ts +39 -0
  101. package/dist-types/ts3.4/commands/index.d.ts +7 -0
  102. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  103. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  104. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  105. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  106. package/dist-types/ts3.4/index.d.ts +9 -0
  107. package/dist-types/ts3.4/models/TaxSettingsServiceException.d.ts +8 -0
  108. package/dist-types/ts3.4/models/index.d.ts +1 -0
  109. package/dist-types/ts3.4/models/models_0.d.ts +408 -0
  110. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  111. package/dist-types/ts3.4/pagination/ListTaxRegistrationsPaginator.d.ts +11 -0
  112. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  113. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +89 -0
  114. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +85 -0
  115. package/dist-types/ts3.4/runtimeConfig.d.ts +89 -0
  116. package/dist-types/ts3.4/runtimeConfig.native.d.ts +79 -0
  117. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
  118. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  119. package/package.json +101 -0
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_PutTaxRegistrationCommand = exports.de_ListTaxRegistrationsCommand = exports.de_GetTaxRegistrationDocumentCommand = exports.de_GetTaxRegistrationCommand = exports.de_DeleteTaxRegistrationCommand = exports.de_BatchPutTaxRegistrationCommand = exports.de_BatchDeleteTaxRegistrationCommand = exports.se_PutTaxRegistrationCommand = exports.se_ListTaxRegistrationsCommand = exports.se_GetTaxRegistrationDocumentCommand = exports.se_GetTaxRegistrationCommand = exports.se_DeleteTaxRegistrationCommand = exports.se_BatchPutTaxRegistrationCommand = exports.se_BatchDeleteTaxRegistrationCommand = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const core_2 = require("@smithy/core");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ const models_0_1 = require("../models/models_0");
8
+ const TaxSettingsServiceException_1 = require("../models/TaxSettingsServiceException");
9
+ const se_BatchDeleteTaxRegistrationCommand = async (input, context) => {
10
+ const b = (0, core_2.requestBuilder)(input, context);
11
+ const headers = {
12
+ "content-type": "application/json",
13
+ };
14
+ b.bp("/BatchDeleteTaxRegistration");
15
+ let body;
16
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
17
+ accountIds: (_) => (0, smithy_client_1._json)(_),
18
+ }));
19
+ b.m("POST").h(headers).b(body);
20
+ return b.build();
21
+ };
22
+ exports.se_BatchDeleteTaxRegistrationCommand = se_BatchDeleteTaxRegistrationCommand;
23
+ const se_BatchPutTaxRegistrationCommand = async (input, context) => {
24
+ const b = (0, core_2.requestBuilder)(input, context);
25
+ const headers = {
26
+ "content-type": "application/json",
27
+ };
28
+ b.bp("/BatchPutTaxRegistration");
29
+ let body;
30
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
31
+ accountIds: (_) => (0, smithy_client_1._json)(_),
32
+ taxRegistrationEntry: (_) => (0, smithy_client_1._json)(_),
33
+ }));
34
+ b.m("POST").h(headers).b(body);
35
+ return b.build();
36
+ };
37
+ exports.se_BatchPutTaxRegistrationCommand = se_BatchPutTaxRegistrationCommand;
38
+ const se_DeleteTaxRegistrationCommand = async (input, context) => {
39
+ const b = (0, core_2.requestBuilder)(input, context);
40
+ const headers = {
41
+ "content-type": "application/json",
42
+ };
43
+ b.bp("/DeleteTaxRegistration");
44
+ let body;
45
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
46
+ accountId: [],
47
+ }));
48
+ b.m("POST").h(headers).b(body);
49
+ return b.build();
50
+ };
51
+ exports.se_DeleteTaxRegistrationCommand = se_DeleteTaxRegistrationCommand;
52
+ const se_GetTaxRegistrationCommand = async (input, context) => {
53
+ const b = (0, core_2.requestBuilder)(input, context);
54
+ const headers = {
55
+ "content-type": "application/json",
56
+ };
57
+ b.bp("/GetTaxRegistration");
58
+ let body;
59
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
60
+ accountId: [],
61
+ }));
62
+ b.m("POST").h(headers).b(body);
63
+ return b.build();
64
+ };
65
+ exports.se_GetTaxRegistrationCommand = se_GetTaxRegistrationCommand;
66
+ const se_GetTaxRegistrationDocumentCommand = async (input, context) => {
67
+ const b = (0, core_2.requestBuilder)(input, context);
68
+ const headers = {
69
+ "content-type": "application/json",
70
+ };
71
+ b.bp("/GetTaxRegistrationDocument");
72
+ let body;
73
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
74
+ destinationS3Location: (_) => (0, smithy_client_1._json)(_),
75
+ taxDocumentMetadata: (_) => (0, smithy_client_1._json)(_),
76
+ }));
77
+ b.m("POST").h(headers).b(body);
78
+ return b.build();
79
+ };
80
+ exports.se_GetTaxRegistrationDocumentCommand = se_GetTaxRegistrationDocumentCommand;
81
+ const se_ListTaxRegistrationsCommand = async (input, context) => {
82
+ const b = (0, core_2.requestBuilder)(input, context);
83
+ const headers = {
84
+ "content-type": "application/json",
85
+ };
86
+ b.bp("/ListTaxRegistrations");
87
+ let body;
88
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
89
+ maxResults: [],
90
+ nextToken: [],
91
+ }));
92
+ b.m("POST").h(headers).b(body);
93
+ return b.build();
94
+ };
95
+ exports.se_ListTaxRegistrationsCommand = se_ListTaxRegistrationsCommand;
96
+ const se_PutTaxRegistrationCommand = async (input, context) => {
97
+ const b = (0, core_2.requestBuilder)(input, context);
98
+ const headers = {
99
+ "content-type": "application/json",
100
+ };
101
+ b.bp("/PutTaxRegistration");
102
+ let body;
103
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
104
+ accountId: [],
105
+ taxRegistrationEntry: (_) => (0, smithy_client_1._json)(_),
106
+ }));
107
+ b.m("POST").h(headers).b(body);
108
+ return b.build();
109
+ };
110
+ exports.se_PutTaxRegistrationCommand = se_PutTaxRegistrationCommand;
111
+ const de_BatchDeleteTaxRegistrationCommand = async (output, context) => {
112
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
113
+ return de_CommandError(output, context);
114
+ }
115
+ const contents = (0, smithy_client_1.map)({
116
+ $metadata: deserializeMetadata(output),
117
+ });
118
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
119
+ const doc = (0, smithy_client_1.take)(data, {
120
+ errors: smithy_client_1._json,
121
+ });
122
+ Object.assign(contents, doc);
123
+ return contents;
124
+ };
125
+ exports.de_BatchDeleteTaxRegistrationCommand = de_BatchDeleteTaxRegistrationCommand;
126
+ const de_BatchPutTaxRegistrationCommand = async (output, context) => {
127
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
128
+ return de_CommandError(output, context);
129
+ }
130
+ const contents = (0, smithy_client_1.map)({
131
+ $metadata: deserializeMetadata(output),
132
+ });
133
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
134
+ const doc = (0, smithy_client_1.take)(data, {
135
+ errors: smithy_client_1._json,
136
+ status: smithy_client_1.expectString,
137
+ });
138
+ Object.assign(contents, doc);
139
+ return contents;
140
+ };
141
+ exports.de_BatchPutTaxRegistrationCommand = de_BatchPutTaxRegistrationCommand;
142
+ const de_DeleteTaxRegistrationCommand = async (output, context) => {
143
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
144
+ return de_CommandError(output, context);
145
+ }
146
+ const contents = (0, smithy_client_1.map)({
147
+ $metadata: deserializeMetadata(output),
148
+ });
149
+ await (0, smithy_client_1.collectBody)(output.body, context);
150
+ return contents;
151
+ };
152
+ exports.de_DeleteTaxRegistrationCommand = de_DeleteTaxRegistrationCommand;
153
+ const de_GetTaxRegistrationCommand = async (output, context) => {
154
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
155
+ return de_CommandError(output, context);
156
+ }
157
+ const contents = (0, smithy_client_1.map)({
158
+ $metadata: deserializeMetadata(output),
159
+ });
160
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
161
+ const doc = (0, smithy_client_1.take)(data, {
162
+ taxRegistration: smithy_client_1._json,
163
+ });
164
+ Object.assign(contents, doc);
165
+ return contents;
166
+ };
167
+ exports.de_GetTaxRegistrationCommand = de_GetTaxRegistrationCommand;
168
+ const de_GetTaxRegistrationDocumentCommand = async (output, context) => {
169
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
170
+ return de_CommandError(output, context);
171
+ }
172
+ const contents = (0, smithy_client_1.map)({
173
+ $metadata: deserializeMetadata(output),
174
+ });
175
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
176
+ const doc = (0, smithy_client_1.take)(data, {
177
+ destinationFilePath: smithy_client_1.expectString,
178
+ });
179
+ Object.assign(contents, doc);
180
+ return contents;
181
+ };
182
+ exports.de_GetTaxRegistrationDocumentCommand = de_GetTaxRegistrationDocumentCommand;
183
+ const de_ListTaxRegistrationsCommand = async (output, context) => {
184
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
185
+ return de_CommandError(output, context);
186
+ }
187
+ const contents = (0, smithy_client_1.map)({
188
+ $metadata: deserializeMetadata(output),
189
+ });
190
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
191
+ const doc = (0, smithy_client_1.take)(data, {
192
+ accountDetails: smithy_client_1._json,
193
+ nextToken: smithy_client_1.expectString,
194
+ });
195
+ Object.assign(contents, doc);
196
+ return contents;
197
+ };
198
+ exports.de_ListTaxRegistrationsCommand = de_ListTaxRegistrationsCommand;
199
+ const de_PutTaxRegistrationCommand = async (output, context) => {
200
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
201
+ return de_CommandError(output, context);
202
+ }
203
+ const contents = (0, smithy_client_1.map)({
204
+ $metadata: deserializeMetadata(output),
205
+ });
206
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
207
+ const doc = (0, smithy_client_1.take)(data, {
208
+ status: smithy_client_1.expectString,
209
+ });
210
+ Object.assign(contents, doc);
211
+ return contents;
212
+ };
213
+ exports.de_PutTaxRegistrationCommand = de_PutTaxRegistrationCommand;
214
+ const de_CommandError = async (output, context) => {
215
+ const parsedOutput = {
216
+ ...output,
217
+ body: await (0, core_1.parseJsonErrorBody)(output.body, context),
218
+ };
219
+ const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
220
+ switch (errorCode) {
221
+ case "ConflictException":
222
+ case "com.amazonaws.taxsettings#ConflictException":
223
+ throw await de_ConflictExceptionRes(parsedOutput, context);
224
+ case "InternalServerException":
225
+ case "com.amazonaws.taxsettings#InternalServerException":
226
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
227
+ case "ValidationException":
228
+ case "com.amazonaws.taxsettings#ValidationException":
229
+ throw await de_ValidationExceptionRes(parsedOutput, context);
230
+ case "ResourceNotFoundException":
231
+ case "com.amazonaws.taxsettings#ResourceNotFoundException":
232
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
233
+ default:
234
+ const parsedBody = parsedOutput.body;
235
+ return throwDefaultError({
236
+ output,
237
+ parsedBody,
238
+ errorCode,
239
+ });
240
+ }
241
+ };
242
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(TaxSettingsServiceException_1.TaxSettingsServiceException);
243
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
244
+ const contents = (0, smithy_client_1.map)({});
245
+ const data = parsedOutput.body;
246
+ const doc = (0, smithy_client_1.take)(data, {
247
+ errorCode: smithy_client_1.expectString,
248
+ message: smithy_client_1.expectString,
249
+ });
250
+ Object.assign(contents, doc);
251
+ const exception = new models_0_1.ConflictException({
252
+ $metadata: deserializeMetadata(parsedOutput),
253
+ ...contents,
254
+ });
255
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
256
+ };
257
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
258
+ const contents = (0, smithy_client_1.map)({});
259
+ const data = parsedOutput.body;
260
+ const doc = (0, smithy_client_1.take)(data, {
261
+ errorCode: smithy_client_1.expectString,
262
+ message: smithy_client_1.expectString,
263
+ });
264
+ Object.assign(contents, doc);
265
+ const exception = new models_0_1.InternalServerException({
266
+ $metadata: deserializeMetadata(parsedOutput),
267
+ ...contents,
268
+ });
269
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
270
+ };
271
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
272
+ const contents = (0, smithy_client_1.map)({});
273
+ const data = parsedOutput.body;
274
+ const doc = (0, smithy_client_1.take)(data, {
275
+ errorCode: smithy_client_1.expectString,
276
+ message: smithy_client_1.expectString,
277
+ });
278
+ Object.assign(contents, doc);
279
+ const exception = new models_0_1.ResourceNotFoundException({
280
+ $metadata: deserializeMetadata(parsedOutput),
281
+ ...contents,
282
+ });
283
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
284
+ };
285
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
286
+ const contents = (0, smithy_client_1.map)({});
287
+ const data = parsedOutput.body;
288
+ const doc = (0, smithy_client_1.take)(data, {
289
+ errorCode: smithy_client_1.expectString,
290
+ fieldList: smithy_client_1._json,
291
+ message: smithy_client_1.expectString,
292
+ });
293
+ Object.assign(contents, doc);
294
+ const exception = new models_0_1.ValidationException({
295
+ $metadata: deserializeMetadata(parsedOutput),
296
+ ...contents,
297
+ });
298
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
299
+ };
300
+ const deserializeMetadata = (output) => ({
301
+ httpStatusCode: output.statusCode,
302
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
303
+ extendedRequestId: output.headers["x-amz-id-2"],
304
+ cfId: output.headers["x-amz-cf-id"],
305
+ });
306
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
307
+ const isSerializableHeaderValue = (value) => value !== undefined &&
308
+ value !== null &&
309
+ value !== "" &&
310
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
311
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const sha256_browser_1 = require("@aws-crypto/sha256-browser");
7
+ const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
8
+ const config_resolver_1 = require("@smithy/config-resolver");
9
+ const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
10
+ const invalid_dependency_1 = require("@smithy/invalid-dependency");
11
+ const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
12
+ const util_retry_1 = require("@smithy/util-retry");
13
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
14
+ const smithy_client_1 = require("@smithy/smithy-client");
15
+ const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
16
+ const getRuntimeConfig = (config) => {
17
+ const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
18
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
19
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
20
+ return {
21
+ ...clientSharedValues,
22
+ ...config,
23
+ runtime: "browser",
24
+ defaultsMode,
25
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
26
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
27
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
28
+ (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
29
+ maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
30
+ region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
31
+ requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
32
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
33
+ sha256: config?.sha256 ?? sha256_browser_1.Sha256,
34
+ streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
35
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
36
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
37
+ };
38
+ };
39
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
6
+ const core_1 = require("@aws-sdk/core");
7
+ const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
8
+ const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
9
+ const config_resolver_1 = require("@smithy/config-resolver");
10
+ const hash_node_1 = require("@smithy/hash-node");
11
+ const middleware_retry_1 = require("@smithy/middleware-retry");
12
+ const node_config_provider_1 = require("@smithy/node-config-provider");
13
+ const node_http_handler_1 = require("@smithy/node-http-handler");
14
+ const util_body_length_node_1 = require("@smithy/util-body-length-node");
15
+ const util_retry_1 = require("@smithy/util-retry");
16
+ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
17
+ const smithy_client_1 = require("@smithy/smithy-client");
18
+ const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
19
+ const smithy_client_2 = require("@smithy/smithy-client");
20
+ const getRuntimeConfig = (config) => {
21
+ (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
22
+ const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
23
+ const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
24
+ const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
25
+ (0, core_1.emitWarningIfUnsupportedVersion)(process.version);
26
+ return {
27
+ ...clientSharedValues,
28
+ ...config,
29
+ runtime: "node",
30
+ defaultsMode,
31
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
32
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider,
33
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
34
+ (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
35
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
36
+ region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
37
+ requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
38
+ retryMode: config?.retryMode ??
39
+ (0, node_config_provider_1.loadConfig)({
40
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
41
+ default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
42
+ }),
43
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
44
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
45
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
46
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
47
+ };
48
+ };
49
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
+ const getRuntimeConfig = (config) => {
7
+ const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
8
+ return {
9
+ ...browserDefaults,
10
+ ...config,
11
+ runtime: "react-native",
12
+ sha256: config?.sha256 ?? sha256_js_1.Sha256,
13
+ };
14
+ };
15
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const smithy_client_1 = require("@smithy/smithy-client");
6
+ const url_parser_1 = require("@smithy/url-parser");
7
+ const util_base64_1 = require("@smithy/util-base64");
8
+ const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
10
+ const endpointResolver_1 = require("./endpoint/endpointResolver");
11
+ const getRuntimeConfig = (config) => {
12
+ return {
13
+ apiVersion: "2018-05-10",
14
+ base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
15
+ base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
16
+ disableHostPrefix: config?.disableHostPrefix ?? false,
17
+ endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
18
+ extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultTaxSettingsHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
27
+ logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
28
+ serviceId: config?.serviceId ?? "TaxSettings",
29
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
30
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
31
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
32
+ };
33
+ };
34
+ exports.getRuntimeConfig = getRuntimeConfig;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveRuntimeExtensions = void 0;
4
+ const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
+ const protocol_http_1 = require("@smithy/protocol-http");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
8
+ const asPartial = (t) => t;
9
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
10
+ const extensionConfiguration = {
11
+ ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
12
+ ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
13
+ ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
14
+ ...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
15
+ };
16
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
17
+ return {
18
+ ...runtimeConfig,
19
+ ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
20
+ ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
21
+ ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
22
+ ...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
23
+ };
24
+ };
25
+ exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
@@ -0,0 +1,21 @@
1
+ import { createAggregatedClient } from "@smithy/smithy-client";
2
+ import { BatchDeleteTaxRegistrationCommand, } from "./commands/BatchDeleteTaxRegistrationCommand";
3
+ import { BatchPutTaxRegistrationCommand, } from "./commands/BatchPutTaxRegistrationCommand";
4
+ import { DeleteTaxRegistrationCommand, } from "./commands/DeleteTaxRegistrationCommand";
5
+ import { GetTaxRegistrationCommand, } from "./commands/GetTaxRegistrationCommand";
6
+ import { GetTaxRegistrationDocumentCommand, } from "./commands/GetTaxRegistrationDocumentCommand";
7
+ import { ListTaxRegistrationsCommand, } from "./commands/ListTaxRegistrationsCommand";
8
+ import { PutTaxRegistrationCommand, } from "./commands/PutTaxRegistrationCommand";
9
+ import { TaxSettingsClient } from "./TaxSettingsClient";
10
+ const commands = {
11
+ BatchDeleteTaxRegistrationCommand,
12
+ BatchPutTaxRegistrationCommand,
13
+ DeleteTaxRegistrationCommand,
14
+ GetTaxRegistrationCommand,
15
+ GetTaxRegistrationDocumentCommand,
16
+ ListTaxRegistrationsCommand,
17
+ PutTaxRegistrationCommand,
18
+ };
19
+ export class TaxSettings extends TaxSettingsClient {
20
+ }
21
+ createAggregatedClient(commands, TaxSettings);
@@ -0,0 +1,52 @@
1
+ import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
+ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
+ import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
+ import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
5
+ import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
+ import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
+ import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
+ import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
+ import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultTaxSettingsHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
12
+ import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
13
+ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
14
+ import { resolveRuntimeExtensions } from "./runtimeExtensions";
15
+ export { __Client };
16
+ export class TaxSettingsClient extends __Client {
17
+ constructor(...[configuration]) {
18
+ const _config_0 = __getRuntimeConfig(configuration || {});
19
+ const _config_1 = resolveClientEndpointParameters(_config_0);
20
+ const _config_2 = resolveRegionConfig(_config_1);
21
+ const _config_3 = resolveEndpointConfig(_config_2);
22
+ const _config_4 = resolveRetryConfig(_config_3);
23
+ const _config_5 = resolveHostHeaderConfig(_config_4);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
26
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
27
+ super(_config_8);
28
+ this.config = _config_8;
29
+ this.middlewareStack.use(getRetryPlugin(this.config));
30
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
31
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
32
+ this.middlewareStack.use(getLoggerPlugin(this.config));
33
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
34
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
40
+ }
41
+ destroy() {
42
+ super.destroy();
43
+ }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultTaxSettingsHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
52
+ }
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };
@@ -0,0 +1,41 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultTaxSettingsHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ region: (await normalizeProvider(config.region)()) ||
7
+ (() => {
8
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
9
+ })(),
10
+ };
11
+ };
12
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
13
+ return {
14
+ schemeId: "aws.auth#sigv4",
15
+ signingProperties: {
16
+ name: "tax",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultTaxSettingsHttpAuthSchemeProvider = (authParameters) => {
28
+ const options = [];
29
+ switch (authParameters.operation) {
30
+ default: {
31
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
32
+ }
33
+ }
34
+ return options;
35
+ };
36
+ export const resolveHttpAuthSchemeConfig = (config) => {
37
+ const config_0 = resolveAwsSdkSigV4Config(config);
38
+ return {
39
+ ...config_0,
40
+ };
41
+ };
@@ -0,0 +1,25 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { BatchDeleteTaxRegistrationResponseFilterSensitiveLog, } from "../models/models_0";
6
+ import { de_BatchDeleteTaxRegistrationCommand, se_BatchDeleteTaxRegistrationCommand } from "../protocols/Aws_restJson1";
7
+ export { $Command };
8
+ export class BatchDeleteTaxRegistrationCommand extends $Command
9
+ .classBuilder()
10
+ .ep({
11
+ ...commonParams,
12
+ })
13
+ .m(function (Command, cs, config, o) {
14
+ return [
15
+ getSerdePlugin(config, this.serialize, this.deserialize),
16
+ getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
17
+ ];
18
+ })
19
+ .s("TaxSettings", "BatchDeleteTaxRegistration", {})
20
+ .n("TaxSettingsClient", "BatchDeleteTaxRegistrationCommand")
21
+ .f(void 0, BatchDeleteTaxRegistrationResponseFilterSensitiveLog)
22
+ .ser(se_BatchDeleteTaxRegistrationCommand)
23
+ .de(de_BatchDeleteTaxRegistrationCommand)
24
+ .build() {
25
+ }