@aws-sdk/client-support-app 3.155.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 (108) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +260 -0
  4. package/dist-cjs/SupportApp.js +142 -0
  5. package/dist-cjs/SupportAppClient.js +37 -0
  6. package/dist-cjs/commands/CreateSlackChannelConfigurationCommand.js +36 -0
  7. package/dist-cjs/commands/DeleteAccountAliasCommand.js +36 -0
  8. package/dist-cjs/commands/DeleteSlackChannelConfigurationCommand.js +36 -0
  9. package/dist-cjs/commands/DeleteSlackWorkspaceConfigurationCommand.js +36 -0
  10. package/dist-cjs/commands/GetAccountAliasCommand.js +36 -0
  11. package/dist-cjs/commands/ListSlackChannelConfigurationsCommand.js +36 -0
  12. package/dist-cjs/commands/ListSlackWorkspaceConfigurationsCommand.js +36 -0
  13. package/dist-cjs/commands/PutAccountAliasCommand.js +36 -0
  14. package/dist-cjs/commands/UpdateSlackChannelConfigurationCommand.js +36 -0
  15. package/dist-cjs/commands/index.js +12 -0
  16. package/dist-cjs/endpoints.js +131 -0
  17. package/dist-cjs/index.js +11 -0
  18. package/dist-cjs/models/SupportAppServiceException.js +11 -0
  19. package/dist-cjs/models/index.js +4 -0
  20. package/dist-cjs/models/models_0.js +168 -0
  21. package/dist-cjs/pagination/Interfaces.js +2 -0
  22. package/dist-cjs/pagination/ListSlackChannelConfigurationsPaginator.js +35 -0
  23. package/dist-cjs/pagination/ListSlackWorkspaceConfigurationsPaginator.js +35 -0
  24. package/dist-cjs/pagination/index.js +6 -0
  25. package/dist-cjs/protocols/Aws_restJson1.js +766 -0
  26. package/dist-cjs/runtimeConfig.browser.js +45 -0
  27. package/dist-cjs/runtimeConfig.js +52 -0
  28. package/dist-cjs/runtimeConfig.native.js +16 -0
  29. package/dist-cjs/runtimeConfig.shared.js +17 -0
  30. package/dist-es/SupportApp.js +145 -0
  31. package/dist-es/SupportAppClient.js +39 -0
  32. package/dist-es/commands/CreateSlackChannelConfigurationCommand.js +39 -0
  33. package/dist-es/commands/DeleteAccountAliasCommand.js +39 -0
  34. package/dist-es/commands/DeleteSlackChannelConfigurationCommand.js +39 -0
  35. package/dist-es/commands/DeleteSlackWorkspaceConfigurationCommand.js +39 -0
  36. package/dist-es/commands/GetAccountAliasCommand.js +39 -0
  37. package/dist-es/commands/ListSlackChannelConfigurationsCommand.js +39 -0
  38. package/dist-es/commands/ListSlackWorkspaceConfigurationsCommand.js +39 -0
  39. package/dist-es/commands/PutAccountAliasCommand.js +39 -0
  40. package/dist-es/commands/UpdateSlackChannelConfigurationCommand.js +39 -0
  41. package/dist-es/commands/index.js +9 -0
  42. package/dist-es/endpoints.js +127 -0
  43. package/dist-es/index.js +6 -0
  44. package/dist-es/models/SupportAppServiceException.js +12 -0
  45. package/dist-es/models/index.js +1 -0
  46. package/dist-es/models/models_0.js +100 -0
  47. package/dist-es/pagination/Interfaces.js +1 -0
  48. package/dist-es/pagination/ListSlackChannelConfigurationsPaginator.js +74 -0
  49. package/dist-es/pagination/ListSlackWorkspaceConfigurationsPaginator.js +74 -0
  50. package/dist-es/pagination/index.js +3 -0
  51. package/dist-es/protocols/Aws_restJson1.js +997 -0
  52. package/dist-es/runtimeConfig.browser.js +26 -0
  53. package/dist-es/runtimeConfig.js +30 -0
  54. package/dist-es/runtimeConfig.native.js +8 -0
  55. package/dist-es/runtimeConfig.shared.js +13 -0
  56. package/dist-types/SupportApp.d.ts +150 -0
  57. package/dist-types/SupportAppClient.d.ts +207 -0
  58. package/dist-types/commands/CreateSlackChannelConfigurationCommand.d.ts +55 -0
  59. package/dist-types/commands/DeleteAccountAliasCommand.d.ts +36 -0
  60. package/dist-types/commands/DeleteSlackChannelConfigurationCommand.d.ts +36 -0
  61. package/dist-types/commands/DeleteSlackWorkspaceConfigurationCommand.d.ts +36 -0
  62. package/dist-types/commands/GetAccountAliasCommand.d.ts +36 -0
  63. package/dist-types/commands/ListSlackChannelConfigurationsCommand.d.ts +35 -0
  64. package/dist-types/commands/ListSlackWorkspaceConfigurationsCommand.d.ts +35 -0
  65. package/dist-types/commands/PutAccountAliasCommand.d.ts +37 -0
  66. package/dist-types/commands/UpdateSlackChannelConfigurationCommand.d.ts +35 -0
  67. package/dist-types/commands/index.d.ts +9 -0
  68. package/dist-types/endpoints.d.ts +2 -0
  69. package/dist-types/index.d.ts +6 -0
  70. package/dist-types/models/SupportAppServiceException.d.ts +10 -0
  71. package/dist-types/models/index.d.ts +1 -0
  72. package/dist-types/models/models_0.d.ts +502 -0
  73. package/dist-types/pagination/Interfaces.d.ts +6 -0
  74. package/dist-types/pagination/ListSlackChannelConfigurationsPaginator.d.ts +4 -0
  75. package/dist-types/pagination/ListSlackWorkspaceConfigurationsPaginator.d.ts +4 -0
  76. package/dist-types/pagination/index.d.ts +3 -0
  77. package/dist-types/protocols/Aws_restJson1.d.ts +29 -0
  78. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  79. package/dist-types/runtimeConfig.d.ts +40 -0
  80. package/dist-types/runtimeConfig.native.d.ts +39 -0
  81. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  82. package/dist-types/ts3.4/SupportApp.d.ts +50 -0
  83. package/dist-types/ts3.4/SupportAppClient.d.ts +82 -0
  84. package/dist-types/ts3.4/commands/CreateSlackChannelConfigurationCommand.d.ts +17 -0
  85. package/dist-types/ts3.4/commands/DeleteAccountAliasCommand.d.ts +17 -0
  86. package/dist-types/ts3.4/commands/DeleteSlackChannelConfigurationCommand.d.ts +17 -0
  87. package/dist-types/ts3.4/commands/DeleteSlackWorkspaceConfigurationCommand.d.ts +17 -0
  88. package/dist-types/ts3.4/commands/GetAccountAliasCommand.d.ts +17 -0
  89. package/dist-types/ts3.4/commands/ListSlackChannelConfigurationsCommand.d.ts +17 -0
  90. package/dist-types/ts3.4/commands/ListSlackWorkspaceConfigurationsCommand.d.ts +17 -0
  91. package/dist-types/ts3.4/commands/PutAccountAliasCommand.d.ts +17 -0
  92. package/dist-types/ts3.4/commands/UpdateSlackChannelConfigurationCommand.d.ts +17 -0
  93. package/dist-types/ts3.4/commands/index.d.ts +9 -0
  94. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  95. package/dist-types/ts3.4/index.d.ts +6 -0
  96. package/dist-types/ts3.4/models/SupportAppServiceException.d.ts +6 -0
  97. package/dist-types/ts3.4/models/index.d.ts +1 -0
  98. package/dist-types/ts3.4/models/models_0.d.ts +219 -0
  99. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  100. package/dist-types/ts3.4/pagination/ListSlackChannelConfigurationsPaginator.d.ts +4 -0
  101. package/dist-types/ts3.4/pagination/ListSlackWorkspaceConfigurationsPaginator.d.ts +4 -0
  102. package/dist-types/ts3.4/pagination/index.d.ts +3 -0
  103. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +29 -0
  104. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  105. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  106. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  107. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  108. package/package.json +99 -0
