@aws-sdk/client-scheduler 3.208.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 (127) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +209 -0
  3. package/dist-cjs/Scheduler.js +187 -0
  4. package/dist-cjs/SchedulerClient.js +40 -0
  5. package/dist-cjs/commands/CreateScheduleCommand.js +46 -0
  6. package/dist-cjs/commands/CreateScheduleGroupCommand.js +46 -0
  7. package/dist-cjs/commands/DeleteScheduleCommand.js +46 -0
  8. package/dist-cjs/commands/DeleteScheduleGroupCommand.js +46 -0
  9. package/dist-cjs/commands/GetScheduleCommand.js +46 -0
  10. package/dist-cjs/commands/GetScheduleGroupCommand.js +46 -0
  11. package/dist-cjs/commands/ListScheduleGroupsCommand.js +46 -0
  12. package/dist-cjs/commands/ListSchedulesCommand.js +46 -0
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +46 -0
  14. package/dist-cjs/commands/TagResourceCommand.js +46 -0
  15. package/dist-cjs/commands/UntagResourceCommand.js +46 -0
  16. package/dist-cjs/commands/UpdateScheduleCommand.js +46 -0
  17. package/dist-cjs/commands/index.js +15 -0
  18. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  19. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  20. package/dist-cjs/endpoint/ruleset.js +312 -0
  21. package/dist-cjs/index.js +11 -0
  22. package/dist-cjs/models/SchedulerServiceException.js +11 -0
  23. package/dist-cjs/models/index.js +4 -0
  24. package/dist-cjs/models/models_0.js +302 -0
  25. package/dist-cjs/pagination/Interfaces.js +2 -0
  26. package/dist-cjs/pagination/ListScheduleGroupsPaginator.js +36 -0
  27. package/dist-cjs/pagination/ListSchedulesPaginator.js +36 -0
  28. package/dist-cjs/pagination/index.js +6 -0
  29. package/dist-cjs/protocols/Aws_restJson1.js +1494 -0
  30. package/dist-cjs/runtimeConfig.browser.js +42 -0
  31. package/dist-cjs/runtimeConfig.js +50 -0
  32. package/dist-cjs/runtimeConfig.native.js +15 -0
  33. package/dist-cjs/runtimeConfig.shared.js +17 -0
  34. package/dist-es/Scheduler.js +183 -0
  35. package/dist-es/SchedulerClient.js +36 -0
  36. package/dist-es/commands/CreateScheduleCommand.js +42 -0
  37. package/dist-es/commands/CreateScheduleGroupCommand.js +42 -0
  38. package/dist-es/commands/DeleteScheduleCommand.js +42 -0
  39. package/dist-es/commands/DeleteScheduleGroupCommand.js +42 -0
  40. package/dist-es/commands/GetScheduleCommand.js +42 -0
  41. package/dist-es/commands/GetScheduleGroupCommand.js +42 -0
  42. package/dist-es/commands/ListScheduleGroupsCommand.js +42 -0
  43. package/dist-es/commands/ListSchedulesCommand.js +42 -0
  44. package/dist-es/commands/ListTagsForResourceCommand.js +42 -0
  45. package/dist-es/commands/TagResourceCommand.js +42 -0
  46. package/dist-es/commands/UntagResourceCommand.js +42 -0
  47. package/dist-es/commands/UpdateScheduleCommand.js +42 -0
  48. package/dist-es/commands/index.js +12 -0
  49. package/dist-es/endpoint/EndpointParameters.js +8 -0
  50. package/dist-es/endpoint/endpointResolver.js +8 -0
  51. package/dist-es/endpoint/ruleset.js +309 -0
  52. package/dist-es/index.js +6 -0
  53. package/dist-es/models/SchedulerServiceException.js +7 -0
  54. package/dist-es/models/index.js +1 -0
  55. package/dist-es/models/models_0.js +249 -0
  56. package/dist-es/pagination/Interfaces.js +1 -0
  57. package/dist-es/pagination/ListScheduleGroupsPaginator.js +32 -0
  58. package/dist-es/pagination/ListSchedulesPaginator.js +32 -0
  59. package/dist-es/pagination/index.js +3 -0
  60. package/dist-es/protocols/Aws_restJson1.js +1467 -0
  61. package/dist-es/runtimeConfig.browser.js +37 -0
  62. package/dist-es/runtimeConfig.js +45 -0
  63. package/dist-es/runtimeConfig.native.js +11 -0
  64. package/dist-es/runtimeConfig.shared.js +13 -0
  65. package/dist-types/Scheduler.d.ts +111 -0
  66. package/dist-types/SchedulerClient.d.ts +157 -0
  67. package/dist-types/commands/CreateScheduleCommand.d.ts +37 -0
  68. package/dist-types/commands/CreateScheduleGroupCommand.d.ts +37 -0
  69. package/dist-types/commands/DeleteScheduleCommand.d.ts +37 -0
  70. package/dist-types/commands/DeleteScheduleGroupCommand.d.ts +45 -0
  71. package/dist-types/commands/GetScheduleCommand.d.ts +37 -0
  72. package/dist-types/commands/GetScheduleGroupCommand.d.ts +37 -0
  73. package/dist-types/commands/ListScheduleGroupsCommand.d.ts +37 -0
  74. package/dist-types/commands/ListSchedulesCommand.d.ts +37 -0
  75. package/dist-types/commands/ListTagsForResourceCommand.d.ts +37 -0
  76. package/dist-types/commands/TagResourceCommand.d.ts +37 -0
  77. package/dist-types/commands/UntagResourceCommand.d.ts +37 -0
  78. package/dist-types/commands/UpdateScheduleCommand.d.ts +45 -0
  79. package/dist-types/commands/index.d.ts +12 -0
  80. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  81. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  82. package/dist-types/endpoint/ruleset.d.ts +2 -0
  83. package/dist-types/index.d.ts +6 -0
  84. package/dist-types/models/SchedulerServiceException.d.ts +10 -0
  85. package/dist-types/models/index.d.ts +1 -0
  86. package/dist-types/models/models_0.d.ts +1148 -0
  87. package/dist-types/pagination/Interfaces.d.ts +6 -0
  88. package/dist-types/pagination/ListScheduleGroupsPaginator.d.ts +4 -0
  89. package/dist-types/pagination/ListSchedulesPaginator.d.ts +4 -0
  90. package/dist-types/pagination/index.d.ts +3 -0
  91. package/dist-types/protocols/Aws_restJson1.d.ts +38 -0
  92. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  93. package/dist-types/runtimeConfig.d.ts +42 -0
  94. package/dist-types/runtimeConfig.native.d.ts +41 -0
  95. package/dist-types/runtimeConfig.shared.d.ts +17 -0
  96. package/dist-types/ts3.4/Scheduler.d.ts +208 -0
  97. package/dist-types/ts3.4/SchedulerClient.d.ts +183 -0
  98. package/dist-types/ts3.4/commands/CreateScheduleCommand.d.ts +34 -0
  99. package/dist-types/ts3.4/commands/CreateScheduleGroupCommand.d.ts +38 -0
  100. package/dist-types/ts3.4/commands/DeleteScheduleCommand.d.ts +34 -0
  101. package/dist-types/ts3.4/commands/DeleteScheduleGroupCommand.d.ts +38 -0
  102. package/dist-types/ts3.4/commands/GetScheduleCommand.d.ts +34 -0
  103. package/dist-types/ts3.4/commands/GetScheduleGroupCommand.d.ts +37 -0
  104. package/dist-types/ts3.4/commands/ListScheduleGroupsCommand.d.ts +38 -0
  105. package/dist-types/ts3.4/commands/ListSchedulesCommand.d.ts +34 -0
  106. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  107. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  108. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +34 -0
  109. package/dist-types/ts3.4/commands/UpdateScheduleCommand.d.ts +34 -0
  110. package/dist-types/ts3.4/commands/index.d.ts +12 -0
  111. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +34 -0
  112. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  113. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  114. package/dist-types/ts3.4/index.d.ts +6 -0
  115. package/dist-types/ts3.4/models/SchedulerServiceException.d.ts +7 -0
  116. package/dist-types/ts3.4/models/index.d.ts +1 -0
  117. package/dist-types/ts3.4/models/models_0.d.ts +423 -0
  118. package/dist-types/ts3.4/pagination/Interfaces.d.ts +7 -0
  119. package/dist-types/ts3.4/pagination/ListScheduleGroupsPaginator.d.ts +11 -0
  120. package/dist-types/ts3.4/pagination/ListSchedulesPaginator.d.ts +11 -0
  121. package/dist-types/ts3.4/pagination/index.d.ts +3 -0
  122. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +149 -0
  123. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +86 -0
  124. package/dist-types/ts3.4/runtimeConfig.d.ts +86 -0
  125. package/dist-types/ts3.4/runtimeConfig.native.d.ts +75 -0
  126. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +17 -0
  127. package/package.json +105 -0
