@aws-sdk/client-batch 3.40.0 → 3.45.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 (70) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +2 -2
  3. package/dist-cjs/Batch.js +75 -0
  4. package/dist-cjs/commands/CreateSchedulingPolicyCommand.js +36 -0
  5. package/dist-cjs/commands/DeleteSchedulingPolicyCommand.js +36 -0
  6. package/dist-cjs/commands/DescribeSchedulingPoliciesCommand.js +36 -0
  7. package/dist-cjs/commands/ListSchedulingPoliciesCommand.js +36 -0
  8. package/dist-cjs/commands/UpdateSchedulingPolicyCommand.js +36 -0
  9. package/dist-cjs/commands/index.js +5 -0
  10. package/dist-cjs/endpoints.js +25 -0
  11. package/dist-cjs/models/models_0.js +87 -3
  12. package/dist-cjs/pagination/ListSchedulingPoliciesPaginator.js +35 -0
  13. package/dist-cjs/pagination/index.js +1 -0
  14. package/dist-cjs/protocols/Aws_restJson1.js +509 -1
  15. package/dist-es/Batch.js +75 -0
  16. package/dist-es/commands/CreateSchedulingPolicyCommand.js +39 -0
  17. package/dist-es/commands/DeleteSchedulingPolicyCommand.js +39 -0
  18. package/dist-es/commands/DescribeSchedulingPoliciesCommand.js +39 -0
  19. package/dist-es/commands/ListSchedulingPoliciesCommand.js +39 -0
  20. package/dist-es/commands/UpdateSchedulingPolicyCommand.js +39 -0
  21. package/dist-es/commands/index.js +5 -0
  22. package/dist-es/endpoints.js +25 -0
  23. package/dist-es/models/models_0.js +56 -0
  24. package/dist-es/pagination/ListSchedulingPoliciesPaginator.js +74 -0
  25. package/dist-es/pagination/index.js +1 -0
  26. package/dist-es/protocols/Aws_restJson1.js +584 -13
  27. package/dist-types/Batch.d.ts +50 -12
  28. package/dist-types/BatchClient.d.ts +9 -4
  29. package/dist-types/commands/CancelJobCommand.d.ts +1 -1
  30. package/dist-types/commands/CreateComputeEnvironmentCommand.d.ts +5 -6
  31. package/dist-types/commands/CreateJobQueueCommand.d.ts +1 -1
  32. package/dist-types/commands/CreateSchedulingPolicyCommand.d.ts +35 -0
  33. package/dist-types/commands/DeleteComputeEnvironmentCommand.d.ts +1 -1
  34. package/dist-types/commands/DeleteJobQueueCommand.d.ts +1 -1
  35. package/dist-types/commands/DeleteSchedulingPolicyCommand.d.ts +36 -0
  36. package/dist-types/commands/DeregisterJobDefinitionCommand.d.ts +1 -1
  37. package/dist-types/commands/DescribeComputeEnvironmentsCommand.d.ts +1 -1
  38. package/dist-types/commands/DescribeJobDefinitionsCommand.d.ts +1 -1
  39. package/dist-types/commands/DescribeJobQueuesCommand.d.ts +1 -1
  40. package/dist-types/commands/DescribeJobsCommand.d.ts +1 -1
  41. package/dist-types/commands/DescribeSchedulingPoliciesCommand.d.ts +35 -0
  42. package/dist-types/commands/ListJobsCommand.d.ts +1 -1
  43. package/dist-types/commands/ListSchedulingPoliciesCommand.d.ts +35 -0
  44. package/dist-types/commands/ListTagsForResourceCommand.d.ts +3 -3
  45. package/dist-types/commands/RegisterJobDefinitionCommand.d.ts +1 -1
  46. package/dist-types/commands/SubmitJobCommand.d.ts +5 -2
  47. package/dist-types/commands/TagResourceCommand.d.ts +3 -3
  48. package/dist-types/commands/TerminateJobCommand.d.ts +1 -1
  49. package/dist-types/commands/UntagResourceCommand.d.ts +1 -1
  50. package/dist-types/commands/UpdateComputeEnvironmentCommand.d.ts +1 -1
  51. package/dist-types/commands/UpdateJobQueueCommand.d.ts +1 -1
  52. package/dist-types/commands/UpdateSchedulingPolicyCommand.d.ts +35 -0
  53. package/dist-types/commands/index.d.ts +5 -0
  54. package/dist-types/models/models_0.d.ts +455 -114
  55. package/dist-types/pagination/ListSchedulingPoliciesPaginator.d.ts +4 -0
  56. package/dist-types/pagination/index.d.ts +1 -0
  57. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  58. package/dist-types/ts3.4/Batch.d.ts +25 -0
  59. package/dist-types/ts3.4/BatchClient.d.ts +7 -2
  60. package/dist-types/ts3.4/commands/CreateSchedulingPolicyCommand.d.ts +17 -0
  61. package/dist-types/ts3.4/commands/DeleteSchedulingPolicyCommand.d.ts +17 -0
  62. package/dist-types/ts3.4/commands/DescribeSchedulingPoliciesCommand.d.ts +17 -0
  63. package/dist-types/ts3.4/commands/ListSchedulingPoliciesCommand.d.ts +17 -0
  64. package/dist-types/ts3.4/commands/UpdateSchedulingPolicyCommand.d.ts +17 -0
  65. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  66. package/dist-types/ts3.4/models/models_0.d.ts +164 -0
  67. package/dist-types/ts3.4/pagination/ListSchedulingPoliciesPaginator.d.ts +4 -0
  68. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  69. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
  70. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UpdateJobQueueCommand = exports.deserializeAws_restJson1UpdateComputeEnvironmentCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TerminateJobCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1SubmitJobCommand = exports.deserializeAws_restJson1RegisterJobDefinitionCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListJobsCommand = exports.deserializeAws_restJson1DescribeJobsCommand = exports.deserializeAws_restJson1DescribeJobQueuesCommand = exports.deserializeAws_restJson1DescribeJobDefinitionsCommand = exports.deserializeAws_restJson1DescribeComputeEnvironmentsCommand = exports.deserializeAws_restJson1DeregisterJobDefinitionCommand = exports.deserializeAws_restJson1DeleteJobQueueCommand = exports.deserializeAws_restJson1DeleteComputeEnvironmentCommand = exports.deserializeAws_restJson1CreateJobQueueCommand = exports.deserializeAws_restJson1CreateComputeEnvironmentCommand = exports.deserializeAws_restJson1CancelJobCommand = exports.serializeAws_restJson1UpdateJobQueueCommand = exports.serializeAws_restJson1UpdateComputeEnvironmentCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TerminateJobCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1SubmitJobCommand = exports.serializeAws_restJson1RegisterJobDefinitionCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListJobsCommand = exports.serializeAws_restJson1DescribeJobsCommand = exports.serializeAws_restJson1DescribeJobQueuesCommand = exports.serializeAws_restJson1DescribeJobDefinitionsCommand = exports.serializeAws_restJson1DescribeComputeEnvironmentsCommand = exports.serializeAws_restJson1DeregisterJobDefinitionCommand = exports.serializeAws_restJson1DeleteJobQueueCommand = exports.serializeAws_restJson1DeleteComputeEnvironmentCommand = exports.serializeAws_restJson1CreateJobQueueCommand = exports.serializeAws_restJson1CreateComputeEnvironmentCommand = exports.serializeAws_restJson1CancelJobCommand = void 0;