@@ -0,0 +1,766 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1UpdateSlackChannelConfigurationCommand = exports.deserializeAws_restJson1PutAccountAliasCommand = exports.deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = exports.deserializeAws_restJson1ListSlackChannelConfigurationsCommand = exports.deserializeAws_restJson1GetAccountAliasCommand = exports.deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = exports.deserializeAws_restJson1DeleteSlackChannelConfigurationCommand = exports.deserializeAws_restJson1DeleteAccountAliasCommand = exports.deserializeAws_restJson1CreateSlackChannelConfigurationCommand = exports.serializeAws_restJson1UpdateSlackChannelConfigurationCommand = exports.serializeAws_restJson1PutAccountAliasCommand = exports.serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = exports.serializeAws_restJson1ListSlackChannelConfigurationsCommand = exports.serializeAws_restJson1GetAccountAliasCommand = exports.serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = exports.serializeAws_restJson1DeleteSlackChannelConfigurationCommand = exports.serializeAws_restJson1DeleteAccountAliasCommand = exports.serializeAws_restJson1CreateSlackChannelConfigurationCommand = void 0;
4
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const SupportAppServiceException_1 = require("../models/SupportAppServiceException");
8
+ const serializeAws_restJson1CreateSlackChannelConfigurationCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
14
+ "/control/create-slack-channel-configuration";
15
+ let body;
16
+ body = JSON.stringify({
17
+ ...(input.channelId != null && { channelId: input.channelId }),
18
+ ...(input.channelName != null && { channelName: input.channelName }),
19
+ ...(input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn }),
20
+ ...(input.notifyOnAddCorrespondenceToCase != null && {
21
+ notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
22
+ }),
23
+ ...(input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity }),
24
+ ...(input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase }),
25
+ ...(input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase }),
26
+ ...(input.teamId != null && { teamId: input.teamId }),
27
+ });
28
+ return new protocol_http_1.HttpRequest({
29
+ protocol,
30
+ hostname,
31
+ port,
32
+ method: "POST",
33
+ headers,
34
+ path: resolvedPath,
35
+ body,
36
+ });
37
+ };
38
+ exports.serializeAws_restJson1CreateSlackChannelConfigurationCommand = serializeAws_restJson1CreateSlackChannelConfigurationCommand;
39
+ const serializeAws_restJson1DeleteAccountAliasCommand = async (input, context) => {
40
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const headers = {
42
+ "content-type": "application/json",
43
+ };
44
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/control/delete-account-alias";
45
+ let body;
46
+ body = "";
47
+ return new protocol_http_1.HttpRequest({
48
+ protocol,
49
+ hostname,
50
+ port,
51
+ method: "POST",
52
+ headers,
53
+ path: resolvedPath,
54
+ body,
55
+ });
56
+ };
57
+ exports.serializeAws_restJson1DeleteAccountAliasCommand = serializeAws_restJson1DeleteAccountAliasCommand;
58
+ const serializeAws_restJson1DeleteSlackChannelConfigurationCommand = async (input, context) => {
59
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
60
+ const headers = {
61
+ "content-type": "application/json",
62
+ };
63
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
64
+ "/control/delete-slack-channel-configuration";
65
+ let body;
66
+ body = JSON.stringify({
67
+ ...(input.channelId != null && { channelId: input.channelId }),
68
+ ...(input.teamId != null && { teamId: input.teamId }),
69
+ });
70
+ return new protocol_http_1.HttpRequest({
71
+ protocol,
72
+ hostname,
73
+ port,
74
+ method: "POST",
75
+ headers,
76
+ path: resolvedPath,
77
+ body,
78
+ });
79
+ };
80
+ exports.serializeAws_restJson1DeleteSlackChannelConfigurationCommand = serializeAws_restJson1DeleteSlackChannelConfigurationCommand;
81
+ const serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = async (input, context) => {
82
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
83
+ const headers = {
84
+ "content-type": "application/json",
85
+ };
86
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
87
+ "/control/delete-slack-workspace-configuration";
88
+ let body;
89
+ body = JSON.stringify({
90
+ ...(input.teamId != null && { teamId: input.teamId }),
91
+ });
92
+ return new protocol_http_1.HttpRequest({
93
+ protocol,
94
+ hostname,
95
+ port,
96
+ method: "POST",
97
+ headers,
98
+ path: resolvedPath,
99
+ body,
100
+ });
101
+ };
102
+ exports.serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = serializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand;
103
+ const serializeAws_restJson1GetAccountAliasCommand = async (input, context) => {
104
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
+ const headers = {
106
+ "content-type": "application/json",
107
+ };
108
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/control/get-account-alias";
109
+ let body;
110
+ body = "";
111
+ return new protocol_http_1.HttpRequest({
112
+ protocol,
113
+ hostname,
114
+ port,
115
+ method: "POST",
116
+ headers,
117
+ path: resolvedPath,
118
+ body,
119
+ });
120
+ };
121
+ exports.serializeAws_restJson1GetAccountAliasCommand = serializeAws_restJson1GetAccountAliasCommand;
122
+ const serializeAws_restJson1ListSlackChannelConfigurationsCommand = async (input, context) => {
123
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
+ const headers = {
125
+ "content-type": "application/json",
126
+ };
127
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
128
+ "/control/list-slack-channel-configurations";
129
+ let body;
130
+ body = JSON.stringify({
131
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
132
+ });
133
+ return new protocol_http_1.HttpRequest({
134
+ protocol,
135
+ hostname,
136
+ port,
137
+ method: "POST",
138
+ headers,
139
+ path: resolvedPath,
140
+ body,
141
+ });
142
+ };
143
+ exports.serializeAws_restJson1ListSlackChannelConfigurationsCommand = serializeAws_restJson1ListSlackChannelConfigurationsCommand;
144
+ const serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = async (input, context) => {
145
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
146
+ const headers = {
147
+ "content-type": "application/json",
148
+ };
149
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
150
+ "/control/list-slack-workspace-configurations";
151
+ let body;
152
+ body = JSON.stringify({
153
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
154
+ });
155
+ return new protocol_http_1.HttpRequest({
156
+ protocol,
157
+ hostname,
158
+ port,
159
+ method: "POST",
160
+ headers,
161
+ path: resolvedPath,
162
+ body,
163
+ });
164
+ };
165
+ exports.serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = serializeAws_restJson1ListSlackWorkspaceConfigurationsCommand;
166
+ const serializeAws_restJson1PutAccountAliasCommand = async (input, context) => {
167
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
168
+ const headers = {
169
+ "content-type": "application/json",
170
+ };
171
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/control/put-account-alias";
172
+ let body;
173
+ body = JSON.stringify({
174
+ ...(input.accountAlias != null && { accountAlias: input.accountAlias }),
175
+ });
176
+ return new protocol_http_1.HttpRequest({
177
+ protocol,
178
+ hostname,
179
+ port,
180
+ method: "POST",
181
+ headers,
182
+ path: resolvedPath,
183
+ body,
184
+ });
185
+ };
186
+ exports.serializeAws_restJson1PutAccountAliasCommand = serializeAws_restJson1PutAccountAliasCommand;
187
+ const serializeAws_restJson1UpdateSlackChannelConfigurationCommand = async (input, context) => {
188
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
+ const headers = {
190
+ "content-type": "application/json",
191
+ };
192
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
193
+ "/control/update-slack-channel-configuration";
194
+ let body;
195
+ body = JSON.stringify({
196
+ ...(input.channelId != null && { channelId: input.channelId }),
197
+ ...(input.channelName != null && { channelName: input.channelName }),
198
+ ...(input.channelRoleArn != null && { channelRoleArn: input.channelRoleArn }),
199
+ ...(input.notifyOnAddCorrespondenceToCase != null && {
200
+ notifyOnAddCorrespondenceToCase: input.notifyOnAddCorrespondenceToCase,
201
+ }),
202
+ ...(input.notifyOnCaseSeverity != null && { notifyOnCaseSeverity: input.notifyOnCaseSeverity }),
203
+ ...(input.notifyOnCreateOrReopenCase != null && { notifyOnCreateOrReopenCase: input.notifyOnCreateOrReopenCase }),
204
+ ...(input.notifyOnResolveCase != null && { notifyOnResolveCase: input.notifyOnResolveCase }),
205
+ ...(input.teamId != null && { teamId: input.teamId }),
206
+ });
207
+ return new protocol_http_1.HttpRequest({
208
+ protocol,
209
+ hostname,
210
+ port,
211
+ method: "POST",
212
+ headers,
213
+ path: resolvedPath,
214
+ body,
215
+ });
216
+ };
217
+ exports.serializeAws_restJson1UpdateSlackChannelConfigurationCommand = serializeAws_restJson1UpdateSlackChannelConfigurationCommand;
218
+ const deserializeAws_restJson1CreateSlackChannelConfigurationCommand = async (output, context) => {
219
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
220
+ return deserializeAws_restJson1CreateSlackChannelConfigurationCommandError(output, context);
221
+ }
222
+ const contents = map({
223
+ $metadata: deserializeMetadata(output),
224
+ });
225
+ await collectBody(output.body, context);
226
+ return contents;
227
+ };
228
+ exports.deserializeAws_restJson1CreateSlackChannelConfigurationCommand = deserializeAws_restJson1CreateSlackChannelConfigurationCommand;
229
+ const deserializeAws_restJson1CreateSlackChannelConfigurationCommandError = async (output, context) => {
230
+ const parsedOutput = {
231
+ ...output,
232
+ body: await parseBody(output.body, context),
233
+ };
234
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
235
+ switch (errorCode) {
236
+ case "AccessDeniedException":
237
+ case "com.amazonaws.supportapp#AccessDeniedException":
238
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
239
+ case "ConflictException":
240
+ case "com.amazonaws.supportapp#ConflictException":
241
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
242
+ case "InternalServerException":
243
+ case "com.amazonaws.supportapp#InternalServerException":
244
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
245
+ case "ServiceQuotaExceededException":
246
+ case "com.amazonaws.supportapp#ServiceQuotaExceededException":
247
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
248
+ case "ValidationException":
249
+ case "com.amazonaws.supportapp#ValidationException":
250
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
251
+ default:
252
+ const parsedBody = parsedOutput.body;
253
+ (0, smithy_client_1.throwDefaultError)({
254
+ output,
255
+ parsedBody,
256
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
257
+ errorCode,
258
+ });
259
+ }
260
+ };
261
+ const deserializeAws_restJson1DeleteAccountAliasCommand = async (output, context) => {
262
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
263
+ return deserializeAws_restJson1DeleteAccountAliasCommandError(output, context);
264
+ }
265
+ const contents = map({
266
+ $metadata: deserializeMetadata(output),
267
+ });
268
+ await collectBody(output.body, context);
269
+ return contents;
270
+ };
271
+ exports.deserializeAws_restJson1DeleteAccountAliasCommand = deserializeAws_restJson1DeleteAccountAliasCommand;
272
+ const deserializeAws_restJson1DeleteAccountAliasCommandError = async (output, context) => {
273
+ const parsedOutput = {
274
+ ...output,
275
+ body: await parseBody(output.body, context),
276
+ };
277
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
278
+ switch (errorCode) {
279
+ case "AccessDeniedException":
280
+ case "com.amazonaws.supportapp#AccessDeniedException":
281
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
282
+ case "InternalServerException":
283
+ case "com.amazonaws.supportapp#InternalServerException":
284
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
285
+ case "ResourceNotFoundException":
286
+ case "com.amazonaws.supportapp#ResourceNotFoundException":
287
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
288
+ default:
289
+ const parsedBody = parsedOutput.body;
290
+ (0, smithy_client_1.throwDefaultError)({
291
+ output,
292
+ parsedBody,
293
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
294
+ errorCode,
295
+ });
296
+ }
297
+ };
298
+ const deserializeAws_restJson1DeleteSlackChannelConfigurationCommand = async (output, context) => {
299
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
300
+ return deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError(output, context);
301
+ }
302
+ const contents = map({
303
+ $metadata: deserializeMetadata(output),
304
+ });
305
+ await collectBody(output.body, context);
306
+ return contents;
307
+ };
308
+ exports.deserializeAws_restJson1DeleteSlackChannelConfigurationCommand = deserializeAws_restJson1DeleteSlackChannelConfigurationCommand;
309
+ const deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError = async (output, context) => {
310
+ const parsedOutput = {
311
+ ...output,
312
+ body: await parseBody(output.body, context),
313
+ };
314
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
315
+ switch (errorCode) {
316
+ case "AccessDeniedException":
317
+ case "com.amazonaws.supportapp#AccessDeniedException":
318
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
319
+ case "ConflictException":
320
+ case "com.amazonaws.supportapp#ConflictException":
321
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
322
+ case "InternalServerException":
323
+ case "com.amazonaws.supportapp#InternalServerException":
324
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
325
+ case "ResourceNotFoundException":
326
+ case "com.amazonaws.supportapp#ResourceNotFoundException":
327
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
328
+ case "ValidationException":
329
+ case "com.amazonaws.supportapp#ValidationException":
330
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
331
+ default:
332
+ const parsedBody = parsedOutput.body;
333
+ (0, smithy_client_1.throwDefaultError)({
334
+ output,
335
+ parsedBody,
336
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
337
+ errorCode,
338
+ });
339
+ }
340
+ };
341
+ const deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = async (output, context) => {
342
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
343
+ return deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError(output, context);
344
+ }
345
+ const contents = map({
346
+ $metadata: deserializeMetadata(output),
347
+ });
348
+ await collectBody(output.body, context);
349
+ return contents;
350
+ };
351
+ exports.deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand = deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand;
352
+ const deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError = async (output, context) => {
353
+ const parsedOutput = {
354
+ ...output,
355
+ body: await parseBody(output.body, context),
356
+ };
357
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
358
+ switch (errorCode) {
359
+ case "AccessDeniedException":
360
+ case "com.amazonaws.supportapp#AccessDeniedException":
361
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
362
+ case "ConflictException":
363
+ case "com.amazonaws.supportapp#ConflictException":
364
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
365
+ case "InternalServerException":
366
+ case "com.amazonaws.supportapp#InternalServerException":
367
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
368
+ case "ResourceNotFoundException":
369
+ case "com.amazonaws.supportapp#ResourceNotFoundException":
370
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
371
+ case "ValidationException":
372
+ case "com.amazonaws.supportapp#ValidationException":
373
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
374
+ default:
375
+ const parsedBody = parsedOutput.body;
376
+ (0, smithy_client_1.throwDefaultError)({
377
+ output,
378
+ parsedBody,
379
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
380
+ errorCode,
381
+ });
382
+ }
383
+ };
384
+ const deserializeAws_restJson1GetAccountAliasCommand = async (output, context) => {
385
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
386
+ return deserializeAws_restJson1GetAccountAliasCommandError(output, context);
387
+ }
388
+ const contents = map({
389
+ $metadata: deserializeMetadata(output),
390
+ });
391
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
392
+ if (data.accountAlias != null) {
393
+ contents.accountAlias = (0, smithy_client_1.expectString)(data.accountAlias);
394
+ }
395
+ return contents;
396
+ };
397
+ exports.deserializeAws_restJson1GetAccountAliasCommand = deserializeAws_restJson1GetAccountAliasCommand;
398
+ const deserializeAws_restJson1GetAccountAliasCommandError = async (output, context) => {
399
+ const parsedOutput = {
400
+ ...output,
401
+ body: await parseBody(output.body, context),
402
+ };
403
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
404
+ switch (errorCode) {
405
+ case "InternalServerException":
406
+ case "com.amazonaws.supportapp#InternalServerException":
407
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
408
+ default:
409
+ const parsedBody = parsedOutput.body;
410
+ (0, smithy_client_1.throwDefaultError)({
411
+ output,
412
+ parsedBody,
413
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
414
+ errorCode,
415
+ });
416
+ }
417
+ };
418
+ const deserializeAws_restJson1ListSlackChannelConfigurationsCommand = async (output, context) => {
419
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
420
+ return deserializeAws_restJson1ListSlackChannelConfigurationsCommandError(output, context);
421
+ }
422
+ const contents = map({
423
+ $metadata: deserializeMetadata(output),
424
+ });
425
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
426
+ if (data.nextToken != null) {
427
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
428
+ }
429
+ if (data.slackChannelConfigurations != null) {
430
+ contents.slackChannelConfigurations = deserializeAws_restJson1slackChannelConfigurationList(data.slackChannelConfigurations, context);
431
+ }
432
+ return contents;
433
+ };
434
+ exports.deserializeAws_restJson1ListSlackChannelConfigurationsCommand = deserializeAws_restJson1ListSlackChannelConfigurationsCommand;
435
+ const deserializeAws_restJson1ListSlackChannelConfigurationsCommandError = async (output, context) => {
436
+ const parsedOutput = {
437
+ ...output,
438
+ body: await parseBody(output.body, context),
439
+ };
440
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
441
+ switch (errorCode) {
442
+ case "AccessDeniedException":
443
+ case "com.amazonaws.supportapp#AccessDeniedException":
444
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
445
+ case "InternalServerException":
446
+ case "com.amazonaws.supportapp#InternalServerException":
447
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
448
+ default:
449
+ const parsedBody = parsedOutput.body;
450
+ (0, smithy_client_1.throwDefaultError)({
451
+ output,
452
+ parsedBody,
453
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
454
+ errorCode,
455
+ });
456
+ }
457
+ };
458
+ const deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = async (output, context) => {
459
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
460
+ return deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError(output, context);
461
+ }
462
+ const contents = map({
463
+ $metadata: deserializeMetadata(output),
464
+ });
465
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
466
+ if (data.nextToken != null) {
467
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
468
+ }
469
+ if (data.slackWorkspaceConfigurations != null) {
470
+ contents.slackWorkspaceConfigurations = deserializeAws_restJson1SlackWorkspaceConfigurationList(data.slackWorkspaceConfigurations, context);
471
+ }
472
+ return contents;
473
+ };
474
+ exports.deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand = deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand;
475
+ const deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError = async (output, context) => {
476
+ const parsedOutput = {
477
+ ...output,
478
+ body: await parseBody(output.body, context),
479
+ };
480
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
481
+ switch (errorCode) {
482
+ case "AccessDeniedException":
483
+ case "com.amazonaws.supportapp#AccessDeniedException":
484
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
485
+ case "InternalServerException":
486
+ case "com.amazonaws.supportapp#InternalServerException":
487
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
488
+ default:
489
+ const parsedBody = parsedOutput.body;
490
+ (0, smithy_client_1.throwDefaultError)({
491
+ output,
492
+ parsedBody,
493
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
494
+ errorCode,
495
+ });
496
+ }
497
+ };
498
+ const deserializeAws_restJson1PutAccountAliasCommand = async (output, context) => {
499
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
500
+ return deserializeAws_restJson1PutAccountAliasCommandError(output, context);
501
+ }
502
+ const contents = map({
503
+ $metadata: deserializeMetadata(output),
504
+ });
505
+ await collectBody(output.body, context);
506
+ return contents;
507
+ };
508
+ exports.deserializeAws_restJson1PutAccountAliasCommand = deserializeAws_restJson1PutAccountAliasCommand;
509
+ const deserializeAws_restJson1PutAccountAliasCommandError = async (output, context) => {
510
+ const parsedOutput = {
511
+ ...output,
512
+ body: await parseBody(output.body, context),
513
+ };
514
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
515
+ switch (errorCode) {
516
+ case "AccessDeniedException":
517
+ case "com.amazonaws.supportapp#AccessDeniedException":
518
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
519
+ case "InternalServerException":
520
+ case "com.amazonaws.supportapp#InternalServerException":
521
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
522
+ case "ValidationException":
523
+ case "com.amazonaws.supportapp#ValidationException":
524
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
525
+ default:
526
+ const parsedBody = parsedOutput.body;
527
+ (0, smithy_client_1.throwDefaultError)({
528
+ output,
529
+ parsedBody,
530
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
531
+ errorCode,
532
+ });
533
+ }
534
+ };
535
+ const deserializeAws_restJson1UpdateSlackChannelConfigurationCommand = async (output, context) => {
536
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
537
+ return deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError(output, context);
538
+ }
539
+ const contents = map({
540
+ $metadata: deserializeMetadata(output),
541
+ });
542
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
543
+ if (data.channelId != null) {
544
+ contents.channelId = (0, smithy_client_1.expectString)(data.channelId);
545
+ }
546
+ if (data.channelName != null) {
547
+ contents.channelName = (0, smithy_client_1.expectString)(data.channelName);
548
+ }
549
+ if (data.channelRoleArn != null) {
550
+ contents.channelRoleArn = (0, smithy_client_1.expectString)(data.channelRoleArn);
551
+ }
552
+ if (data.notifyOnAddCorrespondenceToCase != null) {
553
+ contents.notifyOnAddCorrespondenceToCase = (0, smithy_client_1.expectBoolean)(data.notifyOnAddCorrespondenceToCase);
554
+ }
555
+ if (data.notifyOnCaseSeverity != null) {
556
+ contents.notifyOnCaseSeverity = (0, smithy_client_1.expectString)(data.notifyOnCaseSeverity);
557
+ }
558
+ if (data.notifyOnCreateOrReopenCase != null) {
559
+ contents.notifyOnCreateOrReopenCase = (0, smithy_client_1.expectBoolean)(data.notifyOnCreateOrReopenCase);
560
+ }
561
+ if (data.notifyOnResolveCase != null) {
562
+ contents.notifyOnResolveCase = (0, smithy_client_1.expectBoolean)(data.notifyOnResolveCase);
563
+ }
564
+ if (data.teamId != null) {
565
+ contents.teamId = (0, smithy_client_1.expectString)(data.teamId);
566
+ }
567
+ return contents;
568
+ };
569
+ exports.deserializeAws_restJson1UpdateSlackChannelConfigurationCommand = deserializeAws_restJson1UpdateSlackChannelConfigurationCommand;
570
+ const deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError = async (output, context) => {
571
+ const parsedOutput = {
572
+ ...output,
573
+ body: await parseBody(output.body, context),
574
+ };
575
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
576
+ switch (errorCode) {
577
+ case "AccessDeniedException":
578
+ case "com.amazonaws.supportapp#AccessDeniedException":
579
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
580
+ case "ConflictException":
581
+ case "com.amazonaws.supportapp#ConflictException":
582
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
583
+ case "InternalServerException":
584
+ case "com.amazonaws.supportapp#InternalServerException":
585
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
586
+ case "ResourceNotFoundException":
587
+ case "com.amazonaws.supportapp#ResourceNotFoundException":
588
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
589
+ case "ValidationException":
590
+ case "com.amazonaws.supportapp#ValidationException":
591
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
592
+ default:
593
+ const parsedBody = parsedOutput.body;
594
+ (0, smithy_client_1.throwDefaultError)({
595
+ output,
596
+ parsedBody,
597
+ exceptionCtor: SupportAppServiceException_1.SupportAppServiceException,
598
+ errorCode,
599
+ });
600
+ }
601
+ };
602
+ const map = smithy_client_1.map;
603
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
604
+ const contents = map({});
605
+ const data = parsedOutput.body;
606
+ if (data.message != null) {
607
+ contents.message = (0, smithy_client_1.expectString)(data.message);
608
+ }
609
+ const exception = new models_0_1.AccessDeniedException({
610
+ $metadata: deserializeMetadata(parsedOutput),
611
+ ...contents,
612
+ });
613
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
614
+ };
615
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
616
+ const contents = map({});
617
+ const data = parsedOutput.body;
618
+ if (data.message != null) {
619
+ contents.message = (0, smithy_client_1.expectString)(data.message);
620
+ }
621
+ const exception = new models_0_1.ConflictException({
622
+ $metadata: deserializeMetadata(parsedOutput),
623
+ ...contents,
624
+ });
625
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
626
+ };
627
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
628
+ const contents = map({});
629
+ const data = parsedOutput.body;
630
+ if (data.message != null) {
631
+ contents.message = (0, smithy_client_1.expectString)(data.message);
632
+ }
633
+ const exception = new models_0_1.InternalServerException({
634
+ $metadata: deserializeMetadata(parsedOutput),
635
+ ...contents,
636
+ });
637
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
638
+ };
639
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
640
+ const contents = map({});
641
+ const data = parsedOutput.body;
642
+ if (data.message != null) {
643
+ contents.message = (0, smithy_client_1.expectString)(data.message);
644
+ }
645
+ const exception = new models_0_1.ResourceNotFoundException({
646
+ $metadata: deserializeMetadata(parsedOutput),
647
+ ...contents,
648
+ });
649
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
650
+ };
651
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
652
+ const contents = map({});
653
+ const data = parsedOutput.body;
654
+ if (data.message != null) {
655
+ contents.message = (0, smithy_client_1.expectString)(data.message);
656
+ }
657
+ const exception = new models_0_1.ServiceQuotaExceededException({
658
+ $metadata: deserializeMetadata(parsedOutput),
659
+ ...contents,
660
+ });
661
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
662
+ };
663
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
664
+ const contents = map({});
665
+ const data = parsedOutput.body;
666
+ if (data.message != null) {
667
+ contents.message = (0, smithy_client_1.expectString)(data.message);
668
+ }
669
+ const exception = new models_0_1.ValidationException({
670
+ $metadata: deserializeMetadata(parsedOutput),
671
+ ...contents,
672
+ });
673
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
674
+ };
675
+ const deserializeAws_restJson1SlackChannelConfiguration = (output, context) => {
676
+ return {
677
+ channelId: (0, smithy_client_1.expectString)(output.channelId),
678
+ channelName: (0, smithy_client_1.expectString)(output.channelName),
679
+ channelRoleArn: (0, smithy_client_1.expectString)(output.channelRoleArn),
680
+ notifyOnAddCorrespondenceToCase: (0, smithy_client_1.expectBoolean)(output.notifyOnAddCorrespondenceToCase),
681
+ notifyOnCaseSeverity: (0, smithy_client_1.expectString)(output.notifyOnCaseSeverity),
682
+ notifyOnCreateOrReopenCase: (0, smithy_client_1.expectBoolean)(output.notifyOnCreateOrReopenCase),
683
+ notifyOnResolveCase: (0, smithy_client_1.expectBoolean)(output.notifyOnResolveCase),
684
+ teamId: (0, smithy_client_1.expectString)(output.teamId),
685
+ };
686
+ };
687
+ const deserializeAws_restJson1slackChannelConfigurationList = (output, context) => {
688
+ const retVal = (output || [])
689
+ .filter((e) => e != null)
690
+ .map((entry) => {
691
+ if (entry === null) {
692
+ return null;
693
+ }
694
+ return deserializeAws_restJson1SlackChannelConfiguration(entry, context);
695
+ });
696
+ return retVal;
697
+ };
698
+ const deserializeAws_restJson1SlackWorkspaceConfiguration = (output, context) => {
699
+ return {
700
+ teamId: (0, smithy_client_1.expectString)(output.teamId),
701
+ };
702
+ };
703
+ const deserializeAws_restJson1SlackWorkspaceConfigurationList = (output, context) => {
704
+ const retVal = (output || [])
705
+ .filter((e) => e != null)
706
+ .map((entry) => {
707
+ if (entry === null) {
708
+ return null;
709
+ }
710
+ return deserializeAws_restJson1SlackWorkspaceConfiguration(entry, context);
711
+ });
712
+ return retVal;
713
+ };
714
+ const deserializeMetadata = (output) => {
715
+ var _a;
716
+ return ({
717
+ httpStatusCode: output.statusCode,
718
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
719
+ extendedRequestId: output.headers["x-amz-id-2"],
720
+ cfId: output.headers["x-amz-cf-id"],
721
+ });
722
+ };
723
+ const collectBody = (streamBody = new Uint8Array(), context) => {
724
+ if (streamBody instanceof Uint8Array) {
725
+ return Promise.resolve(streamBody);
726
+ }
727
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
728
+ };
729
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
730
+ const isSerializableHeaderValue = (value) => value !== undefined &&
731
+ value !== null &&
732
+ value !== "" &&
733
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
734
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
735
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
736
+ if (encoded.length) {
737
+ return JSON.parse(encoded);
738
+ }
739
+ return {};
740
+ });
741
+ const loadRestJsonErrorCode = (output, data) => {
742
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
743
+ const sanitizeErrorCode = (rawValue) => {
744
+ let cleanValue = rawValue;
745
+ if (typeof cleanValue === "number") {
746
+ cleanValue = cleanValue.toString();
747
+ }
748
+ if (cleanValue.indexOf(":") >= 0) {
749
+ cleanValue = cleanValue.split(":")[0];
750
+ }
751
+ if (cleanValue.indexOf("#") >= 0) {
752
+ cleanValue = cleanValue.split("#")[1];
753
+ }
754
+ return cleanValue;
755
+ };
756
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
757
+ if (headerKey !== undefined) {
758
+ return sanitizeErrorCode(output.headers[headerKey]);
759
+ }
760
+ if (data.code !== undefined) {
761
+ return sanitizeErrorCode(data.code);
762
+ }
763
+ if (data["__type"] !== undefined) {
764
+ return sanitizeErrorCode(data["__type"]);
765
+ }
766
+ };