@aws-sdk/client-payment-cryptography-data 3.489.0 → 3.495.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/PaymentCryptographyData.js +1 -33
- package/dist-cjs/PaymentCryptographyDataClient.js +1 -43
- package/dist-cjs/commands/DecryptDataCommand.js +1 -29
- package/dist-cjs/commands/EncryptDataCommand.js +1 -29
- package/dist-cjs/commands/GenerateCardValidationDataCommand.js +1 -29
- package/dist-cjs/commands/GenerateMacCommand.js +1 -29
- package/dist-cjs/commands/GeneratePinDataCommand.js +1 -29
- package/dist-cjs/commands/ReEncryptDataCommand.js +1 -29
- package/dist-cjs/commands/TranslatePinDataCommand.js +1 -29
- package/dist-cjs/commands/VerifyAuthRequestCryptogramCommand.js +1 -29
- package/dist-cjs/commands/VerifyCardValidationDataCommand.js +1 -29
- package/dist-cjs/commands/VerifyMacCommand.js +1 -29
- package/dist-cjs/commands/VerifyPinDataCommand.js +1 -29
- package/dist-cjs/commands/index.js +1 -14
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +1881 -10
- package/dist-cjs/models/PaymentCryptographyDataServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -530
- package/dist-cjs/protocols/Aws_restJson1.js +1 -881
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +40 -40
|
@@ -1,881 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_VerifyPinDataCommand = exports.de_VerifyMacCommand = exports.de_VerifyCardValidationDataCommand = exports.de_VerifyAuthRequestCryptogramCommand = exports.de_TranslatePinDataCommand = exports.de_ReEncryptDataCommand = exports.de_GeneratePinDataCommand = exports.de_GenerateMacCommand = exports.de_GenerateCardValidationDataCommand = exports.de_EncryptDataCommand = exports.de_DecryptDataCommand = exports.se_VerifyPinDataCommand = exports.se_VerifyMacCommand = exports.se_VerifyCardValidationDataCommand = exports.se_VerifyAuthRequestCryptogramCommand = exports.se_TranslatePinDataCommand = exports.se_ReEncryptDataCommand = exports.se_GeneratePinDataCommand = exports.se_GenerateMacCommand = exports.se_GenerateCardValidationDataCommand = exports.se_EncryptDataCommand = exports.se_DecryptDataCommand = 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 PaymentCryptographyDataServiceException_1 = require("../models/PaymentCryptographyDataServiceException");
|
|
9
|
-
const se_DecryptDataCommand = async (input, context) => {
|
|
10
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
11
|
-
const headers = {
|
|
12
|
-
"content-type": "application/json",
|
|
13
|
-
};
|
|
14
|
-
b.bp("/keys/{KeyIdentifier}/decrypt");
|
|
15
|
-
b.p("KeyIdentifier", () => input.KeyIdentifier, "{KeyIdentifier}", false);
|
|
16
|
-
let body;
|
|
17
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
18
|
-
CipherText: [],
|
|
19
|
-
DecryptionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
20
|
-
}));
|
|
21
|
-
b.m("POST").h(headers).b(body);
|
|
22
|
-
return b.build();
|
|
23
|
-
};
|
|
24
|
-
exports.se_DecryptDataCommand = se_DecryptDataCommand;
|
|
25
|
-
const se_EncryptDataCommand = async (input, context) => {
|
|
26
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
27
|
-
const headers = {
|
|
28
|
-
"content-type": "application/json",
|
|
29
|
-
};
|
|
30
|
-
b.bp("/keys/{KeyIdentifier}/encrypt");
|
|
31
|
-
b.p("KeyIdentifier", () => input.KeyIdentifier, "{KeyIdentifier}", false);
|
|
32
|
-
let body;
|
|
33
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
34
|
-
EncryptionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
35
|
-
PlainText: [],
|
|
36
|
-
}));
|
|
37
|
-
b.m("POST").h(headers).b(body);
|
|
38
|
-
return b.build();
|
|
39
|
-
};
|
|
40
|
-
exports.se_EncryptDataCommand = se_EncryptDataCommand;
|
|
41
|
-
const se_GenerateCardValidationDataCommand = async (input, context) => {
|
|
42
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
43
|
-
const headers = {
|
|
44
|
-
"content-type": "application/json",
|
|
45
|
-
};
|
|
46
|
-
b.bp("/cardvalidationdata/generate");
|
|
47
|
-
let body;
|
|
48
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
49
|
-
GenerationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
50
|
-
KeyIdentifier: [],
|
|
51
|
-
PrimaryAccountNumber: [],
|
|
52
|
-
ValidationDataLength: [],
|
|
53
|
-
}));
|
|
54
|
-
b.m("POST").h(headers).b(body);
|
|
55
|
-
return b.build();
|
|
56
|
-
};
|
|
57
|
-
exports.se_GenerateCardValidationDataCommand = se_GenerateCardValidationDataCommand;
|
|
58
|
-
const se_GenerateMacCommand = async (input, context) => {
|
|
59
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
60
|
-
const headers = {
|
|
61
|
-
"content-type": "application/json",
|
|
62
|
-
};
|
|
63
|
-
b.bp("/mac/generate");
|
|
64
|
-
let body;
|
|
65
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
66
|
-
GenerationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
67
|
-
KeyIdentifier: [],
|
|
68
|
-
MacLength: [],
|
|
69
|
-
MessageData: [],
|
|
70
|
-
}));
|
|
71
|
-
b.m("POST").h(headers).b(body);
|
|
72
|
-
return b.build();
|
|
73
|
-
};
|
|
74
|
-
exports.se_GenerateMacCommand = se_GenerateMacCommand;
|
|
75
|
-
const se_GeneratePinDataCommand = async (input, context) => {
|
|
76
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
77
|
-
const headers = {
|
|
78
|
-
"content-type": "application/json",
|
|
79
|
-
};
|
|
80
|
-
b.bp("/pindata/generate");
|
|
81
|
-
let body;
|
|
82
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
83
|
-
EncryptionKeyIdentifier: [],
|
|
84
|
-
GenerationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
85
|
-
GenerationKeyIdentifier: [],
|
|
86
|
-
PinBlockFormat: [],
|
|
87
|
-
PinDataLength: [],
|
|
88
|
-
PrimaryAccountNumber: [],
|
|
89
|
-
}));
|
|
90
|
-
b.m("POST").h(headers).b(body);
|
|
91
|
-
return b.build();
|
|
92
|
-
};
|
|
93
|
-
exports.se_GeneratePinDataCommand = se_GeneratePinDataCommand;
|
|
94
|
-
const se_ReEncryptDataCommand = async (input, context) => {
|
|
95
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
96
|
-
const headers = {
|
|
97
|
-
"content-type": "application/json",
|
|
98
|
-
};
|
|
99
|
-
b.bp("/keys/{IncomingKeyIdentifier}/reencrypt");
|
|
100
|
-
b.p("IncomingKeyIdentifier", () => input.IncomingKeyIdentifier, "{IncomingKeyIdentifier}", false);
|
|
101
|
-
let body;
|
|
102
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
103
|
-
CipherText: [],
|
|
104
|
-
IncomingEncryptionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
105
|
-
OutgoingEncryptionAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
106
|
-
OutgoingKeyIdentifier: [],
|
|
107
|
-
}));
|
|
108
|
-
b.m("POST").h(headers).b(body);
|
|
109
|
-
return b.build();
|
|
110
|
-
};
|
|
111
|
-
exports.se_ReEncryptDataCommand = se_ReEncryptDataCommand;
|
|
112
|
-
const se_TranslatePinDataCommand = async (input, context) => {
|
|
113
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
114
|
-
const headers = {
|
|
115
|
-
"content-type": "application/json",
|
|
116
|
-
};
|
|
117
|
-
b.bp("/pindata/translate");
|
|
118
|
-
let body;
|
|
119
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
120
|
-
EncryptedPinBlock: [],
|
|
121
|
-
IncomingDukptAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
122
|
-
IncomingKeyIdentifier: [],
|
|
123
|
-
IncomingTranslationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
124
|
-
OutgoingDukptAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
125
|
-
OutgoingKeyIdentifier: [],
|
|
126
|
-
OutgoingTranslationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
127
|
-
}));
|
|
128
|
-
b.m("POST").h(headers).b(body);
|
|
129
|
-
return b.build();
|
|
130
|
-
};
|
|
131
|
-
exports.se_TranslatePinDataCommand = se_TranslatePinDataCommand;
|
|
132
|
-
const se_VerifyAuthRequestCryptogramCommand = async (input, context) => {
|
|
133
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
134
|
-
const headers = {
|
|
135
|
-
"content-type": "application/json",
|
|
136
|
-
};
|
|
137
|
-
b.bp("/cryptogram/verify");
|
|
138
|
-
let body;
|
|
139
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
140
|
-
AuthRequestCryptogram: [],
|
|
141
|
-
AuthResponseAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
142
|
-
KeyIdentifier: [],
|
|
143
|
-
MajorKeyDerivationMode: [],
|
|
144
|
-
SessionKeyDerivationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
145
|
-
TransactionData: [],
|
|
146
|
-
}));
|
|
147
|
-
b.m("POST").h(headers).b(body);
|
|
148
|
-
return b.build();
|
|
149
|
-
};
|
|
150
|
-
exports.se_VerifyAuthRequestCryptogramCommand = se_VerifyAuthRequestCryptogramCommand;
|
|
151
|
-
const se_VerifyCardValidationDataCommand = async (input, context) => {
|
|
152
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
153
|
-
const headers = {
|
|
154
|
-
"content-type": "application/json",
|
|
155
|
-
};
|
|
156
|
-
b.bp("/cardvalidationdata/verify");
|
|
157
|
-
let body;
|
|
158
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
159
|
-
KeyIdentifier: [],
|
|
160
|
-
PrimaryAccountNumber: [],
|
|
161
|
-
ValidationData: [],
|
|
162
|
-
VerificationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
163
|
-
}));
|
|
164
|
-
b.m("POST").h(headers).b(body);
|
|
165
|
-
return b.build();
|
|
166
|
-
};
|
|
167
|
-
exports.se_VerifyCardValidationDataCommand = se_VerifyCardValidationDataCommand;
|
|
168
|
-
const se_VerifyMacCommand = async (input, context) => {
|
|
169
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
170
|
-
const headers = {
|
|
171
|
-
"content-type": "application/json",
|
|
172
|
-
};
|
|
173
|
-
b.bp("/mac/verify");
|
|
174
|
-
let body;
|
|
175
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
176
|
-
KeyIdentifier: [],
|
|
177
|
-
Mac: [],
|
|
178
|
-
MacLength: [],
|
|
179
|
-
MessageData: [],
|
|
180
|
-
VerificationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
181
|
-
}));
|
|
182
|
-
b.m("POST").h(headers).b(body);
|
|
183
|
-
return b.build();
|
|
184
|
-
};
|
|
185
|
-
exports.se_VerifyMacCommand = se_VerifyMacCommand;
|
|
186
|
-
const se_VerifyPinDataCommand = async (input, context) => {
|
|
187
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
188
|
-
const headers = {
|
|
189
|
-
"content-type": "application/json",
|
|
190
|
-
};
|
|
191
|
-
b.bp("/pindata/verify");
|
|
192
|
-
let body;
|
|
193
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
194
|
-
DukptAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
195
|
-
EncryptedPinBlock: [],
|
|
196
|
-
EncryptionKeyIdentifier: [],
|
|
197
|
-
PinBlockFormat: [],
|
|
198
|
-
PinDataLength: [],
|
|
199
|
-
PrimaryAccountNumber: [],
|
|
200
|
-
VerificationAttributes: (_) => (0, smithy_client_1._json)(_),
|
|
201
|
-
VerificationKeyIdentifier: [],
|
|
202
|
-
}));
|
|
203
|
-
b.m("POST").h(headers).b(body);
|
|
204
|
-
return b.build();
|
|
205
|
-
};
|
|
206
|
-
exports.se_VerifyPinDataCommand = se_VerifyPinDataCommand;
|
|
207
|
-
const de_DecryptDataCommand = async (output, context) => {
|
|
208
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
209
|
-
return de_DecryptDataCommandError(output, context);
|
|
210
|
-
}
|
|
211
|
-
const contents = (0, smithy_client_1.map)({
|
|
212
|
-
$metadata: deserializeMetadata(output),
|
|
213
|
-
});
|
|
214
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
215
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
216
|
-
KeyArn: smithy_client_1.expectString,
|
|
217
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
218
|
-
PlainText: smithy_client_1.expectString,
|
|
219
|
-
});
|
|
220
|
-
Object.assign(contents, doc);
|
|
221
|
-
return contents;
|
|
222
|
-
};
|
|
223
|
-
exports.de_DecryptDataCommand = de_DecryptDataCommand;
|
|
224
|
-
const de_DecryptDataCommandError = async (output, context) => {
|
|
225
|
-
const parsedOutput = {
|
|
226
|
-
...output,
|
|
227
|
-
body: await parseErrorBody(output.body, context),
|
|
228
|
-
};
|
|
229
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
230
|
-
switch (errorCode) {
|
|
231
|
-
case "AccessDeniedException":
|
|
232
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
233
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
234
|
-
case "InternalServerException":
|
|
235
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
236
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
237
|
-
case "ResourceNotFoundException":
|
|
238
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
239
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
240
|
-
case "ThrottlingException":
|
|
241
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
242
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
243
|
-
case "ValidationException":
|
|
244
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
245
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
246
|
-
default:
|
|
247
|
-
const parsedBody = parsedOutput.body;
|
|
248
|
-
return throwDefaultError({
|
|
249
|
-
output,
|
|
250
|
-
parsedBody,
|
|
251
|
-
errorCode,
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
const de_EncryptDataCommand = async (output, context) => {
|
|
256
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
257
|
-
return de_EncryptDataCommandError(output, context);
|
|
258
|
-
}
|
|
259
|
-
const contents = (0, smithy_client_1.map)({
|
|
260
|
-
$metadata: deserializeMetadata(output),
|
|
261
|
-
});
|
|
262
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
263
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
264
|
-
CipherText: smithy_client_1.expectString,
|
|
265
|
-
KeyArn: smithy_client_1.expectString,
|
|
266
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
267
|
-
});
|
|
268
|
-
Object.assign(contents, doc);
|
|
269
|
-
return contents;
|
|
270
|
-
};
|
|
271
|
-
exports.de_EncryptDataCommand = de_EncryptDataCommand;
|
|
272
|
-
const de_EncryptDataCommandError = async (output, context) => {
|
|
273
|
-
const parsedOutput = {
|
|
274
|
-
...output,
|
|
275
|
-
body: await parseErrorBody(output.body, context),
|
|
276
|
-
};
|
|
277
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
278
|
-
switch (errorCode) {
|
|
279
|
-
case "AccessDeniedException":
|
|
280
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
281
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
282
|
-
case "InternalServerException":
|
|
283
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
284
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
285
|
-
case "ResourceNotFoundException":
|
|
286
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
287
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
288
|
-
case "ThrottlingException":
|
|
289
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
290
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
291
|
-
case "ValidationException":
|
|
292
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
293
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
294
|
-
default:
|
|
295
|
-
const parsedBody = parsedOutput.body;
|
|
296
|
-
return throwDefaultError({
|
|
297
|
-
output,
|
|
298
|
-
parsedBody,
|
|
299
|
-
errorCode,
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
const de_GenerateCardValidationDataCommand = async (output, context) => {
|
|
304
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
305
|
-
return de_GenerateCardValidationDataCommandError(output, context);
|
|
306
|
-
}
|
|
307
|
-
const contents = (0, smithy_client_1.map)({
|
|
308
|
-
$metadata: deserializeMetadata(output),
|
|
309
|
-
});
|
|
310
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
311
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
312
|
-
KeyArn: smithy_client_1.expectString,
|
|
313
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
314
|
-
ValidationData: smithy_client_1.expectString,
|
|
315
|
-
});
|
|
316
|
-
Object.assign(contents, doc);
|
|
317
|
-
return contents;
|
|
318
|
-
};
|
|
319
|
-
exports.de_GenerateCardValidationDataCommand = de_GenerateCardValidationDataCommand;
|
|
320
|
-
const de_GenerateCardValidationDataCommandError = async (output, context) => {
|
|
321
|
-
const parsedOutput = {
|
|
322
|
-
...output,
|
|
323
|
-
body: await parseErrorBody(output.body, context),
|
|
324
|
-
};
|
|
325
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
326
|
-
switch (errorCode) {
|
|
327
|
-
case "AccessDeniedException":
|
|
328
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
329
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
330
|
-
case "InternalServerException":
|
|
331
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
332
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
333
|
-
case "ResourceNotFoundException":
|
|
334
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
335
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
336
|
-
case "ThrottlingException":
|
|
337
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
338
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
339
|
-
case "ValidationException":
|
|
340
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
341
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
342
|
-
default:
|
|
343
|
-
const parsedBody = parsedOutput.body;
|
|
344
|
-
return throwDefaultError({
|
|
345
|
-
output,
|
|
346
|
-
parsedBody,
|
|
347
|
-
errorCode,
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
const de_GenerateMacCommand = async (output, context) => {
|
|
352
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
353
|
-
return de_GenerateMacCommandError(output, context);
|
|
354
|
-
}
|
|
355
|
-
const contents = (0, smithy_client_1.map)({
|
|
356
|
-
$metadata: deserializeMetadata(output),
|
|
357
|
-
});
|
|
358
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
359
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
360
|
-
KeyArn: smithy_client_1.expectString,
|
|
361
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
362
|
-
Mac: smithy_client_1.expectString,
|
|
363
|
-
});
|
|
364
|
-
Object.assign(contents, doc);
|
|
365
|
-
return contents;
|
|
366
|
-
};
|
|
367
|
-
exports.de_GenerateMacCommand = de_GenerateMacCommand;
|
|
368
|
-
const de_GenerateMacCommandError = async (output, context) => {
|
|
369
|
-
const parsedOutput = {
|
|
370
|
-
...output,
|
|
371
|
-
body: await parseErrorBody(output.body, context),
|
|
372
|
-
};
|
|
373
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
374
|
-
switch (errorCode) {
|
|
375
|
-
case "AccessDeniedException":
|
|
376
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
377
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
378
|
-
case "InternalServerException":
|
|
379
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
380
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
381
|
-
case "ResourceNotFoundException":
|
|
382
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
383
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
384
|
-
case "ThrottlingException":
|
|
385
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
386
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
387
|
-
case "ValidationException":
|
|
388
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
389
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
390
|
-
default:
|
|
391
|
-
const parsedBody = parsedOutput.body;
|
|
392
|
-
return throwDefaultError({
|
|
393
|
-
output,
|
|
394
|
-
parsedBody,
|
|
395
|
-
errorCode,
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
const de_GeneratePinDataCommand = async (output, context) => {
|
|
400
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
401
|
-
return de_GeneratePinDataCommandError(output, context);
|
|
402
|
-
}
|
|
403
|
-
const contents = (0, smithy_client_1.map)({
|
|
404
|
-
$metadata: deserializeMetadata(output),
|
|
405
|
-
});
|
|
406
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
407
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
408
|
-
EncryptedPinBlock: smithy_client_1.expectString,
|
|
409
|
-
EncryptionKeyArn: smithy_client_1.expectString,
|
|
410
|
-
EncryptionKeyCheckValue: smithy_client_1.expectString,
|
|
411
|
-
GenerationKeyArn: smithy_client_1.expectString,
|
|
412
|
-
GenerationKeyCheckValue: smithy_client_1.expectString,
|
|
413
|
-
PinData: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
|
|
414
|
-
});
|
|
415
|
-
Object.assign(contents, doc);
|
|
416
|
-
return contents;
|
|
417
|
-
};
|
|
418
|
-
exports.de_GeneratePinDataCommand = de_GeneratePinDataCommand;
|
|
419
|
-
const de_GeneratePinDataCommandError = async (output, context) => {
|
|
420
|
-
const parsedOutput = {
|
|
421
|
-
...output,
|
|
422
|
-
body: await parseErrorBody(output.body, context),
|
|
423
|
-
};
|
|
424
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
425
|
-
switch (errorCode) {
|
|
426
|
-
case "AccessDeniedException":
|
|
427
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
428
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
429
|
-
case "InternalServerException":
|
|
430
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
431
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
432
|
-
case "ResourceNotFoundException":
|
|
433
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
434
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
435
|
-
case "ThrottlingException":
|
|
436
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
437
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
438
|
-
case "ValidationException":
|
|
439
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
440
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
441
|
-
default:
|
|
442
|
-
const parsedBody = parsedOutput.body;
|
|
443
|
-
return throwDefaultError({
|
|
444
|
-
output,
|
|
445
|
-
parsedBody,
|
|
446
|
-
errorCode,
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
const de_ReEncryptDataCommand = async (output, context) => {
|
|
451
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
452
|
-
return de_ReEncryptDataCommandError(output, context);
|
|
453
|
-
}
|
|
454
|
-
const contents = (0, smithy_client_1.map)({
|
|
455
|
-
$metadata: deserializeMetadata(output),
|
|
456
|
-
});
|
|
457
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
458
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
459
|
-
CipherText: smithy_client_1.expectString,
|
|
460
|
-
KeyArn: smithy_client_1.expectString,
|
|
461
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
462
|
-
});
|
|
463
|
-
Object.assign(contents, doc);
|
|
464
|
-
return contents;
|
|
465
|
-
};
|
|
466
|
-
exports.de_ReEncryptDataCommand = de_ReEncryptDataCommand;
|
|
467
|
-
const de_ReEncryptDataCommandError = async (output, context) => {
|
|
468
|
-
const parsedOutput = {
|
|
469
|
-
...output,
|
|
470
|
-
body: await parseErrorBody(output.body, context),
|
|
471
|
-
};
|
|
472
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
473
|
-
switch (errorCode) {
|
|
474
|
-
case "AccessDeniedException":
|
|
475
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
476
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
477
|
-
case "InternalServerException":
|
|
478
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
479
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
480
|
-
case "ResourceNotFoundException":
|
|
481
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
482
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
483
|
-
case "ThrottlingException":
|
|
484
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
485
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
486
|
-
case "ValidationException":
|
|
487
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
488
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
489
|
-
default:
|
|
490
|
-
const parsedBody = parsedOutput.body;
|
|
491
|
-
return throwDefaultError({
|
|
492
|
-
output,
|
|
493
|
-
parsedBody,
|
|
494
|
-
errorCode,
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
const de_TranslatePinDataCommand = async (output, context) => {
|
|
499
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
500
|
-
return de_TranslatePinDataCommandError(output, context);
|
|
501
|
-
}
|
|
502
|
-
const contents = (0, smithy_client_1.map)({
|
|
503
|
-
$metadata: deserializeMetadata(output),
|
|
504
|
-
});
|
|
505
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
506
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
507
|
-
KeyArn: smithy_client_1.expectString,
|
|
508
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
509
|
-
PinBlock: smithy_client_1.expectString,
|
|
510
|
-
});
|
|
511
|
-
Object.assign(contents, doc);
|
|
512
|
-
return contents;
|
|
513
|
-
};
|
|
514
|
-
exports.de_TranslatePinDataCommand = de_TranslatePinDataCommand;
|
|
515
|
-
const de_TranslatePinDataCommandError = async (output, context) => {
|
|
516
|
-
const parsedOutput = {
|
|
517
|
-
...output,
|
|
518
|
-
body: await parseErrorBody(output.body, context),
|
|
519
|
-
};
|
|
520
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
521
|
-
switch (errorCode) {
|
|
522
|
-
case "AccessDeniedException":
|
|
523
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
524
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
525
|
-
case "InternalServerException":
|
|
526
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
527
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
528
|
-
case "ResourceNotFoundException":
|
|
529
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
530
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
531
|
-
case "ThrottlingException":
|
|
532
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
533
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
534
|
-
case "ValidationException":
|
|
535
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
536
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
537
|
-
default:
|
|
538
|
-
const parsedBody = parsedOutput.body;
|
|
539
|
-
return throwDefaultError({
|
|
540
|
-
output,
|
|
541
|
-
parsedBody,
|
|
542
|
-
errorCode,
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
const de_VerifyAuthRequestCryptogramCommand = async (output, context) => {
|
|
547
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
548
|
-
return de_VerifyAuthRequestCryptogramCommandError(output, context);
|
|
549
|
-
}
|
|
550
|
-
const contents = (0, smithy_client_1.map)({
|
|
551
|
-
$metadata: deserializeMetadata(output),
|
|
552
|
-
});
|
|
553
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
554
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
555
|
-
AuthResponseValue: smithy_client_1.expectString,
|
|
556
|
-
KeyArn: smithy_client_1.expectString,
|
|
557
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
558
|
-
});
|
|
559
|
-
Object.assign(contents, doc);
|
|
560
|
-
return contents;
|
|
561
|
-
};
|
|
562
|
-
exports.de_VerifyAuthRequestCryptogramCommand = de_VerifyAuthRequestCryptogramCommand;
|
|
563
|
-
const de_VerifyAuthRequestCryptogramCommandError = async (output, context) => {
|
|
564
|
-
const parsedOutput = {
|
|
565
|
-
...output,
|
|
566
|
-
body: await parseErrorBody(output.body, context),
|
|
567
|
-
};
|
|
568
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
569
|
-
switch (errorCode) {
|
|
570
|
-
case "AccessDeniedException":
|
|
571
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
572
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
573
|
-
case "InternalServerException":
|
|
574
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
575
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
576
|
-
case "ResourceNotFoundException":
|
|
577
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
578
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
579
|
-
case "ThrottlingException":
|
|
580
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
581
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
582
|
-
case "ValidationException":
|
|
583
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
584
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
585
|
-
case "VerificationFailedException":
|
|
586
|
-
case "com.amazonaws.paymentcryptographydata#VerificationFailedException":
|
|
587
|
-
throw await de_VerificationFailedExceptionRes(parsedOutput, context);
|
|
588
|
-
default:
|
|
589
|
-
const parsedBody = parsedOutput.body;
|
|
590
|
-
return throwDefaultError({
|
|
591
|
-
output,
|
|
592
|
-
parsedBody,
|
|
593
|
-
errorCode,
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
const de_VerifyCardValidationDataCommand = async (output, context) => {
|
|
598
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
599
|
-
return de_VerifyCardValidationDataCommandError(output, context);
|
|
600
|
-
}
|
|
601
|
-
const contents = (0, smithy_client_1.map)({
|
|
602
|
-
$metadata: deserializeMetadata(output),
|
|
603
|
-
});
|
|
604
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
605
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
606
|
-
KeyArn: smithy_client_1.expectString,
|
|
607
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
608
|
-
});
|
|
609
|
-
Object.assign(contents, doc);
|
|
610
|
-
return contents;
|
|
611
|
-
};
|
|
612
|
-
exports.de_VerifyCardValidationDataCommand = de_VerifyCardValidationDataCommand;
|
|
613
|
-
const de_VerifyCardValidationDataCommandError = async (output, context) => {
|
|
614
|
-
const parsedOutput = {
|
|
615
|
-
...output,
|
|
616
|
-
body: await parseErrorBody(output.body, context),
|
|
617
|
-
};
|
|
618
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
619
|
-
switch (errorCode) {
|
|
620
|
-
case "AccessDeniedException":
|
|
621
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
622
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
623
|
-
case "InternalServerException":
|
|
624
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
625
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
626
|
-
case "ResourceNotFoundException":
|
|
627
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
628
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
629
|
-
case "ThrottlingException":
|
|
630
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
631
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
632
|
-
case "ValidationException":
|
|
633
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
634
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
635
|
-
case "VerificationFailedException":
|
|
636
|
-
case "com.amazonaws.paymentcryptographydata#VerificationFailedException":
|
|
637
|
-
throw await de_VerificationFailedExceptionRes(parsedOutput, context);
|
|
638
|
-
default:
|
|
639
|
-
const parsedBody = parsedOutput.body;
|
|
640
|
-
return throwDefaultError({
|
|
641
|
-
output,
|
|
642
|
-
parsedBody,
|
|
643
|
-
errorCode,
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
const de_VerifyMacCommand = async (output, context) => {
|
|
648
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
649
|
-
return de_VerifyMacCommandError(output, context);
|
|
650
|
-
}
|
|
651
|
-
const contents = (0, smithy_client_1.map)({
|
|
652
|
-
$metadata: deserializeMetadata(output),
|
|
653
|
-
});
|
|
654
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
655
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
656
|
-
KeyArn: smithy_client_1.expectString,
|
|
657
|
-
KeyCheckValue: smithy_client_1.expectString,
|
|
658
|
-
});
|
|
659
|
-
Object.assign(contents, doc);
|
|
660
|
-
return contents;
|
|
661
|
-
};
|
|
662
|
-
exports.de_VerifyMacCommand = de_VerifyMacCommand;
|
|
663
|
-
const de_VerifyMacCommandError = async (output, context) => {
|
|
664
|
-
const parsedOutput = {
|
|
665
|
-
...output,
|
|
666
|
-
body: await parseErrorBody(output.body, context),
|
|
667
|
-
};
|
|
668
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
669
|
-
switch (errorCode) {
|
|
670
|
-
case "AccessDeniedException":
|
|
671
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
672
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
673
|
-
case "InternalServerException":
|
|
674
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
675
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
676
|
-
case "ResourceNotFoundException":
|
|
677
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
678
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
679
|
-
case "ThrottlingException":
|
|
680
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
681
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
682
|
-
case "ValidationException":
|
|
683
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
684
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
685
|
-
case "VerificationFailedException":
|
|
686
|
-
case "com.amazonaws.paymentcryptographydata#VerificationFailedException":
|
|
687
|
-
throw await de_VerificationFailedExceptionRes(parsedOutput, context);
|
|
688
|
-
default:
|
|
689
|
-
const parsedBody = parsedOutput.body;
|
|
690
|
-
return throwDefaultError({
|
|
691
|
-
output,
|
|
692
|
-
parsedBody,
|
|
693
|
-
errorCode,
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
};
|
|
697
|
-
const de_VerifyPinDataCommand = async (output, context) => {
|
|
698
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
699
|
-
return de_VerifyPinDataCommandError(output, context);
|
|
700
|
-
}
|
|
701
|
-
const contents = (0, smithy_client_1.map)({
|
|
702
|
-
$metadata: deserializeMetadata(output),
|
|
703
|
-
});
|
|
704
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
705
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
706
|
-
EncryptionKeyArn: smithy_client_1.expectString,
|
|
707
|
-
EncryptionKeyCheckValue: smithy_client_1.expectString,
|
|
708
|
-
VerificationKeyArn: smithy_client_1.expectString,
|
|
709
|
-
VerificationKeyCheckValue: smithy_client_1.expectString,
|
|
710
|
-
});
|
|
711
|
-
Object.assign(contents, doc);
|
|
712
|
-
return contents;
|
|
713
|
-
};
|
|
714
|
-
exports.de_VerifyPinDataCommand = de_VerifyPinDataCommand;
|
|
715
|
-
const de_VerifyPinDataCommandError = async (output, context) => {
|
|
716
|
-
const parsedOutput = {
|
|
717
|
-
...output,
|
|
718
|
-
body: await parseErrorBody(output.body, context),
|
|
719
|
-
};
|
|
720
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
721
|
-
switch (errorCode) {
|
|
722
|
-
case "AccessDeniedException":
|
|
723
|
-
case "com.amazonaws.paymentcryptographydata#AccessDeniedException":
|
|
724
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
725
|
-
case "InternalServerException":
|
|
726
|
-
case "com.amazonaws.paymentcryptographydata#InternalServerException":
|
|
727
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
728
|
-
case "ResourceNotFoundException":
|
|
729
|
-
case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException":
|
|
730
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
731
|
-
case "ThrottlingException":
|
|
732
|
-
case "com.amazonaws.paymentcryptographydata#ThrottlingException":
|
|
733
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
734
|
-
case "ValidationException":
|
|
735
|
-
case "com.amazonaws.paymentcryptographydata#ValidationException":
|
|
736
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
737
|
-
case "VerificationFailedException":
|
|
738
|
-
case "com.amazonaws.paymentcryptographydata#VerificationFailedException":
|
|
739
|
-
throw await de_VerificationFailedExceptionRes(parsedOutput, context);
|
|
740
|
-
default:
|
|
741
|
-
const parsedBody = parsedOutput.body;
|
|
742
|
-
return throwDefaultError({
|
|
743
|
-
output,
|
|
744
|
-
parsedBody,
|
|
745
|
-
errorCode,
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(PaymentCryptographyDataServiceException_1.PaymentCryptographyDataServiceException);
|
|
750
|
-
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
751
|
-
const contents = (0, smithy_client_1.map)({});
|
|
752
|
-
const data = parsedOutput.body;
|
|
753
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
754
|
-
Message: smithy_client_1.expectString,
|
|
755
|
-
});
|
|
756
|
-
Object.assign(contents, doc);
|
|
757
|
-
const exception = new models_0_1.AccessDeniedException({
|
|
758
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
759
|
-
...contents,
|
|
760
|
-
});
|
|
761
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
762
|
-
};
|
|
763
|
-
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
764
|
-
const contents = (0, smithy_client_1.map)({});
|
|
765
|
-
const data = parsedOutput.body;
|
|
766
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
767
|
-
Message: smithy_client_1.expectString,
|
|
768
|
-
});
|
|
769
|
-
Object.assign(contents, doc);
|
|
770
|
-
const exception = new models_0_1.InternalServerException({
|
|
771
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
772
|
-
...contents,
|
|
773
|
-
});
|
|
774
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
775
|
-
};
|
|
776
|
-
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
777
|
-
const contents = (0, smithy_client_1.map)({});
|
|
778
|
-
const data = parsedOutput.body;
|
|
779
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
780
|
-
ResourceId: smithy_client_1.expectString,
|
|
781
|
-
});
|
|
782
|
-
Object.assign(contents, doc);
|
|
783
|
-
const exception = new models_0_1.ResourceNotFoundException({
|
|
784
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
785
|
-
...contents,
|
|
786
|
-
});
|
|
787
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
788
|
-
};
|
|
789
|
-
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
790
|
-
const contents = (0, smithy_client_1.map)({});
|
|
791
|
-
const data = parsedOutput.body;
|
|
792
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
793
|
-
Message: smithy_client_1.expectString,
|
|
794
|
-
});
|
|
795
|
-
Object.assign(contents, doc);
|
|
796
|
-
const exception = new models_0_1.ThrottlingException({
|
|
797
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
798
|
-
...contents,
|
|
799
|
-
});
|
|
800
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
801
|
-
};
|
|
802
|
-
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
803
|
-
const contents = (0, smithy_client_1.map)({});
|
|
804
|
-
const data = parsedOutput.body;
|
|
805
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
806
|
-
fieldList: smithy_client_1._json,
|
|
807
|
-
message: smithy_client_1.expectString,
|
|
808
|
-
});
|
|
809
|
-
Object.assign(contents, doc);
|
|
810
|
-
const exception = new models_0_1.ValidationException({
|
|
811
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
812
|
-
...contents,
|
|
813
|
-
});
|
|
814
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
815
|
-
};
|
|
816
|
-
const de_VerificationFailedExceptionRes = async (parsedOutput, context) => {
|
|
817
|
-
const contents = (0, smithy_client_1.map)({});
|
|
818
|
-
const data = parsedOutput.body;
|
|
819
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
820
|
-
Message: smithy_client_1.expectString,
|
|
821
|
-
Reason: smithy_client_1.expectString,
|
|
822
|
-
});
|
|
823
|
-
Object.assign(contents, doc);
|
|
824
|
-
const exception = new models_0_1.VerificationFailedException({
|
|
825
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
826
|
-
...contents,
|
|
827
|
-
});
|
|
828
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
829
|
-
};
|
|
830
|
-
const deserializeMetadata = (output) => ({
|
|
831
|
-
httpStatusCode: output.statusCode,
|
|
832
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
833
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
834
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
835
|
-
});
|
|
836
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
837
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
838
|
-
value !== null &&
|
|
839
|
-
value !== "" &&
|
|
840
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
841
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
842
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
843
|
-
if (encoded.length) {
|
|
844
|
-
return JSON.parse(encoded);
|
|
845
|
-
}
|
|
846
|
-
return {};
|
|
847
|
-
});
|
|
848
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
849
|
-
const value = await parseBody(errorBody, context);
|
|
850
|
-
value.message = value.message ?? value.Message;
|
|
851
|
-
return value;
|
|
852
|
-
};
|
|
853
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
854
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
855
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
856
|
-
let cleanValue = rawValue;
|
|
857
|
-
if (typeof cleanValue === "number") {
|
|
858
|
-
cleanValue = cleanValue.toString();
|
|
859
|
-
}
|
|
860
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
861
|
-
cleanValue = cleanValue.split(",")[0];
|
|
862
|
-
}
|
|
863
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
864
|
-
cleanValue = cleanValue.split(":")[0];
|
|
865
|
-
}
|
|
866
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
867
|
-
cleanValue = cleanValue.split("#")[1];
|
|
868
|
-
}
|
|
869
|
-
return cleanValue;
|
|
870
|
-
};
|
|
871
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
872
|
-
if (headerKey !== undefined) {
|
|
873
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
874
|
-
}
|
|
875
|
-
if (data.code !== undefined) {
|
|
876
|
-
return sanitizeErrorCode(data.code);
|
|
877
|
-
}
|
|
878
|
-
if (data["__type"] !== undefined) {
|
|
879
|
-
return sanitizeErrorCode(data["__type"]);
|
|
880
|
-
}
|
|
881
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|