3
+ exports.deserializeAws_restJson1UpdateSchedulingPolicyCommand = exports.deserializeAws_restJson1UpdateJobQueueCommand = exports.deserializeAws_restJson1UpdateComputeEnvironmentCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TerminateJobCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1SubmitJobCommand = exports.deserializeAws_restJson1RegisterJobDefinitionCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListSchedulingPoliciesCommand = exports.deserializeAws_restJson1ListJobsCommand = exports.deserializeAws_restJson1DescribeSchedulingPoliciesCommand = exports.deserializeAws_restJson1DescribeJobsCommand = exports.deserializeAws_restJson1DescribeJobQueuesCommand = exports.deserializeAws_restJson1DescribeJobDefinitionsCommand = exports.deserializeAws_restJson1DescribeComputeEnvironmentsCommand = exports.deserializeAws_restJson1DeregisterJobDefinitionCommand = exports.deserializeAws_restJson1DeleteSchedulingPolicyCommand = exports.deserializeAws_restJson1DeleteJobQueueCommand = exports.deserializeAws_restJson1DeleteComputeEnvironmentCommand = exports.deserializeAws_restJson1CreateSchedulingPolicyCommand = exports.deserializeAws_restJson1CreateJobQueueCommand = exports.deserializeAws_restJson1CreateComputeEnvironmentCommand = exports.deserializeAws_restJson1CancelJobCommand = exports.serializeAws_restJson1UpdateSchedulingPolicyCommand = exports.serializeAws_restJson1UpdateJobQueueCommand = exports.serializeAws_restJson1UpdateComputeEnvironmentCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TerminateJobCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1SubmitJobCommand = exports.serializeAws_restJson1RegisterJobDefinitionCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListSchedulingPoliciesCommand = exports.serializeAws_restJson1ListJobsCommand = exports.serializeAws_restJson1DescribeSchedulingPoliciesCommand = exports.serializeAws_restJson1DescribeJobsCommand = exports.serializeAws_restJson1DescribeJobQueuesCommand = exports.serializeAws_restJson1DescribeJobDefinitionsCommand = exports.serializeAws_restJson1DescribeComputeEnvironmentsCommand = exports.serializeAws_restJson1DeregisterJobDefinitionCommand = exports.serializeAws_restJson1DeleteSchedulingPolicyCommand = exports.serializeAws_restJson1DeleteJobQueueCommand = exports.serializeAws_restJson1DeleteComputeEnvironmentCommand = exports.serializeAws_restJson1CreateSchedulingPolicyCommand = exports.serializeAws_restJson1CreateJobQueueCommand = exports.serializeAws_restJson1CreateComputeEnvironmentCommand = exports.serializeAws_restJson1CancelJobCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const serializeAws_restJson1CancelJobCommand = async (input, context) => {
@@ -44,6 +44,8 @@ const serializeAws_restJson1CreateComputeEnvironmentCommand = async (input, cont
44
44
  ...(input.tags !== undefined &&
45
45
  input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }),
46
46
  ...(input.type !== undefined && input.type !== null && { type: input.type }),
47
+ ...(input.unmanagedvCpus !== undefined &&
48
+ input.unmanagedvCpus !== null && { unmanagedvCpus: input.unmanagedvCpus }),
47
49
  });
48
50
  return new protocol_http_1.HttpRequest({
49
51
  protocol,
@@ -70,6 +72,8 @@ const serializeAws_restJson1CreateJobQueueCommand = async (input, context) => {
70
72
  }),
71
73
  ...(input.jobQueueName !== undefined && input.jobQueueName !== null && { jobQueueName: input.jobQueueName }),
72
74
  ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }),