@@ -0,0 +1,1467 @@
1
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
3
+ import { v4 as generateIdempotencyToken } from "uuid";
4
+ import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ import { SchedulerServiceException as __BaseException } from "../models/SchedulerServiceException";
6
+ export const serializeAws_restJson1CreateScheduleCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
12
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
13
+ let body;
14
+ body = JSON.stringify({
15
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
16
+ ...(input.Description != null && { Description: input.Description }),
17
+ ...(input.EndDate != null && { EndDate: Math.round(input.EndDate.getTime() / 1000) }),
18
+ ...(input.FlexibleTimeWindow != null && {
19
+ FlexibleTimeWindow: serializeAws_restJson1FlexibleTimeWindow(input.FlexibleTimeWindow, context),
20
+ }),
21
+ ...(input.GroupName != null && { GroupName: input.GroupName }),
22
+ ...(input.KmsKeyArn != null && { KmsKeyArn: input.KmsKeyArn }),
23
+ ...(input.ScheduleExpression != null && { ScheduleExpression: input.ScheduleExpression }),
24
+ ...(input.ScheduleExpressionTimezone != null && { ScheduleExpressionTimezone: input.ScheduleExpressionTimezone }),
25
+ ...(input.StartDate != null && { StartDate: Math.round(input.StartDate.getTime() / 1000) }),
26
+ ...(input.State != null && { State: input.State }),
27
+ ...(input.Target != null && { Target: serializeAws_restJson1Target(input.Target, context) }),
28
+ });
29
+ return new __HttpRequest({
30
+ protocol,
31
+ hostname,
32
+ port,
33
+ method: "POST",
34
+ headers,
35
+ path: resolvedPath,
36
+ body,
37
+ });
38
+ };
39
+ export const serializeAws_restJson1CreateScheduleGroupCommand = async (input, context) => {
40
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const headers = {
42
+ "content-type": "application/json",
43
+ };
44
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedule-groups/{Name}";
45
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
46
+ let body;
47
+ body = JSON.stringify({
48
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
49
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
50
+ });
51
+ return new __HttpRequest({
52
+ protocol,
53
+ hostname,
54
+ port,
55
+ method: "POST",
56
+ headers,
57
+ path: resolvedPath,
58
+ body,
59
+ });
60
+ };
61
+ export const serializeAws_restJson1DeleteScheduleCommand = async (input, context) => {
62
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
+ const headers = {};
64
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
65
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
66
+ const query = map({
67
+ groupName: [, input.GroupName],
68
+ clientToken: [, input.ClientToken],
69
+ });
70
+ let body;
71
+ return new __HttpRequest({
72
+ protocol,
73
+ hostname,
74
+ port,
75
+ method: "DELETE",
76
+ headers,
77
+ path: resolvedPath,
78
+ query,
79
+ body,
80
+ });
81
+ };
82
+ export const serializeAws_restJson1DeleteScheduleGroupCommand = async (input, context) => {
83
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
+ const headers = {};
85
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedule-groups/{Name}";
86
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
87
+ const query = map({
88
+ clientToken: [, input.ClientToken],
89
+ });
90
+ let body;
91
+ return new __HttpRequest({
92
+ protocol,
93
+ hostname,
94
+ port,
95
+ method: "DELETE",
96
+ headers,
97
+ path: resolvedPath,
98
+ query,
99
+ body,
100
+ });
101
+ };
102
+ export const serializeAws_restJson1GetScheduleCommand = async (input, context) => {
103
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
104
+ const headers = {};
105
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
106
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
107
+ const query = map({
108
+ groupName: [, input.GroupName],
109
+ });
110
+ let body;
111
+ return new __HttpRequest({
112
+ protocol,
113
+ hostname,
114
+ port,
115
+ method: "GET",
116
+ headers,
117
+ path: resolvedPath,
118
+ query,
119
+ body,
120
+ });
121
+ };
122
+ export const serializeAws_restJson1GetScheduleGroupCommand = async (input, context) => {
123
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
+ const headers = {};
125
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedule-groups/{Name}";
126
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
127
+ let body;
128
+ return new __HttpRequest({
129
+ protocol,
130
+ hostname,
131
+ port,
132
+ method: "GET",
133
+ headers,
134
+ path: resolvedPath,
135
+ body,
136
+ });
137
+ };
138
+ export const serializeAws_restJson1ListScheduleGroupsCommand = async (input, context) => {
139
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
140
+ const headers = {};
141
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedule-groups";
142
+ const query = map({
143
+ NamePrefix: [, input.NamePrefix],
144
+ NextToken: [, input.NextToken],
145
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
146
+ });
147
+ let body;
148
+ return new __HttpRequest({
149
+ protocol,
150
+ hostname,
151
+ port,
152
+ method: "GET",
153
+ headers,
154
+ path: resolvedPath,
155
+ query,
156
+ body,
157
+ });
158
+ };
159
+ export const serializeAws_restJson1ListSchedulesCommand = async (input, context) => {
160
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
161
+ const headers = {};
162
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedules";
163
+ const query = map({
164
+ ScheduleGroup: [, input.GroupName],
165
+ NamePrefix: [, input.NamePrefix],
166
+ State: [, input.State],
167
+ NextToken: [, input.NextToken],
168
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
169
+ });
170
+ let body;
171
+ return new __HttpRequest({
172
+ protocol,
173
+ hostname,
174
+ port,
175
+ method: "GET",
176
+ headers,
177
+ path: resolvedPath,
178
+ query,
179
+ body,
180
+ });
181
+ };
182
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
183
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
184
+ const headers = {};
185
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
186
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
187
+ let body;
188
+ return new __HttpRequest({
189
+ protocol,
190
+ hostname,
191
+ port,
192
+ method: "GET",
193
+ headers,
194
+ path: resolvedPath,
195
+ body,
196
+ });
197
+ };
198
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
199
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
200
+ const headers = {
201
+ "content-type": "application/json",
202
+ };
203
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
204
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
205
+ let body;
206
+ body = JSON.stringify({
207
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagList(input.Tags, context) }),
208
+ });
209
+ return new __HttpRequest({
210
+ protocol,
211
+ hostname,
212
+ port,
213
+ method: "POST",
214
+ headers,
215
+ path: resolvedPath,
216
+ body,
217
+ });
218
+ };
219
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
220
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
221
+ const headers = {};
222
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
223
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
224
+ const query = map({
225
+ TagKeys: [() => input.TagKeys !== void 0, () => (input.TagKeys || []).map((_entry) => _entry)],
226
+ });
227
+ let body;
228
+ return new __HttpRequest({
229
+ protocol,
230
+ hostname,
231
+ port,
232
+ method: "DELETE",
233
+ headers,
234
+ path: resolvedPath,
235
+ query,
236
+ body,
237
+ });
238
+ };
239
+ export const serializeAws_restJson1UpdateScheduleCommand = async (input, context) => {
240
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
241
+ const headers = {
242
+ "content-type": "application/json",
243
+ };
244
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedules/{Name}";
245
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
246
+ let body;
247
+ body = JSON.stringify({
248
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
249
+ ...(input.Description != null && { Description: input.Description }),
250
+ ...(input.EndDate != null && { EndDate: Math.round(input.EndDate.getTime() / 1000) }),
251
+ ...(input.FlexibleTimeWindow != null && {
252
+ FlexibleTimeWindow: serializeAws_restJson1FlexibleTimeWindow(input.FlexibleTimeWindow, context),
253
+ }),
254
+ ...(input.GroupName != null && { GroupName: input.GroupName }),
255
+ ...(input.KmsKeyArn != null && { KmsKeyArn: input.KmsKeyArn }),
256
+ ...(input.ScheduleExpression != null && { ScheduleExpression: input.ScheduleExpression }),
257
+ ...(input.ScheduleExpressionTimezone != null && { ScheduleExpressionTimezone: input.ScheduleExpressionTimezone }),
258
+ ...(input.StartDate != null && { StartDate: Math.round(input.StartDate.getTime() / 1000) }),
259
+ ...(input.State != null && { State: input.State }),
260
+ ...(input.Target != null && { Target: serializeAws_restJson1Target(input.Target, context) }),
261
+ });
262
+ return new __HttpRequest({
263
+ protocol,
264
+ hostname,
265
+ port,
266
+ method: "PUT",
267
+ headers,
268
+ path: resolvedPath,
269
+ body,
270
+ });
271
+ };
272
+ export const deserializeAws_restJson1CreateScheduleCommand = async (output, context) => {
273
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
274
+ return deserializeAws_restJson1CreateScheduleCommandError(output, context);
275
+ }
276
+ const contents = map({
277
+ $metadata: deserializeMetadata(output),
278
+ });
279
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
280
+ if (data.ScheduleArn != null) {
281
+ contents.ScheduleArn = __expectString(data.ScheduleArn);
282
+ }
283
+ return contents;
284
+ };
285
+ const deserializeAws_restJson1CreateScheduleCommandError = async (output, context) => {
286
+ const parsedOutput = {
287
+ ...output,
288
+ body: await parseErrorBody(output.body, context),
289
+ };
290
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
291
+ switch (errorCode) {
292
+ case "ConflictException":
293
+ case "com.amazonaws.scheduler#ConflictException":
294
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
295
+ case "InternalServerException":
296
+ case "com.amazonaws.scheduler#InternalServerException":
297
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
298
+ case "ResourceNotFoundException":
299
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
300
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
301
+ case "ServiceQuotaExceededException":
302
+ case "com.amazonaws.scheduler#ServiceQuotaExceededException":
303
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
304
+ case "ThrottlingException":
305
+ case "com.amazonaws.scheduler#ThrottlingException":
306
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
307
+ case "ValidationException":
308
+ case "com.amazonaws.scheduler#ValidationException":
309
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
310
+ default:
311
+ const parsedBody = parsedOutput.body;
312
+ throwDefaultError({
313
+ output,
314
+ parsedBody,
315
+ exceptionCtor: __BaseException,
316
+ errorCode,
317
+ });
318
+ }
319
+ };
320
+ export const deserializeAws_restJson1CreateScheduleGroupCommand = async (output, context) => {
321
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
322
+ return deserializeAws_restJson1CreateScheduleGroupCommandError(output, context);
323
+ }
324
+ const contents = map({
325
+ $metadata: deserializeMetadata(output),
326
+ });
327
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
328
+ if (data.ScheduleGroupArn != null) {
329
+ contents.ScheduleGroupArn = __expectString(data.ScheduleGroupArn);
330
+ }
331
+ return contents;
332
+ };
333
+ const deserializeAws_restJson1CreateScheduleGroupCommandError = async (output, context) => {
334
+ const parsedOutput = {
335
+ ...output,
336
+ body: await parseErrorBody(output.body, context),
337
+ };
338
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
339
+ switch (errorCode) {
340
+ case "ConflictException":
341
+ case "com.amazonaws.scheduler#ConflictException":
342
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
343
+ case "InternalServerException":
344
+ case "com.amazonaws.scheduler#InternalServerException":
345
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
346
+ case "ServiceQuotaExceededException":
347
+ case "com.amazonaws.scheduler#ServiceQuotaExceededException":
348
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
349
+ case "ThrottlingException":
350
+ case "com.amazonaws.scheduler#ThrottlingException":
351
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
352
+ case "ValidationException":
353
+ case "com.amazonaws.scheduler#ValidationException":
354
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
355
+ default:
356
+ const parsedBody = parsedOutput.body;
357
+ throwDefaultError({
358
+ output,
359
+ parsedBody,
360
+ exceptionCtor: __BaseException,
361
+ errorCode,
362
+ });
363
+ }
364
+ };
365
+ export const deserializeAws_restJson1DeleteScheduleCommand = async (output, context) => {
366
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
367
+ return deserializeAws_restJson1DeleteScheduleCommandError(output, context);
368
+ }
369
+ const contents = map({
370
+ $metadata: deserializeMetadata(output),
371
+ });
372
+ await collectBody(output.body, context);
373
+ return contents;
374
+ };
375
+ const deserializeAws_restJson1DeleteScheduleCommandError = async (output, context) => {
376
+ const parsedOutput = {
377
+ ...output,
378
+ body: await parseErrorBody(output.body, context),
379
+ };
380
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
381
+ switch (errorCode) {
382
+ case "ConflictException":
383
+ case "com.amazonaws.scheduler#ConflictException":
384
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
385
+ case "InternalServerException":
386
+ case "com.amazonaws.scheduler#InternalServerException":
387
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
388
+ case "ResourceNotFoundException":
389
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
390
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
391
+ case "ThrottlingException":
392
+ case "com.amazonaws.scheduler#ThrottlingException":
393
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
394
+ case "ValidationException":
395
+ case "com.amazonaws.scheduler#ValidationException":
396
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
397
+ default:
398
+ const parsedBody = parsedOutput.body;
399
+ throwDefaultError({
400
+ output,
401
+ parsedBody,
402
+ exceptionCtor: __BaseException,
403
+ errorCode,
404
+ });
405
+ }
406
+ };
407
+ export const deserializeAws_restJson1DeleteScheduleGroupCommand = async (output, context) => {
408
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
409
+ return deserializeAws_restJson1DeleteScheduleGroupCommandError(output, context);
410
+ }
411
+ const contents = map({
412
+ $metadata: deserializeMetadata(output),
413
+ });
414
+ await collectBody(output.body, context);
415
+ return contents;
416
+ };
417
+ const deserializeAws_restJson1DeleteScheduleGroupCommandError = async (output, context) => {
418
+ const parsedOutput = {
419
+ ...output,
420
+ body: await parseErrorBody(output.body, context),
421
+ };
422
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
423
+ switch (errorCode) {
424
+ case "ConflictException":
425
+ case "com.amazonaws.scheduler#ConflictException":
426
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
427
+ case "InternalServerException":
428
+ case "com.amazonaws.scheduler#InternalServerException":
429
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
430
+ case "ResourceNotFoundException":
431
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
432
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
433
+ case "ThrottlingException":
434
+ case "com.amazonaws.scheduler#ThrottlingException":
435
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
436
+ case "ValidationException":
437
+ case "com.amazonaws.scheduler#ValidationException":
438
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
439
+ default:
440
+ const parsedBody = parsedOutput.body;
441
+ throwDefaultError({
442
+ output,
443
+ parsedBody,
444
+ exceptionCtor: __BaseException,
445
+ errorCode,
446
+ });
447
+ }
448
+ };
449
+ export const deserializeAws_restJson1GetScheduleCommand = async (output, context) => {
450
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
451
+ return deserializeAws_restJson1GetScheduleCommandError(output, context);
452
+ }
453
+ const contents = map({
454
+ $metadata: deserializeMetadata(output),
455
+ });
456
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
457
+ if (data.Arn != null) {
458
+ contents.Arn = __expectString(data.Arn);
459
+ }
460
+ if (data.CreationDate != null) {
461
+ contents.CreationDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationDate)));
462
+ }
463
+ if (data.Description != null) {
464
+ contents.Description = __expectString(data.Description);
465
+ }
466
+ if (data.EndDate != null) {
467
+ contents.EndDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.EndDate)));
468
+ }
469
+ if (data.FlexibleTimeWindow != null) {
470
+ contents.FlexibleTimeWindow = deserializeAws_restJson1FlexibleTimeWindow(data.FlexibleTimeWindow, context);
471
+ }
472
+ if (data.GroupName != null) {
473
+ contents.GroupName = __expectString(data.GroupName);
474
+ }
475
+ if (data.KmsKeyArn != null) {
476
+ contents.KmsKeyArn = __expectString(data.KmsKeyArn);
477
+ }
478
+ if (data.LastModificationDate != null) {
479
+ contents.LastModificationDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModificationDate)));
480
+ }
481
+ if (data.Name != null) {
482
+ contents.Name = __expectString(data.Name);
483
+ }
484
+ if (data.ScheduleExpression != null) {
485
+ contents.ScheduleExpression = __expectString(data.ScheduleExpression);
486
+ }
487
+ if (data.ScheduleExpressionTimezone != null) {
488
+ contents.ScheduleExpressionTimezone = __expectString(data.ScheduleExpressionTimezone);
489
+ }
490
+ if (data.StartDate != null) {
491
+ contents.StartDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.StartDate)));
492
+ }
493
+ if (data.State != null) {
494
+ contents.State = __expectString(data.State);
495
+ }
496
+ if (data.Target != null) {
497
+ contents.Target = deserializeAws_restJson1Target(data.Target, context);
498
+ }
499
+ return contents;
500
+ };
501
+ const deserializeAws_restJson1GetScheduleCommandError = async (output, context) => {
502
+ const parsedOutput = {
503
+ ...output,
504
+ body: await parseErrorBody(output.body, context),
505
+ };
506
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
507
+ switch (errorCode) {
508
+ case "InternalServerException":
509
+ case "com.amazonaws.scheduler#InternalServerException":
510
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
511
+ case "ResourceNotFoundException":
512
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
513
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
514
+ case "ThrottlingException":
515
+ case "com.amazonaws.scheduler#ThrottlingException":
516
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
517
+ case "ValidationException":
518
+ case "com.amazonaws.scheduler#ValidationException":
519
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
520
+ default:
521
+ const parsedBody = parsedOutput.body;
522
+ throwDefaultError({
523
+ output,
524
+ parsedBody,
525
+ exceptionCtor: __BaseException,
526
+ errorCode,
527
+ });
528
+ }
529
+ };
530
+ export const deserializeAws_restJson1GetScheduleGroupCommand = async (output, context) => {
531
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
532
+ return deserializeAws_restJson1GetScheduleGroupCommandError(output, context);
533
+ }
534
+ const contents = map({
535
+ $metadata: deserializeMetadata(output),
536
+ });
537
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
538
+ if (data.Arn != null) {
539
+ contents.Arn = __expectString(data.Arn);
540
+ }
541
+ if (data.CreationDate != null) {
542
+ contents.CreationDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationDate)));
543
+ }
544
+ if (data.LastModificationDate != null) {
545
+ contents.LastModificationDate = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LastModificationDate)));
546
+ }
547
+ if (data.Name != null) {
548
+ contents.Name = __expectString(data.Name);
549
+ }
550
+ if (data.State != null) {
551
+ contents.State = __expectString(data.State);
552
+ }
553
+ return contents;
554
+ };
555
+ const deserializeAws_restJson1GetScheduleGroupCommandError = async (output, context) => {
556
+ const parsedOutput = {
557
+ ...output,
558
+ body: await parseErrorBody(output.body, context),
559
+ };
560
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
561
+ switch (errorCode) {
562
+ case "InternalServerException":
563
+ case "com.amazonaws.scheduler#InternalServerException":
564
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
565
+ case "ResourceNotFoundException":
566
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
567
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
568
+ case "ThrottlingException":
569
+ case "com.amazonaws.scheduler#ThrottlingException":
570
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
571
+ case "ValidationException":
572
+ case "com.amazonaws.scheduler#ValidationException":
573
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
574
+ default:
575
+ const parsedBody = parsedOutput.body;
576
+ throwDefaultError({
577
+ output,
578
+ parsedBody,
579
+ exceptionCtor: __BaseException,
580
+ errorCode,
581
+ });
582
+ }
583
+ };
584
+ export const deserializeAws_restJson1ListScheduleGroupsCommand = async (output, context) => {
585
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
586
+ return deserializeAws_restJson1ListScheduleGroupsCommandError(output, context);
587
+ }
588
+ const contents = map({
589
+ $metadata: deserializeMetadata(output),
590
+ });
591
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
592
+ if (data.NextToken != null) {
593
+ contents.NextToken = __expectString(data.NextToken);
594
+ }
595
+ if (data.ScheduleGroups != null) {
596
+ contents.ScheduleGroups = deserializeAws_restJson1ScheduleGroupList(data.ScheduleGroups, context);
597
+ }
598
+ return contents;
599
+ };
600
+ const deserializeAws_restJson1ListScheduleGroupsCommandError = async (output, context) => {
601
+ const parsedOutput = {
602
+ ...output,
603
+ body: await parseErrorBody(output.body, context),
604
+ };
605
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
+ switch (errorCode) {
607
+ case "InternalServerException":
608
+ case "com.amazonaws.scheduler#InternalServerException":
609
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
610
+ case "ThrottlingException":
611
+ case "com.amazonaws.scheduler#ThrottlingException":
612
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
613
+ case "ValidationException":
614
+ case "com.amazonaws.scheduler#ValidationException":
615
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
616
+ default:
617
+ const parsedBody = parsedOutput.body;
618
+ throwDefaultError({
619
+ output,
620
+ parsedBody,
621
+ exceptionCtor: __BaseException,
622
+ errorCode,
623
+ });
624
+ }
625
+ };
626
+ export const deserializeAws_restJson1ListSchedulesCommand = async (output, context) => {
627
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
628
+ return deserializeAws_restJson1ListSchedulesCommandError(output, context);
629
+ }
630
+ const contents = map({
631
+ $metadata: deserializeMetadata(output),
632
+ });
633
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
634
+ if (data.NextToken != null) {
635
+ contents.NextToken = __expectString(data.NextToken);
636
+ }
637
+ if (data.Schedules != null) {
638
+ contents.Schedules = deserializeAws_restJson1ScheduleList(data.Schedules, context);
639
+ }
640
+ return contents;
641
+ };
642
+ const deserializeAws_restJson1ListSchedulesCommandError = async (output, context) => {
643
+ const parsedOutput = {
644
+ ...output,
645
+ body: await parseErrorBody(output.body, context),
646
+ };
647
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
648
+ switch (errorCode) {
649
+ case "InternalServerException":
650
+ case "com.amazonaws.scheduler#InternalServerException":
651
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
652
+ case "ResourceNotFoundException":
653
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
654
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
655
+ case "ThrottlingException":
656
+ case "com.amazonaws.scheduler#ThrottlingException":
657
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
658
+ case "ValidationException":
659
+ case "com.amazonaws.scheduler#ValidationException":
660
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
661
+ default:
662
+ const parsedBody = parsedOutput.body;
663
+ throwDefaultError({
664
+ output,
665
+ parsedBody,
666
+ exceptionCtor: __BaseException,
667
+ errorCode,
668
+ });
669
+ }
670
+ };
671
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
672
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
673
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
674
+ }
675
+ const contents = map({
676
+ $metadata: deserializeMetadata(output),
677
+ });
678
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
679
+ if (data.Tags != null) {
680
+ contents.Tags = deserializeAws_restJson1TagList(data.Tags, context);
681
+ }
682
+ return contents;
683
+ };
684
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
685
+ const parsedOutput = {
686
+ ...output,
687
+ body: await parseErrorBody(output.body, context),
688
+ };
689
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
+ switch (errorCode) {
691
+ case "InternalServerException":
692
+ case "com.amazonaws.scheduler#InternalServerException":
693
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
694
+ case "ResourceNotFoundException":
695
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
696
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
697
+ case "ThrottlingException":
698
+ case "com.amazonaws.scheduler#ThrottlingException":
699
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
700
+ case "ValidationException":
701
+ case "com.amazonaws.scheduler#ValidationException":
702
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
703
+ default:
704
+ const parsedBody = parsedOutput.body;
705
+ throwDefaultError({
706
+ output,
707
+ parsedBody,
708
+ exceptionCtor: __BaseException,
709
+ errorCode,
710
+ });
711
+ }
712
+ };
713
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
714
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
715
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
716
+ }
717
+ const contents = map({
718
+ $metadata: deserializeMetadata(output),
719
+ });
720
+ await collectBody(output.body, context);
721
+ return contents;
722
+ };
723
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
724
+ const parsedOutput = {
725
+ ...output,
726
+ body: await parseErrorBody(output.body, context),
727
+ };
728
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
+ switch (errorCode) {
730
+ case "ConflictException":
731
+ case "com.amazonaws.scheduler#ConflictException":
732
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
733
+ case "InternalServerException":
734
+ case "com.amazonaws.scheduler#InternalServerException":
735
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
736
+ case "ResourceNotFoundException":
737
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
738
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
739
+ case "ThrottlingException":
740
+ case "com.amazonaws.scheduler#ThrottlingException":
741
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
742
+ case "ValidationException":
743
+ case "com.amazonaws.scheduler#ValidationException":
744
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
745
+ default:
746
+ const parsedBody = parsedOutput.body;
747
+ throwDefaultError({
748
+ output,
749
+ parsedBody,
750
+ exceptionCtor: __BaseException,
751
+ errorCode,
752
+ });
753
+ }
754
+ };
755
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
756
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
757
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
758
+ }
759
+ const contents = map({
760
+ $metadata: deserializeMetadata(output),
761
+ });
762
+ await collectBody(output.body, context);
763
+ return contents;
764
+ };
765
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
766
+ const parsedOutput = {
767
+ ...output,
768
+ body: await parseErrorBody(output.body, context),
769
+ };
770
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
771
+ switch (errorCode) {
772
+ case "ConflictException":
773
+ case "com.amazonaws.scheduler#ConflictException":
774
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
775
+ case "InternalServerException":
776
+ case "com.amazonaws.scheduler#InternalServerException":
777
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
778
+ case "ResourceNotFoundException":
779
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
780
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
781
+ case "ThrottlingException":
782
+ case "com.amazonaws.scheduler#ThrottlingException":
783
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
784
+ case "ValidationException":
785
+ case "com.amazonaws.scheduler#ValidationException":
786
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
787
+ default:
788
+ const parsedBody = parsedOutput.body;
789
+ throwDefaultError({
790
+ output,
791
+ parsedBody,
792
+ exceptionCtor: __BaseException,
793
+ errorCode,
794
+ });
795
+ }
796
+ };
797
+ export const deserializeAws_restJson1UpdateScheduleCommand = async (output, context) => {
798
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
799
+ return deserializeAws_restJson1UpdateScheduleCommandError(output, context);
800
+ }
801
+ const contents = map({
802
+ $metadata: deserializeMetadata(output),
803
+ });
804
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
805
+ if (data.ScheduleArn != null) {
806
+ contents.ScheduleArn = __expectString(data.ScheduleArn);
807
+ }
808
+ return contents;
809
+ };
810
+ const deserializeAws_restJson1UpdateScheduleCommandError = async (output, context) => {
811
+ const parsedOutput = {
812
+ ...output,
813
+ body: await parseErrorBody(output.body, context),
814
+ };
815
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
816
+ switch (errorCode) {
817
+ case "ConflictException":
818
+ case "com.amazonaws.scheduler#ConflictException":
819
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
820
+ case "InternalServerException":
821
+ case "com.amazonaws.scheduler#InternalServerException":
822
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
823
+ case "ResourceNotFoundException":
824
+ case "com.amazonaws.scheduler#ResourceNotFoundException":
825
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
826
+ case "ThrottlingException":
827
+ case "com.amazonaws.scheduler#ThrottlingException":
828
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
829
+ case "ValidationException":
830
+ case "com.amazonaws.scheduler#ValidationException":
831
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
832
+ default:
833
+ const parsedBody = parsedOutput.body;
834
+ throwDefaultError({
835
+ output,
836
+ parsedBody,
837
+ exceptionCtor: __BaseException,
838
+ errorCode,
839
+ });
840
+ }
841
+ };
842
+ const map = __map;
843
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
844
+ const contents = map({});
845
+ const data = parsedOutput.body;
846
+ if (data.Message != null) {
847
+ contents.Message = __expectString(data.Message);
848
+ }
849
+ const exception = new ConflictException({
850
+ $metadata: deserializeMetadata(parsedOutput),
851
+ ...contents,
852
+ });
853
+ return __decorateServiceException(exception, parsedOutput.body);
854
+ };
855
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
856
+ const contents = map({});
857
+ const data = parsedOutput.body;
858
+ if (data.Message != null) {
859
+ contents.Message = __expectString(data.Message);
860
+ }
861
+ const exception = new InternalServerException({
862
+ $metadata: deserializeMetadata(parsedOutput),
863
+ ...contents,
864
+ });
865
+ return __decorateServiceException(exception, parsedOutput.body);
866
+ };
867
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
868
+ const contents = map({});
869
+ const data = parsedOutput.body;
870
+ if (data.Message != null) {
871
+ contents.Message = __expectString(data.Message);
872
+ }
873
+ const exception = new ResourceNotFoundException({
874
+ $metadata: deserializeMetadata(parsedOutput),
875
+ ...contents,
876
+ });
877
+ return __decorateServiceException(exception, parsedOutput.body);
878
+ };
879
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
880
+ const contents = map({});
881
+ const data = parsedOutput.body;
882
+ if (data.Message != null) {
883
+ contents.Message = __expectString(data.Message);
884
+ }
885
+ const exception = new ServiceQuotaExceededException({
886
+ $metadata: deserializeMetadata(parsedOutput),
887
+ ...contents,
888
+ });
889
+ return __decorateServiceException(exception, parsedOutput.body);
890
+ };
891
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
892
+ const contents = map({});
893
+ const data = parsedOutput.body;
894
+ if (data.Message != null) {
895
+ contents.Message = __expectString(data.Message);
896
+ }
897
+ const exception = new ThrottlingException({
898
+ $metadata: deserializeMetadata(parsedOutput),
899
+ ...contents,
900
+ });
901
+ return __decorateServiceException(exception, parsedOutput.body);
902
+ };
903
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
904
+ const contents = map({});
905
+ const data = parsedOutput.body;
906
+ if (data.Message != null) {
907
+ contents.Message = __expectString(data.Message);
908
+ }
909
+ const exception = new ValidationException({
910
+ $metadata: deserializeMetadata(parsedOutput),
911
+ ...contents,
912
+ });
913
+ return __decorateServiceException(exception, parsedOutput.body);
914
+ };
915
+ const serializeAws_restJson1AwsVpcConfiguration = (input, context) => {
916
+ return {
917
+ ...(input.AssignPublicIp != null && { AssignPublicIp: input.AssignPublicIp }),
918
+ ...(input.SecurityGroups != null && {
919
+ SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context),
920
+ }),
921
+ ...(input.Subnets != null && { Subnets: serializeAws_restJson1Subnets(input.Subnets, context) }),
922
+ };
923
+ };
924
+ const serializeAws_restJson1CapacityProviderStrategy = (input, context) => {
925
+ return input
926
+ .filter((e) => e != null)
927
+ .map((entry) => {
928
+ return serializeAws_restJson1CapacityProviderStrategyItem(entry, context);
929
+ });
930
+ };
931
+ const serializeAws_restJson1CapacityProviderStrategyItem = (input, context) => {
932
+ return {
933
+ ...(input.base != null && { base: input.base }),
934
+ ...(input.capacityProvider != null && { capacityProvider: input.capacityProvider }),
935
+ ...(input.weight != null && { weight: input.weight }),
936
+ };
937
+ };
938
+ const serializeAws_restJson1DeadLetterConfig = (input, context) => {
939
+ return {
940
+ ...(input.Arn != null && { Arn: input.Arn }),
941
+ };
942
+ };
943
+ const serializeAws_restJson1EcsParameters = (input, context) => {
944
+ return {
945
+ ...(input.CapacityProviderStrategy != null && {
946
+ CapacityProviderStrategy: serializeAws_restJson1CapacityProviderStrategy(input.CapacityProviderStrategy, context),
947
+ }),
948
+ ...(input.EnableECSManagedTags != null && { EnableECSManagedTags: input.EnableECSManagedTags }),
949
+ ...(input.EnableExecuteCommand != null && { EnableExecuteCommand: input.EnableExecuteCommand }),
950
+ ...(input.Group != null && { Group: input.Group }),
951
+ ...(input.LaunchType != null && { LaunchType: input.LaunchType }),
952
+ ...(input.NetworkConfiguration != null && {
953
+ NetworkConfiguration: serializeAws_restJson1NetworkConfiguration(input.NetworkConfiguration, context),
954
+ }),
955
+ ...(input.PlacementConstraints != null && {
956
+ PlacementConstraints: serializeAws_restJson1PlacementConstraints(input.PlacementConstraints, context),
957
+ }),
958
+ ...(input.PlacementStrategy != null && {
959
+ PlacementStrategy: serializeAws_restJson1PlacementStrategies(input.PlacementStrategy, context),
960
+ }),
961
+ ...(input.PlatformVersion != null && { PlatformVersion: input.PlatformVersion }),
962
+ ...(input.PropagateTags != null && { PropagateTags: input.PropagateTags }),
963
+ ...(input.ReferenceId != null && { ReferenceId: input.ReferenceId }),
964
+ ...(input.Tags != null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
965
+ ...(input.TaskCount != null && { TaskCount: input.TaskCount }),
966
+ ...(input.TaskDefinitionArn != null && { TaskDefinitionArn: input.TaskDefinitionArn }),
967
+ };
968
+ };
969
+ const serializeAws_restJson1EventBridgeParameters = (input, context) => {
970
+ return {
971
+ ...(input.DetailType != null && { DetailType: input.DetailType }),
972
+ ...(input.Source != null && { Source: input.Source }),
973
+ };
974
+ };
975
+ const serializeAws_restJson1FlexibleTimeWindow = (input, context) => {
976
+ return {
977
+ ...(input.MaximumWindowInMinutes != null && { MaximumWindowInMinutes: input.MaximumWindowInMinutes }),
978
+ ...(input.Mode != null && { Mode: input.Mode }),
979
+ };
980
+ };
981
+ const serializeAws_restJson1KinesisParameters = (input, context) => {
982
+ return {
983
+ ...(input.PartitionKey != null && { PartitionKey: input.PartitionKey }),
984
+ };
985
+ };
986
+ const serializeAws_restJson1NetworkConfiguration = (input, context) => {
987
+ return {
988
+ ...(input.awsvpcConfiguration != null && {
989
+ awsvpcConfiguration: serializeAws_restJson1AwsVpcConfiguration(input.awsvpcConfiguration, context),
990
+ }),
991
+ };
992
+ };
993
+ const serializeAws_restJson1PlacementConstraint = (input, context) => {
994
+ return {
995
+ ...(input.expression != null && { expression: input.expression }),
996
+ ...(input.type != null && { type: input.type }),
997
+ };
998
+ };
999
+ const serializeAws_restJson1PlacementConstraints = (input, context) => {
1000
+ return input
1001
+ .filter((e) => e != null)
1002
+ .map((entry) => {
1003
+ return serializeAws_restJson1PlacementConstraint(entry, context);
1004
+ });
1005
+ };
1006
+ const serializeAws_restJson1PlacementStrategies = (input, context) => {
1007
+ return input
1008
+ .filter((e) => e != null)
1009
+ .map((entry) => {
1010
+ return serializeAws_restJson1PlacementStrategy(entry, context);
1011
+ });
1012
+ };
1013
+ const serializeAws_restJson1PlacementStrategy = (input, context) => {
1014
+ return {
1015
+ ...(input.field != null && { field: input.field }),
1016
+ ...(input.type != null && { type: input.type }),
1017
+ };
1018
+ };
1019
+ const serializeAws_restJson1RetryPolicy = (input, context) => {
1020
+ return {
1021
+ ...(input.MaximumEventAgeInSeconds != null && { MaximumEventAgeInSeconds: input.MaximumEventAgeInSeconds }),
1022
+ ...(input.MaximumRetryAttempts != null && { MaximumRetryAttempts: input.MaximumRetryAttempts }),
1023
+ };
1024
+ };
1025
+ const serializeAws_restJson1SageMakerPipelineParameter = (input, context) => {
1026
+ return {
1027
+ ...(input.Name != null && { Name: input.Name }),
1028
+ ...(input.Value != null && { Value: input.Value }),
1029
+ };
1030
+ };
1031
+ const serializeAws_restJson1SageMakerPipelineParameterList = (input, context) => {
1032
+ return input
1033
+ .filter((e) => e != null)
1034
+ .map((entry) => {
1035
+ return serializeAws_restJson1SageMakerPipelineParameter(entry, context);
1036
+ });
1037
+ };
1038
+ const serializeAws_restJson1SageMakerPipelineParameters = (input, context) => {
1039
+ return {
1040
+ ...(input.PipelineParameterList != null && {
1041
+ PipelineParameterList: serializeAws_restJson1SageMakerPipelineParameterList(input.PipelineParameterList, context),
1042
+ }),
1043
+ };
1044
+ };
1045
+ const serializeAws_restJson1SecurityGroups = (input, context) => {
1046
+ return input
1047
+ .filter((e) => e != null)
1048
+ .map((entry) => {
1049
+ return entry;
1050
+ });
1051
+ };
1052
+ const serializeAws_restJson1SqsParameters = (input, context) => {
1053
+ return {
1054
+ ...(input.MessageGroupId != null && { MessageGroupId: input.MessageGroupId }),
1055
+ };
1056
+ };
1057
+ const serializeAws_restJson1Subnets = (input, context) => {
1058
+ return input
1059
+ .filter((e) => e != null)
1060
+ .map((entry) => {
1061
+ return entry;
1062
+ });
1063
+ };
1064
+ const serializeAws_restJson1Tag = (input, context) => {
1065
+ return {
1066
+ ...(input.Key != null && { Key: input.Key }),
1067
+ ...(input.Value != null && { Value: input.Value }),
1068
+ };
1069
+ };
1070
+ const serializeAws_restJson1TagList = (input, context) => {
1071
+ return input
1072
+ .filter((e) => e != null)
1073
+ .map((entry) => {
1074
+ return serializeAws_restJson1Tag(entry, context);
1075
+ });
1076
+ };
1077
+ const serializeAws_restJson1TagMap = (input, context) => {
1078
+ return Object.entries(input).reduce((acc, [key, value]) => {
1079
+ if (value === null) {
1080
+ return acc;
1081
+ }
1082
+ return {
1083
+ ...acc,
1084
+ [key]: value,
1085
+ };
1086
+ }, {});
1087
+ };
1088
+ const serializeAws_restJson1Tags = (input, context) => {
1089
+ return input
1090
+ .filter((e) => e != null)
1091
+ .map((entry) => {
1092
+ return serializeAws_restJson1TagMap(entry, context);
1093
+ });
1094
+ };
1095
+ const serializeAws_restJson1Target = (input, context) => {
1096
+ return {
1097
+ ...(input.Arn != null && { Arn: input.Arn }),
1098
+ ...(input.DeadLetterConfig != null && {
1099
+ DeadLetterConfig: serializeAws_restJson1DeadLetterConfig(input.DeadLetterConfig, context),
1100
+ }),
1101
+ ...(input.EcsParameters != null && {
1102
+ EcsParameters: serializeAws_restJson1EcsParameters(input.EcsParameters, context),
1103
+ }),
1104
+ ...(input.EventBridgeParameters != null && {
1105
+ EventBridgeParameters: serializeAws_restJson1EventBridgeParameters(input.EventBridgeParameters, context),
1106
+ }),
1107
+ ...(input.Input != null && { Input: input.Input }),
1108
+ ...(input.KinesisParameters != null && {
1109
+ KinesisParameters: serializeAws_restJson1KinesisParameters(input.KinesisParameters, context),
1110
+ }),
1111
+ ...(input.RetryPolicy != null && { RetryPolicy: serializeAws_restJson1RetryPolicy(input.RetryPolicy, context) }),
1112
+ ...(input.RoleArn != null && { RoleArn: input.RoleArn }),
1113
+ ...(input.SageMakerPipelineParameters != null && {
1114
+ SageMakerPipelineParameters: serializeAws_restJson1SageMakerPipelineParameters(input.SageMakerPipelineParameters, context),
1115
+ }),
1116
+ ...(input.SqsParameters != null && {
1117
+ SqsParameters: serializeAws_restJson1SqsParameters(input.SqsParameters, context),
1118
+ }),
1119
+ };
1120
+ };
1121
+ const deserializeAws_restJson1AwsVpcConfiguration = (output, context) => {
1122
+ return {
1123
+ AssignPublicIp: __expectString(output.AssignPublicIp),
1124
+ SecurityGroups: output.SecurityGroups != null
1125
+ ? deserializeAws_restJson1SecurityGroups(output.SecurityGroups, context)
1126
+ : undefined,
1127
+ Subnets: output.Subnets != null ? deserializeAws_restJson1Subnets(output.Subnets, context) : undefined,
1128
+ };
1129
+ };
1130
+ const deserializeAws_restJson1CapacityProviderStrategy = (output, context) => {
1131
+ const retVal = (output || [])
1132
+ .filter((e) => e != null)
1133
+ .map((entry) => {
1134
+ if (entry === null) {
1135
+ return null;
1136
+ }
1137
+ return deserializeAws_restJson1CapacityProviderStrategyItem(entry, context);
1138
+ });
1139
+ return retVal;
1140
+ };
1141
+ const deserializeAws_restJson1CapacityProviderStrategyItem = (output, context) => {
1142
+ return {
1143
+ base: __expectInt32(output.base),
1144
+ capacityProvider: __expectString(output.capacityProvider),
1145
+ weight: __expectInt32(output.weight),
1146
+ };
1147
+ };
1148
+ const deserializeAws_restJson1DeadLetterConfig = (output, context) => {
1149
+ return {
1150
+ Arn: __expectString(output.Arn),
1151
+ };
1152
+ };
1153
+ const deserializeAws_restJson1EcsParameters = (output, context) => {
1154
+ return {
1155
+ CapacityProviderStrategy: output.CapacityProviderStrategy != null
1156
+ ? deserializeAws_restJson1CapacityProviderStrategy(output.CapacityProviderStrategy, context)
1157
+ : undefined,
1158
+ EnableECSManagedTags: __expectBoolean(output.EnableECSManagedTags),
1159
+ EnableExecuteCommand: __expectBoolean(output.EnableExecuteCommand),
1160
+ Group: __expectString(output.Group),
1161
+ LaunchType: __expectString(output.LaunchType),
1162
+ NetworkConfiguration: output.NetworkConfiguration != null
1163
+ ? deserializeAws_restJson1NetworkConfiguration(output.NetworkConfiguration, context)
1164
+ : undefined,
1165
+ PlacementConstraints: output.PlacementConstraints != null
1166
+ ? deserializeAws_restJson1PlacementConstraints(output.PlacementConstraints, context)
1167
+ : undefined,
1168
+ PlacementStrategy: output.PlacementStrategy != null
1169
+ ? deserializeAws_restJson1PlacementStrategies(output.PlacementStrategy, context)
1170
+ : undefined,
1171
+ PlatformVersion: __expectString(output.PlatformVersion),
1172
+ PropagateTags: __expectString(output.PropagateTags),
1173
+ ReferenceId: __expectString(output.ReferenceId),
1174
+ Tags: output.Tags != null ? deserializeAws_restJson1Tags(output.Tags, context) : undefined,
1175
+ TaskCount: __expectInt32(output.TaskCount),
1176
+ TaskDefinitionArn: __expectString(output.TaskDefinitionArn),
1177
+ };
1178
+ };
1179
+ const deserializeAws_restJson1EventBridgeParameters = (output, context) => {
1180
+ return {
1181
+ DetailType: __expectString(output.DetailType),
1182
+ Source: __expectString(output.Source),
1183
+ };
1184
+ };
1185
+ const deserializeAws_restJson1FlexibleTimeWindow = (output, context) => {
1186
+ return {
1187
+ MaximumWindowInMinutes: __expectInt32(output.MaximumWindowInMinutes),
1188
+ Mode: __expectString(output.Mode),
1189
+ };
1190
+ };
1191
+ const deserializeAws_restJson1KinesisParameters = (output, context) => {
1192
+ return {
1193
+ PartitionKey: __expectString(output.PartitionKey),
1194
+ };
1195
+ };
1196
+ const deserializeAws_restJson1NetworkConfiguration = (output, context) => {
1197
+ return {
1198
+ awsvpcConfiguration: output.awsvpcConfiguration != null
1199
+ ? deserializeAws_restJson1AwsVpcConfiguration(output.awsvpcConfiguration, context)
1200
+ : undefined,
1201
+ };
1202
+ };
1203
+ const deserializeAws_restJson1PlacementConstraint = (output, context) => {
1204
+ return {
1205
+ expression: __expectString(output.expression),
1206
+ type: __expectString(output.type),
1207
+ };
1208
+ };
1209
+ const deserializeAws_restJson1PlacementConstraints = (output, context) => {
1210
+ const retVal = (output || [])
1211
+ .filter((e) => e != null)
1212
+ .map((entry) => {
1213
+ if (entry === null) {
1214
+ return null;
1215
+ }
1216
+ return deserializeAws_restJson1PlacementConstraint(entry, context);
1217
+ });
1218
+ return retVal;
1219
+ };
1220
+ const deserializeAws_restJson1PlacementStrategies = (output, context) => {
1221
+ const retVal = (output || [])
1222
+ .filter((e) => e != null)
1223
+ .map((entry) => {
1224
+ if (entry === null) {
1225
+ return null;
1226
+ }
1227
+ return deserializeAws_restJson1PlacementStrategy(entry, context);
1228
+ });
1229
+ return retVal;
1230
+ };
1231
+ const deserializeAws_restJson1PlacementStrategy = (output, context) => {
1232
+ return {
1233
+ field: __expectString(output.field),
1234
+ type: __expectString(output.type),
1235
+ };
1236
+ };
1237
+ const deserializeAws_restJson1RetryPolicy = (output, context) => {
1238
+ return {
1239
+ MaximumEventAgeInSeconds: __expectInt32(output.MaximumEventAgeInSeconds),
1240
+ MaximumRetryAttempts: __expectInt32(output.MaximumRetryAttempts),
1241
+ };
1242
+ };
1243
+ const deserializeAws_restJson1SageMakerPipelineParameter = (output, context) => {
1244
+ return {
1245
+ Name: __expectString(output.Name),
1246
+ Value: __expectString(output.Value),
1247
+ };
1248
+ };
1249
+ const deserializeAws_restJson1SageMakerPipelineParameterList = (output, context) => {
1250
+ const retVal = (output || [])
1251
+ .filter((e) => e != null)
1252
+ .map((entry) => {
1253
+ if (entry === null) {
1254
+ return null;
1255
+ }
1256
+ return deserializeAws_restJson1SageMakerPipelineParameter(entry, context);
1257
+ });
1258
+ return retVal;
1259
+ };
1260
+ const deserializeAws_restJson1SageMakerPipelineParameters = (output, context) => {
1261
+ return {
1262
+ PipelineParameterList: output.PipelineParameterList != null
1263
+ ? deserializeAws_restJson1SageMakerPipelineParameterList(output.PipelineParameterList, context)
1264
+ : undefined,
1265
+ };
1266
+ };
1267
+ const deserializeAws_restJson1ScheduleGroupList = (output, context) => {
1268
+ const retVal = (output || [])
1269
+ .filter((e) => e != null)
1270
+ .map((entry) => {
1271
+ if (entry === null) {
1272
+ return null;
1273
+ }
1274
+ return deserializeAws_restJson1ScheduleGroupSummary(entry, context);
1275
+ });
1276
+ return retVal;
1277
+ };
1278
+ const deserializeAws_restJson1ScheduleGroupSummary = (output, context) => {
1279
+ return {
1280
+ Arn: __expectString(output.Arn),
1281
+ CreationDate: output.CreationDate != null
1282
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
1283
+ : undefined,
1284
+ LastModificationDate: output.LastModificationDate != null
1285
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModificationDate)))
1286
+ : undefined,
1287
+ Name: __expectString(output.Name),
1288
+ State: __expectString(output.State),
1289
+ };
1290
+ };
1291
+ const deserializeAws_restJson1ScheduleList = (output, context) => {
1292
+ const retVal = (output || [])
1293
+ .filter((e) => e != null)
1294
+ .map((entry) => {
1295
+ if (entry === null) {
1296
+ return null;
1297
+ }
1298
+ return deserializeAws_restJson1ScheduleSummary(entry, context);
1299
+ });
1300
+ return retVal;
1301
+ };
1302
+ const deserializeAws_restJson1ScheduleSummary = (output, context) => {
1303
+ return {
1304
+ Arn: __expectString(output.Arn),
1305
+ CreationDate: output.CreationDate != null
1306
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
1307
+ : undefined,
1308
+ GroupName: __expectString(output.GroupName),
1309
+ LastModificationDate: output.LastModificationDate != null
1310
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModificationDate)))
1311
+ : undefined,
1312
+ Name: __expectString(output.Name),
1313
+ State: __expectString(output.State),
1314
+ Target: output.Target != null ? deserializeAws_restJson1TargetSummary(output.Target, context) : undefined,
1315
+ };
1316
+ };
1317
+ const deserializeAws_restJson1SecurityGroups = (output, context) => {
1318
+ const retVal = (output || [])
1319
+ .filter((e) => e != null)
1320
+ .map((entry) => {
1321
+ if (entry === null) {
1322
+ return null;
1323
+ }
1324
+ return __expectString(entry);
1325
+ });
1326
+ return retVal;
1327
+ };
1328
+ const deserializeAws_restJson1SqsParameters = (output, context) => {
1329
+ return {
1330
+ MessageGroupId: __expectString(output.MessageGroupId),
1331
+ };
1332
+ };
1333
+ const deserializeAws_restJson1Subnets = (output, context) => {
1334
+ const retVal = (output || [])
1335
+ .filter((e) => e != null)
1336
+ .map((entry) => {
1337
+ if (entry === null) {
1338
+ return null;
1339
+ }
1340
+ return __expectString(entry);
1341
+ });
1342
+ return retVal;
1343
+ };
1344
+ const deserializeAws_restJson1Tag = (output, context) => {
1345
+ return {
1346
+ Key: __expectString(output.Key),
1347
+ Value: __expectString(output.Value),
1348
+ };
1349
+ };
1350
+ const deserializeAws_restJson1TagList = (output, context) => {
1351
+ const retVal = (output || [])
1352
+ .filter((e) => e != null)
1353
+ .map((entry) => {
1354
+ if (entry === null) {
1355
+ return null;
1356
+ }
1357
+ return deserializeAws_restJson1Tag(entry, context);
1358
+ });
1359
+ return retVal;
1360
+ };
1361
+ const deserializeAws_restJson1TagMap = (output, context) => {
1362
+ return Object.entries(output).reduce((acc, [key, value]) => {
1363
+ if (value === null) {
1364
+ return acc;
1365
+ }
1366
+ return {
1367
+ ...acc,
1368
+ [key]: __expectString(value),
1369
+ };
1370
+ }, {});
1371
+ };
1372
+ const deserializeAws_restJson1Tags = (output, context) => {
1373
+ const retVal = (output || [])
1374
+ .filter((e) => e != null)
1375
+ .map((entry) => {
1376
+ if (entry === null) {
1377
+ return null;
1378
+ }
1379
+ return deserializeAws_restJson1TagMap(entry, context);
1380
+ });
1381
+ return retVal;
1382
+ };
1383
+ const deserializeAws_restJson1Target = (output, context) => {
1384
+ return {
1385
+ Arn: __expectString(output.Arn),
1386
+ DeadLetterConfig: output.DeadLetterConfig != null
1387
+ ? deserializeAws_restJson1DeadLetterConfig(output.DeadLetterConfig, context)
1388
+ : undefined,
1389
+ EcsParameters: output.EcsParameters != null ? deserializeAws_restJson1EcsParameters(output.EcsParameters, context) : undefined,
1390
+ EventBridgeParameters: output.EventBridgeParameters != null
1391
+ ? deserializeAws_restJson1EventBridgeParameters(output.EventBridgeParameters, context)
1392
+ : undefined,
1393
+ Input: __expectString(output.Input),
1394
+ KinesisParameters: output.KinesisParameters != null
1395
+ ? deserializeAws_restJson1KinesisParameters(output.KinesisParameters, context)
1396
+ : undefined,
1397
+ RetryPolicy: output.RetryPolicy != null ? deserializeAws_restJson1RetryPolicy(output.RetryPolicy, context) : undefined,
1398
+ RoleArn: __expectString(output.RoleArn),
1399
+ SageMakerPipelineParameters: output.SageMakerPipelineParameters != null
1400
+ ? deserializeAws_restJson1SageMakerPipelineParameters(output.SageMakerPipelineParameters, context)
1401
+ : undefined,
1402
+ SqsParameters: output.SqsParameters != null ? deserializeAws_restJson1SqsParameters(output.SqsParameters, context) : undefined,
1403
+ };
1404
+ };
1405
+ const deserializeAws_restJson1TargetSummary = (output, context) => {
1406
+ return {
1407
+ Arn: __expectString(output.Arn),
1408
+ };
1409
+ };
1410
+ const deserializeMetadata = (output) => ({
1411
+ httpStatusCode: output.statusCode,
1412
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1413
+ extendedRequestId: output.headers["x-amz-id-2"],
1414
+ cfId: output.headers["x-amz-cf-id"],
1415
+ });
1416
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1417
+ if (streamBody instanceof Uint8Array) {
1418
+ return Promise.resolve(streamBody);
1419
+ }
1420
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1421
+ };
1422
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1423
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1424
+ value !== null &&
1425
+ value !== "" &&
1426
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1427
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1428
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1429
+ if (encoded.length) {
1430
+ return JSON.parse(encoded);
1431
+ }
1432
+ return {};
1433
+ });
1434
+ const parseErrorBody = async (errorBody, context) => {
1435
+ const value = await parseBody(errorBody, context);
1436
+ value.message = value.message ?? value.Message;
1437
+ return value;
1438
+ };
1439
+ const loadRestJsonErrorCode = (output, data) => {
1440
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1441
+ const sanitizeErrorCode = (rawValue) => {
1442
+ let cleanValue = rawValue;
1443
+ if (typeof cleanValue === "number") {
1444
+ cleanValue = cleanValue.toString();
1445
+ }
1446
+ if (cleanValue.indexOf(",") >= 0) {
1447
+ cleanValue = cleanValue.split(",")[0];
1448
+ }
1449
+ if (cleanValue.indexOf(":") >= 0) {
1450
+ cleanValue = cleanValue.split(":")[0];
1451
+ }
1452
+ if (cleanValue.indexOf("#") >= 0) {
1453
+ cleanValue = cleanValue.split("#")[1];
1454
+ }
1455
+ return cleanValue;
1456
+ };
1457
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1458
+ if (headerKey !== undefined) {
1459
+ return sanitizeErrorCode(output.headers[headerKey]);
1460
+ }
1461
+ if (data.code !== undefined) {
1462
+ return sanitizeErrorCode(data.code);
1463
+ }
1464
+ if (data["__type"] !== undefined) {
1465
+ return sanitizeErrorCode(data["__type"]);
1466
+ }
1467
+ };