75
+ ...(input.schedulingPolicyArn !== undefined &&
76
+ input.schedulingPolicyArn !== null && { schedulingPolicyArn: input.schedulingPolicyArn }),
73
77
  ...(input.state !== undefined && input.state !== null && { state: input.state }),
74
78
  ...(input.tags !== undefined &&
75
79
  input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }),
@@ -85,6 +89,33 @@ const serializeAws_restJson1CreateJobQueueCommand = async (input, context) => {
85
89
  });
86
90
  };
87
91
  exports.serializeAws_restJson1CreateJobQueueCommand = serializeAws_restJson1CreateJobQueueCommand;
92
+ const serializeAws_restJson1CreateSchedulingPolicyCommand = async (input, context) => {
93
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
94
+ const headers = {
95
+ "content-type": "application/json",
96
+ };
97
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/createschedulingpolicy";
98
+ let body;
99
+ body = JSON.stringify({
100
+ ...(input.fairsharePolicy !== undefined &&
101
+ input.fairsharePolicy !== null && {
102
+ fairsharePolicy: serializeAws_restJson1FairsharePolicy(input.fairsharePolicy, context),
103
+ }),
104
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
105
+ ...(input.tags !== undefined &&
106
+ input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }),
107
+ });
108
+ return new protocol_http_1.HttpRequest({
109
+ protocol,
110
+ hostname,
111
+ port,
112
+ method: "POST",
113
+ headers,
114
+ path: resolvedPath,
115
+ body,
116
+ });
117
+ };
118
+ exports.serializeAws_restJson1CreateSchedulingPolicyCommand = serializeAws_restJson1CreateSchedulingPolicyCommand;
88
119
  const serializeAws_restJson1DeleteComputeEnvironmentCommand = async (input, context) => {
89
120
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
90
121
  const headers = {
@@ -128,6 +159,27 @@ const serializeAws_restJson1DeleteJobQueueCommand = async (input, context) => {
128
159
  });
129
160
  };
130
161
  exports.serializeAws_restJson1DeleteJobQueueCommand = serializeAws_restJson1DeleteJobQueueCommand;
162
+ const serializeAws_restJson1DeleteSchedulingPolicyCommand = async (input, context) => {
163
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
164
+ const headers = {
165
+ "content-type": "application/json",
166
+ };
167
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/deleteschedulingpolicy";
168
+ let body;
169
+ body = JSON.stringify({
170
+ ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
171
+ });
172
+ return new protocol_http_1.HttpRequest({
173
+ protocol,
174
+ hostname,
175
+ port,
176
+ method: "POST",
177
+ headers,
178
+ path: resolvedPath,
179
+ body,
180
+ });
181
+ };
182
+ exports.serializeAws_restJson1DeleteSchedulingPolicyCommand = serializeAws_restJson1DeleteSchedulingPolicyCommand;
131
183
  const serializeAws_restJson1DeregisterJobDefinitionCommand = async (input, context) => {
132
184
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
133
185
  const headers = {
@@ -250,6 +302,28 @@ const serializeAws_restJson1DescribeJobsCommand = async (input, context) => {
250
302
  });
251
303
  };
252
304
  exports.serializeAws_restJson1DescribeJobsCommand = serializeAws_restJson1DescribeJobsCommand;
305
+ const serializeAws_restJson1DescribeSchedulingPoliciesCommand = async (input, context) => {
306
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
307
+ const headers = {
308
+ "content-type": "application/json",
309
+ };
310
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/describeschedulingpolicies";
311
+ let body;
312
+ body = JSON.stringify({
313
+ ...(input.arns !== undefined &&
314
+ input.arns !== null && { arns: serializeAws_restJson1StringList(input.arns, context) }),
315
+ });
316
+ return new protocol_http_1.HttpRequest({
317
+ protocol,
318
+ hostname,
319
+ port,
320
+ method: "POST",
321
+ headers,
322
+ path: resolvedPath,
323
+ body,
324
+ });
325
+ };
326
+ exports.serializeAws_restJson1DescribeSchedulingPoliciesCommand = serializeAws_restJson1DescribeSchedulingPoliciesCommand;
253
327
  const serializeAws_restJson1ListJobsCommand = async (input, context) => {
254
328
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
255
329
  const headers = {
@@ -279,6 +353,28 @@ const serializeAws_restJson1ListJobsCommand = async (input, context) => {
279
353
  });
280
354
  };
281
355
  exports.serializeAws_restJson1ListJobsCommand = serializeAws_restJson1ListJobsCommand;
356
+ const serializeAws_restJson1ListSchedulingPoliciesCommand = async (input, context) => {
357
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
358
+ const headers = {
359
+ "content-type": "application/json",
360
+ };
361
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/listschedulingpolicies";
362
+ let body;
363
+ body = JSON.stringify({
364
+ ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
365
+ ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
366
+ });
367
+ return new protocol_http_1.HttpRequest({
368
+ protocol,
369
+ hostname,
370
+ port,
371
+ method: "POST",
372
+ headers,
373
+ path: resolvedPath,
374
+ body,
375
+ });
376
+ };
377
+ exports.serializeAws_restJson1ListSchedulingPoliciesCommand = serializeAws_restJson1ListSchedulingPoliciesCommand;
282
378
  const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
283
379
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
284
380
  const headers = {};
@@ -334,6 +430,8 @@ const serializeAws_restJson1RegisterJobDefinitionCommand = async (input, context
334
430
  input.retryStrategy !== null && {
335
431
  retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context),
336
432
  }),
433
+ ...(input.schedulingPriority !== undefined &&
434
+ input.schedulingPriority !== null && { schedulingPriority: input.schedulingPriority }),
337
435
  ...(input.tags !== undefined &&
338
436
  input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }),
339
437
  ...(input.timeout !== undefined &&
@@ -383,6 +481,10 @@ const serializeAws_restJson1SubmitJobCommand = async (input, context) => {
383
481
  input.retryStrategy !== null && {
384
482
  retryStrategy: serializeAws_restJson1RetryStrategy(input.retryStrategy, context),
385
483
  }),
484
+ ...(input.schedulingPriorityOverride !== undefined &&
485
+ input.schedulingPriorityOverride !== null && { schedulingPriorityOverride: input.schedulingPriorityOverride }),
486
+ ...(input.shareIdentifier !== undefined &&
487
+ input.shareIdentifier !== null && { shareIdentifier: input.shareIdentifier }),
386
488
  ...(input.tags !== undefined &&
387
489
  input.tags !== null && { tags: serializeAws_restJson1TagrisTagsMap(input.tags, context) }),
388
490
  ...(input.timeout !== undefined &&
@@ -499,6 +601,8 @@ const serializeAws_restJson1UpdateComputeEnvironmentCommand = async (input, cont
499
601
  }),
500
602
  ...(input.serviceRole !== undefined && input.serviceRole !== null && { serviceRole: input.serviceRole }),
501
603
  ...(input.state !== undefined && input.state !== null && { state: input.state }),
604
+ ...(input.unmanagedvCpus !== undefined &&
605
+ input.unmanagedvCpus !== null && { unmanagedvCpus: input.unmanagedvCpus }),
502
606
  });
503
607
  return new protocol_http_1.HttpRequest({
504
608
  protocol,
@@ -525,6 +629,8 @@ const serializeAws_restJson1UpdateJobQueueCommand = async (input, context) => {
525
629
  }),
526
630
  ...(input.jobQueue !== undefined && input.jobQueue !== null && { jobQueue: input.jobQueue }),
527
631
  ...(input.priority !== undefined && input.priority !== null && { priority: input.priority }),
632
+ ...(input.schedulingPolicyArn !== undefined &&
633
+ input.schedulingPolicyArn !== null && { schedulingPolicyArn: input.schedulingPolicyArn }),
528
634
  ...(input.state !== undefined && input.state !== null && { state: input.state }),
529
635
  });
530
636
  return new protocol_http_1.HttpRequest({
@@ -538,6 +644,31 @@ const serializeAws_restJson1UpdateJobQueueCommand = async (input, context) => {
538
644
  });
539
645
  };
540
646
  exports.serializeAws_restJson1UpdateJobQueueCommand = serializeAws_restJson1UpdateJobQueueCommand;
647
+ const serializeAws_restJson1UpdateSchedulingPolicyCommand = async (input, context) => {
648
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
649
+ const headers = {
650
+ "content-type": "application/json",
651
+ };
652
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/updateschedulingpolicy";
653
+ let body;
654
+ body = JSON.stringify({
655
+ ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
656
+ ...(input.fairsharePolicy !== undefined &&
657
+ input.fairsharePolicy !== null && {
658
+ fairsharePolicy: serializeAws_restJson1FairsharePolicy(input.fairsharePolicy, context),
659
+ }),
660
+ });
661
+ return new protocol_http_1.HttpRequest({
662
+ protocol,
663
+ hostname,
664
+ port,
665
+ method: "POST",
666
+ headers,
667
+ path: resolvedPath,
668
+ body,
669
+ });
670
+ };
671
+ exports.serializeAws_restJson1UpdateSchedulingPolicyCommand = serializeAws_restJson1UpdateSchedulingPolicyCommand;
541
672
  const deserializeAws_restJson1CancelJobCommand = async (output, context) => {
542
673
  if (output.statusCode !== 200 && output.statusCode >= 300) {
543
674
  return deserializeAws_restJson1CancelJobCommandError(output, context);
@@ -710,6 +841,66 @@ const deserializeAws_restJson1CreateJobQueueCommandError = async (output, contex
710
841
  delete response.Message;
711
842
  return Promise.reject(Object.assign(new Error(message), response));
712
843
  };
844
+ const deserializeAws_restJson1CreateSchedulingPolicyCommand = async (output, context) => {
845
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
846
+ return deserializeAws_restJson1CreateSchedulingPolicyCommandError(output, context);
847
+ }
848
+ const contents = {
849
+ $metadata: deserializeMetadata(output),
850
+ arn: undefined,
851
+ name: undefined,
852
+ };
853
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
854
+ if (data.arn !== undefined && data.arn !== null) {
855
+ contents.arn = smithy_client_1.expectString(data.arn);
856
+ }
857
+ if (data.name !== undefined && data.name !== null) {
858
+ contents.name = smithy_client_1.expectString(data.name);
859
+ }
860
+ return Promise.resolve(contents);
861
+ };
862
+ exports.deserializeAws_restJson1CreateSchedulingPolicyCommand = deserializeAws_restJson1CreateSchedulingPolicyCommand;
863
+ const deserializeAws_restJson1CreateSchedulingPolicyCommandError = async (output, context) => {
864
+ const parsedOutput = {
865
+ ...output,
866
+ body: await parseBody(output.body, context),
867
+ };
868
+ let response;
869
+ let errorCode = "UnknownError";
870
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
871
+ switch (errorCode) {
872
+ case "ClientException":
873
+ case "com.amazonaws.batch#ClientException":
874
+ response = {
875
+ ...(await deserializeAws_restJson1ClientExceptionResponse(parsedOutput, context)),
876
+ name: errorCode,
877
+ $metadata: deserializeMetadata(output),
878
+ };
879
+ break;
880
+ case "ServerException":
881
+ case "com.amazonaws.batch#ServerException":
882
+ response = {
883
+ ...(await deserializeAws_restJson1ServerExceptionResponse(parsedOutput, context)),
884
+ name: errorCode,
885
+ $metadata: deserializeMetadata(output),
886
+ };
887
+ break;
888
+ default:
889
+ const parsedBody = parsedOutput.body;
890
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
891
+ response = {
892
+ ...parsedBody,
893
+ name: `${errorCode}`,
894
+ message: parsedBody.message || parsedBody.Message || errorCode,
895
+ $fault: "client",
896
+ $metadata: deserializeMetadata(output),
897
+ };
898
+ }
899
+ const message = response.message || response.Message || errorCode;
900
+ response.message = message;
901
+ delete response.Message;
902
+ return Promise.reject(Object.assign(new Error(message), response));
903
+ };
713
904
  const deserializeAws_restJson1DeleteComputeEnvironmentCommand = async (output, context) => {
714
905
  if (output.statusCode !== 200 && output.statusCode >= 300) {
715
906
  return deserializeAws_restJson1DeleteComputeEnvironmentCommandError(output, context);
@@ -814,6 +1005,58 @@ const deserializeAws_restJson1DeleteJobQueueCommandError = async (output, contex
814
1005
  delete response.Message;
815
1006
  return Promise.reject(Object.assign(new Error(message), response));
816
1007
  };
1008
+ const deserializeAws_restJson1DeleteSchedulingPolicyCommand = async (output, context) => {
1009
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1010
+ return deserializeAws_restJson1DeleteSchedulingPolicyCommandError(output, context);
1011
+ }
1012
+ const contents = {
1013
+ $metadata: deserializeMetadata(output),
1014
+ };
1015
+ await collectBody(output.body, context);
1016
+ return Promise.resolve(contents);
1017
+ };
1018
+ exports.deserializeAws_restJson1DeleteSchedulingPolicyCommand = deserializeAws_restJson1DeleteSchedulingPolicyCommand;
1019
+ const deserializeAws_restJson1DeleteSchedulingPolicyCommandError = async (output, context) => {
1020
+ const parsedOutput = {
1021
+ ...output,
1022
+ body: await parseBody(output.body, context),
1023
+ };
1024
+ let response;
1025
+ let errorCode = "UnknownError";
1026
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1027
+ switch (errorCode) {
1028
+ case "ClientException":
1029
+ case "com.amazonaws.batch#ClientException":
1030
+ response = {
1031
+ ...(await deserializeAws_restJson1ClientExceptionResponse(parsedOutput, context)),
1032
+ name: errorCode,
1033
+ $metadata: deserializeMetadata(output),
1034
+ };
1035
+ break;
1036
+ case "ServerException":
1037
+ case "com.amazonaws.batch#ServerException":
1038
+ response = {
1039
+ ...(await deserializeAws_restJson1ServerExceptionResponse(parsedOutput, context)),
1040
+ name: errorCode,
1041
+ $metadata: deserializeMetadata(output),
1042
+ };
1043
+ break;
1044
+ default:
1045
+ const parsedBody = parsedOutput.body;
1046
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1047
+ response = {
1048
+ ...parsedBody,
1049
+ name: `${errorCode}`,
1050
+ message: parsedBody.message || parsedBody.Message || errorCode,
1051
+ $fault: "client",
1052
+ $metadata: deserializeMetadata(output),
1053
+ };
1054
+ }
1055
+ const message = response.message || response.Message || errorCode;
1056
+ response.message = message;
1057
+ delete response.Message;
1058
+ return Promise.reject(Object.assign(new Error(message), response));
1059
+ };
817
1060
  const deserializeAws_restJson1DeregisterJobDefinitionCommand = async (output, context) => {
818
1061
  if (output.statusCode !== 200 && output.statusCode >= 300) {
819
1062
  return deserializeAws_restJson1DeregisterJobDefinitionCommandError(output, context);
@@ -1102,6 +1345,62 @@ const deserializeAws_restJson1DescribeJobsCommandError = async (output, context)
1102
1345
  delete response.Message;
1103
1346
  return Promise.reject(Object.assign(new Error(message), response));
1104
1347
  };
1348
+ const deserializeAws_restJson1DescribeSchedulingPoliciesCommand = async (output, context) => {
1349
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1350
+ return deserializeAws_restJson1DescribeSchedulingPoliciesCommandError(output, context);
1351
+ }
1352
+ const contents = {
1353
+ $metadata: deserializeMetadata(output),
1354
+ schedulingPolicies: undefined,
1355
+ };
1356
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1357
+ if (data.schedulingPolicies !== undefined && data.schedulingPolicies !== null) {
1358
+ contents.schedulingPolicies = deserializeAws_restJson1SchedulingPolicyDetailList(data.schedulingPolicies, context);
1359
+ }
1360
+ return Promise.resolve(contents);
1361
+ };
1362
+ exports.deserializeAws_restJson1DescribeSchedulingPoliciesCommand = deserializeAws_restJson1DescribeSchedulingPoliciesCommand;
1363
+ const deserializeAws_restJson1DescribeSchedulingPoliciesCommandError = async (output, context) => {
1364
+ const parsedOutput = {
1365
+ ...output,
1366
+ body: await parseBody(output.body, context),
1367
+ };
1368
+ let response;
1369
+ let errorCode = "UnknownError";
1370
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1371
+ switch (errorCode) {
1372
+ case "ClientException":
1373
+ case "com.amazonaws.batch#ClientException":
1374
+ response = {
1375
+ ...(await deserializeAws_restJson1ClientExceptionResponse(parsedOutput, context)),
1376
+ name: errorCode,
1377
+ $metadata: deserializeMetadata(output),
1378
+ };
1379
+ break;
1380
+ case "ServerException":
1381
+ case "com.amazonaws.batch#ServerException":
1382
+ response = {
1383
+ ...(await deserializeAws_restJson1ServerExceptionResponse(parsedOutput, context)),
1384
+ name: errorCode,
1385
+ $metadata: deserializeMetadata(output),
1386
+ };
1387
+ break;
1388
+ default:
1389
+ const parsedBody = parsedOutput.body;
1390
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1391
+ response = {
1392
+ ...parsedBody,
1393
+ name: `${errorCode}`,
1394
+ message: parsedBody.message || parsedBody.Message || errorCode,
1395
+ $fault: "client",
1396
+ $metadata: deserializeMetadata(output),
1397
+ };
1398
+ }
1399
+ const message = response.message || response.Message || errorCode;
1400
+ response.message = message;
1401
+ delete response.Message;
1402
+ return Promise.reject(Object.assign(new Error(message), response));
1403
+ };
1105
1404
  const deserializeAws_restJson1ListJobsCommand = async (output, context) => {
1106
1405
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1107
1406
  return deserializeAws_restJson1ListJobsCommandError(output, context);
@@ -1162,6 +1461,66 @@ const deserializeAws_restJson1ListJobsCommandError = async (output, context) =>
1162
1461
  delete response.Message;
1163
1462
  return Promise.reject(Object.assign(new Error(message), response));
1164
1463
  };
1464
+ const deserializeAws_restJson1ListSchedulingPoliciesCommand = async (output, context) => {
1465
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1466
+ return deserializeAws_restJson1ListSchedulingPoliciesCommandError(output, context);
1467
+ }
1468
+ const contents = {
1469
+ $metadata: deserializeMetadata(output),
1470
+ nextToken: undefined,
1471
+ schedulingPolicies: undefined,
1472
+ };
1473
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1474
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1475
+ contents.nextToken = smithy_client_1.expectString(data.nextToken);
1476
+ }
1477
+ if (data.schedulingPolicies !== undefined && data.schedulingPolicies !== null) {
1478
+ contents.schedulingPolicies = deserializeAws_restJson1SchedulingPolicyListingDetailList(data.schedulingPolicies, context);
1479
+ }
1480
+ return Promise.resolve(contents);
1481
+ };
1482
+ exports.deserializeAws_restJson1ListSchedulingPoliciesCommand = deserializeAws_restJson1ListSchedulingPoliciesCommand;
1483
+ const deserializeAws_restJson1ListSchedulingPoliciesCommandError = async (output, context) => {
1484
+ const parsedOutput = {
1485
+ ...output,
1486
+ body: await parseBody(output.body, context),
1487
+ };
1488
+ let response;
1489
+ let errorCode = "UnknownError";
1490
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1491
+ switch (errorCode) {
1492
+ case "ClientException":
1493
+ case "com.amazonaws.batch#ClientException":
1494
+ response = {
1495
+ ...(await deserializeAws_restJson1ClientExceptionResponse(parsedOutput, context)),
1496
+ name: errorCode,
1497
+ $metadata: deserializeMetadata(output),
1498
+ };
1499
+ break;
1500
+ case "ServerException":
1501
+ case "com.amazonaws.batch#ServerException":
1502
+ response = {
1503
+ ...(await deserializeAws_restJson1ServerExceptionResponse(parsedOutput, context)),
1504
+ name: errorCode,
1505
+ $metadata: deserializeMetadata(output),
1506
+ };
1507
+ break;
1508
+ default:
1509
+ const parsedBody = parsedOutput.body;
1510
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1511
+ response = {
1512
+ ...parsedBody,
1513
+ name: `${errorCode}`,
1514
+ message: parsedBody.message || parsedBody.Message || errorCode,
1515
+ $fault: "client",
1516
+ $metadata: deserializeMetadata(output),
1517
+ };
1518
+ }
1519
+ const message = response.message || response.Message || errorCode;
1520
+ response.message = message;
1521
+ delete response.Message;
1522
+ return Promise.reject(Object.assign(new Error(message), response));
1523
+ };
1165
1524
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1166
1525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1167
1526
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
@@ -1622,6 +1981,58 @@ const deserializeAws_restJson1UpdateJobQueueCommandError = async (output, contex
1622
1981
  delete response.Message;
1623
1982
  return Promise.reject(Object.assign(new Error(message), response));
1624
1983
  };
1984
+ const deserializeAws_restJson1UpdateSchedulingPolicyCommand = async (output, context) => {
1985
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1986
+ return deserializeAws_restJson1UpdateSchedulingPolicyCommandError(output, context);
1987
+ }
1988
+ const contents = {
1989
+ $metadata: deserializeMetadata(output),
1990
+ };
1991
+ await collectBody(output.body, context);
1992
+ return Promise.resolve(contents);
1993
+ };
1994
+ exports.deserializeAws_restJson1UpdateSchedulingPolicyCommand = deserializeAws_restJson1UpdateSchedulingPolicyCommand;
1995
+ const deserializeAws_restJson1UpdateSchedulingPolicyCommandError = async (output, context) => {
1996
+ const parsedOutput = {
1997
+ ...output,
1998
+ body: await parseBody(output.body, context),
1999
+ };
2000
+ let response;
2001
+ let errorCode = "UnknownError";
2002
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2003
+ switch (errorCode) {
2004
+ case "ClientException":
2005
+ case "com.amazonaws.batch#ClientException":
2006
+ response = {
2007
+ ...(await deserializeAws_restJson1ClientExceptionResponse(parsedOutput, context)),
2008
+ name: errorCode,
2009
+ $metadata: deserializeMetadata(output),
2010
+ };
2011
+ break;
2012
+ case "ServerException":
2013
+ case "com.amazonaws.batch#ServerException":
2014
+ response = {
2015
+ ...(await deserializeAws_restJson1ServerExceptionResponse(parsedOutput, context)),
2016
+ name: errorCode,
2017
+ $metadata: deserializeMetadata(output),
2018
+ };
2019
+ break;
2020
+ default:
2021
+ const parsedBody = parsedOutput.body;
2022
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2023
+ response = {
2024
+ ...parsedBody,
2025
+ name: `${errorCode}`,
2026
+ message: parsedBody.message || parsedBody.Message || errorCode,
2027
+ $fault: "client",
2028
+ $metadata: deserializeMetadata(output),
2029
+ };
2030
+ }
2031
+ const message = response.message || response.Message || errorCode;
2032
+ response.message = message;
2033
+ delete response.Message;
2034
+ return Promise.reject(Object.assign(new Error(message), response));
2035
+ };
1625
2036
  const deserializeAws_restJson1ClientExceptionResponse = async (parsedOutput, context) => {
1626
2037
  const contents = {
1627
2038
  name: "ClientException",
@@ -1883,6 +2294,18 @@ const serializeAws_restJson1EvaluateOnExitList = (input, context) => {
1883
2294
  return serializeAws_restJson1EvaluateOnExit(entry, context);
1884
2295
  });
1885
2296
  };
2297
+ const serializeAws_restJson1FairsharePolicy = (input, context) => {
2298
+ return {
2299
+ ...(input.computeReservation !== undefined &&
2300
+ input.computeReservation !== null && { computeReservation: input.computeReservation }),
2301
+ ...(input.shareDecaySeconds !== undefined &&
2302
+ input.shareDecaySeconds !== null && { shareDecaySeconds: input.shareDecaySeconds }),
2303
+ ...(input.shareDistribution !== undefined &&
2304
+ input.shareDistribution !== null && {
2305
+ shareDistribution: serializeAws_restJson1ShareAttributesList(input.shareDistribution, context),
2306
+ }),
2307
+ };
2308
+ };
1886
2309
  const serializeAws_restJson1FargatePlatformConfiguration = (input, context) => {
1887
2310
  return {
1888
2311
  ...(input.platformVersion !== undefined &&
@@ -2124,6 +2547,24 @@ const serializeAws_restJson1SecretList = (input, context) => {
2124
2547
  return serializeAws_restJson1Secret(entry, context);
2125
2548
  });
2126
2549
  };
2550
+ const serializeAws_restJson1ShareAttributes = (input, context) => {
2551
+ return {
2552
+ ...(input.shareIdentifier !== undefined &&
2553
+ input.shareIdentifier !== null && { shareIdentifier: input.shareIdentifier }),
2554
+ ...(input.weightFactor !== undefined &&
2555
+ input.weightFactor !== null && { weightFactor: smithy_client_1.serializeFloat(input.weightFactor) }),
2556
+ };
2557
+ };
2558
+ const serializeAws_restJson1ShareAttributesList = (input, context) => {
2559
+ return input
2560
+ .filter((e) => e != null)
2561
+ .map((entry) => {
2562
+ if (entry === null) {
2563
+ return null;
2564
+ }
2565
+ return serializeAws_restJson1ShareAttributes(entry, context);
2566
+ });
2567
+ };
2127
2568
  const serializeAws_restJson1StringList = (input, context) => {
2128
2569
  return input
2129
2570
  .filter((e) => e != null)
@@ -2285,6 +2726,7 @@ const deserializeAws_restJson1ComputeEnvironmentDetail = (output, context) => {
2285
2726
  ? deserializeAws_restJson1TagrisTagsMap(output.tags, context)
2286
2727
  : undefined,
2287
2728
  type: smithy_client_1.expectString(output.type),
2729
+ unmanagedvCpus: smithy_client_1.expectInt32(output.unmanagedvCpus),
2288
2730
  };
2289
2731
  };
2290
2732
  const deserializeAws_restJson1ComputeEnvironmentDetailList = (output, context) => {
@@ -2542,6 +2984,15 @@ const deserializeAws_restJson1EvaluateOnExitList = (output, context) => {
2542
2984
  return deserializeAws_restJson1EvaluateOnExit(entry, context);
2543
2985
  });
2544
2986
  };
2987
+ const deserializeAws_restJson1FairsharePolicy = (output, context) => {
2988
+ return {
2989
+ computeReservation: smithy_client_1.expectInt32(output.computeReservation),
2990
+ shareDecaySeconds: smithy_client_1.expectInt32(output.shareDecaySeconds),
2991
+ shareDistribution: output.shareDistribution !== undefined && output.shareDistribution !== null
2992
+ ? deserializeAws_restJson1ShareAttributesList(output.shareDistribution, context)
2993
+ : undefined,
2994
+ };
2995
+ };
2545
2996
  const deserializeAws_restJson1FargatePlatformConfiguration = (output, context) => {
2546
2997
  return {
2547
2998
  platformVersion: smithy_client_1.expectString(output.platformVersion),
@@ -2573,6 +3024,7 @@ const deserializeAws_restJson1JobDefinition = (output, context) => {
2573
3024
  ? deserializeAws_restJson1RetryStrategy(output.retryStrategy, context)
2574
3025
  : undefined,
2575
3026
  revision: smithy_client_1.expectInt32(output.revision),
3027
+ schedulingPriority: smithy_client_1.expectInt32(output.schedulingPriority),
2576
3028
  status: smithy_client_1.expectString(output.status),
2577
3029
  tags: output.tags !== undefined && output.tags !== null
2578
3030
  ? deserializeAws_restJson1TagrisTagsMap(output.tags, context)
@@ -2645,6 +3097,8 @@ const deserializeAws_restJson1JobDetail = (output, context) => {
2645
3097
  retryStrategy: output.retryStrategy !== undefined && output.retryStrategy !== null
2646
3098
  ? deserializeAws_restJson1RetryStrategy(output.retryStrategy, context)
2647
3099
  : undefined,
3100
+ schedulingPriority: smithy_client_1.expectInt32(output.schedulingPriority),
3101
+ shareIdentifier: smithy_client_1.expectString(output.shareIdentifier),
2648
3102
  startedAt: smithy_client_1.expectLong(output.startedAt),
2649
3103
  status: smithy_client_1.expectString(output.status),
2650
3104
  statusReason: smithy_client_1.expectString(output.statusReason),
@@ -2675,6 +3129,7 @@ const deserializeAws_restJson1JobQueueDetail = (output, context) => {
2675
3129
  jobQueueArn: smithy_client_1.expectString(output.jobQueueArn),
2676
3130
  jobQueueName: smithy_client_1.expectString(output.jobQueueName),
2677
3131
  priority: smithy_client_1.expectInt32(output.priority),
3132
+ schedulingPolicyArn: smithy_client_1.expectString(output.schedulingPolicyArn),
2678
3133
  state: smithy_client_1.expectString(output.state),
2679
3134
  status: smithy_client_1.expectString(output.status),
2680
3135
  statusReason: smithy_client_1.expectString(output.statusReason),
@@ -2903,6 +3358,43 @@ const deserializeAws_restJson1RetryStrategy = (output, context) => {
2903
3358
  : undefined,
2904
3359
  };
2905
3360
  };
3361
+ const deserializeAws_restJson1SchedulingPolicyDetail = (output, context) => {
3362
+ return {
3363
+ arn: smithy_client_1.expectString(output.arn),
3364
+ fairsharePolicy: output.fairsharePolicy !== undefined && output.fairsharePolicy !== null
3365
+ ? deserializeAws_restJson1FairsharePolicy(output.fairsharePolicy, context)
3366
+ : undefined,
3367
+ name: smithy_client_1.expectString(output.name),
3368
+ tags: output.tags !== undefined && output.tags !== null
3369
+ ? deserializeAws_restJson1TagrisTagsMap(output.tags, context)
3370
+ : undefined,
3371
+ };
3372
+ };
3373
+ const deserializeAws_restJson1SchedulingPolicyDetailList = (output, context) => {
3374
+ return (output || [])
3375
+ .filter((e) => e != null)
3376
+ .map((entry) => {
3377
+ if (entry === null) {
3378
+ return null;
3379
+ }
3380
+ return deserializeAws_restJson1SchedulingPolicyDetail(entry, context);
3381
+ });
3382
+ };
3383
+ const deserializeAws_restJson1SchedulingPolicyListingDetail = (output, context) => {
3384
+ return {
3385
+ arn: smithy_client_1.expectString(output.arn),
3386
+ };
3387
+ };
3388
+ const deserializeAws_restJson1SchedulingPolicyListingDetailList = (output, context) => {
3389
+ return (output || [])
3390
+ .filter((e) => e != null)
3391
+ .map((entry) => {
3392
+ if (entry === null) {
3393
+ return null;
3394
+ }
3395
+ return deserializeAws_restJson1SchedulingPolicyListingDetail(entry, context);
3396
+ });
3397
+ };
2906
3398
  const deserializeAws_restJson1Secret = (output, context) => {
2907
3399
  return {
2908
3400
  name: smithy_client_1.expectString(output.name),
@@ -2919,6 +3411,22 @@ const deserializeAws_restJson1SecretList = (output, context) => {
2919
3411
  return deserializeAws_restJson1Secret(entry, context);
2920
3412
  });
2921
3413
  };
3414
+ const deserializeAws_restJson1ShareAttributes = (output, context) => {
3415
+ return {
3416
+ shareIdentifier: smithy_client_1.expectString(output.shareIdentifier),
3417
+ weightFactor: smithy_client_1.limitedParseFloat32(output.weightFactor),
3418
+ };
3419
+ };
3420
+ const deserializeAws_restJson1ShareAttributesList = (output, context) => {
3421
+ return (output || [])
3422
+ .filter((e) => e != null)
3423
+ .map((entry) => {
3424
+ if (entry === null) {
3425
+ return null;
3426
+ }
3427
+ return deserializeAws_restJson1ShareAttributes(entry, context);
3428
+ });
3429
+ };
2922
3430
  const deserializeAws_restJson1StringList = (output, context) => {
2923
3431
  return (output || [])
2924
3432
  .filter((e) => e != null)