@aws-sdk/client-pcs 3.641.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 (171) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +366 -0
  3. package/dist-cjs/PCS.js +47 -0
  4. package/dist-cjs/PCSClient.js +50 -0
  5. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  6. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  7. package/dist-cjs/commands/CreateClusterCommand.js +28 -0
  8. package/dist-cjs/commands/CreateComputeNodeGroupCommand.js +28 -0
  9. package/dist-cjs/commands/CreateQueueCommand.js +28 -0
  10. package/dist-cjs/commands/DeleteClusterCommand.js +28 -0
  11. package/dist-cjs/commands/DeleteComputeNodeGroupCommand.js +28 -0
  12. package/dist-cjs/commands/DeleteQueueCommand.js +28 -0
  13. package/dist-cjs/commands/GetClusterCommand.js +28 -0
  14. package/dist-cjs/commands/GetComputeNodeGroupCommand.js +28 -0
  15. package/dist-cjs/commands/GetQueueCommand.js +28 -0
  16. package/dist-cjs/commands/ListClustersCommand.js +28 -0
  17. package/dist-cjs/commands/ListComputeNodeGroupsCommand.js +28 -0
  18. package/dist-cjs/commands/ListQueuesCommand.js +28 -0
  19. package/dist-cjs/commands/ListTagsForResourceCommand.js +28 -0
  20. package/dist-cjs/commands/RegisterComputeNodeGroupInstanceCommand.js +29 -0
  21. package/dist-cjs/commands/TagResourceCommand.js +28 -0
  22. package/dist-cjs/commands/UntagResourceCommand.js +28 -0
  23. package/dist-cjs/commands/UpdateComputeNodeGroupCommand.js +28 -0
  24. package/dist-cjs/commands/UpdateQueueCommand.js +28 -0
  25. package/dist-cjs/commands/index.js +21 -0
  26. package/dist-cjs/endpoint/EndpointParameters.js +18 -0
  27. package/dist-cjs/endpoint/endpointResolver.js +14 -0
  28. package/dist-cjs/endpoint/ruleset.js +7 -0
  29. package/dist-cjs/extensionConfiguration.js +2 -0
  30. package/dist-cjs/index.js +11 -0
  31. package/dist-cjs/models/PCSServiceException.js +12 -0
  32. package/dist-cjs/models/index.js +4 -0
  33. package/dist-cjs/models/models_0.js +169 -0
  34. package/dist-cjs/pagination/Interfaces.js +2 -0
  35. package/dist-cjs/pagination/ListClustersPaginator.js +7 -0
  36. package/dist-cjs/pagination/ListComputeNodeGroupsPaginator.js +7 -0
  37. package/dist-cjs/pagination/ListQueuesPaginator.js +7 -0
  38. package/dist-cjs/pagination/index.js +7 -0
  39. package/dist-cjs/protocols/Aws_json1_0.js +757 -0
  40. package/dist-cjs/runtimeConfig.browser.js +39 -0
  41. package/dist-cjs/runtimeConfig.js +49 -0
  42. package/dist-cjs/runtimeConfig.native.js +15 -0
  43. package/dist-cjs/runtimeConfig.shared.js +34 -0
  44. package/dist-cjs/runtimeExtensions.js +25 -0
  45. package/dist-es/PCS.js +43 -0
  46. package/dist-es/PCSClient.js +46 -0
  47. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  48. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  49. package/dist-es/commands/CreateClusterCommand.js +24 -0
  50. package/dist-es/commands/CreateComputeNodeGroupCommand.js +24 -0
  51. package/dist-es/commands/CreateQueueCommand.js +24 -0
  52. package/dist-es/commands/DeleteClusterCommand.js +24 -0
  53. package/dist-es/commands/DeleteComputeNodeGroupCommand.js +24 -0
  54. package/dist-es/commands/DeleteQueueCommand.js +24 -0
  55. package/dist-es/commands/GetClusterCommand.js +24 -0
  56. package/dist-es/commands/GetComputeNodeGroupCommand.js +24 -0
  57. package/dist-es/commands/GetQueueCommand.js +24 -0
  58. package/dist-es/commands/ListClustersCommand.js +24 -0
  59. package/dist-es/commands/ListComputeNodeGroupsCommand.js +24 -0
  60. package/dist-es/commands/ListQueuesCommand.js +24 -0
  61. package/dist-es/commands/ListTagsForResourceCommand.js +24 -0
  62. package/dist-es/commands/RegisterComputeNodeGroupInstanceCommand.js +25 -0
  63. package/dist-es/commands/TagResourceCommand.js +24 -0
  64. package/dist-es/commands/UntagResourceCommand.js +24 -0
  65. package/dist-es/commands/UpdateComputeNodeGroupCommand.js +24 -0
  66. package/dist-es/commands/UpdateQueueCommand.js +24 -0
  67. package/dist-es/commands/index.js +18 -0
  68. package/dist-es/endpoint/EndpointParameters.js +14 -0
  69. package/dist-es/endpoint/endpointResolver.js +10 -0
  70. package/dist-es/endpoint/ruleset.js +4 -0
  71. package/dist-es/extensionConfiguration.js +1 -0
  72. package/dist-es/index.js +6 -0
  73. package/dist-es/models/PCSServiceException.js +8 -0
  74. package/dist-es/models/index.js +1 -0
  75. package/dist-es/models/models_0.js +158 -0
  76. package/dist-es/pagination/Interfaces.js +1 -0
  77. package/dist-es/pagination/ListClustersPaginator.js +4 -0
  78. package/dist-es/pagination/ListComputeNodeGroupsPaginator.js +4 -0
  79. package/dist-es/pagination/ListQueuesPaginator.js +4 -0
  80. package/dist-es/pagination/index.js +4 -0
  81. package/dist-es/protocols/Aws_json1_0.js +718 -0
  82. package/dist-es/runtimeConfig.browser.js +34 -0
  83. package/dist-es/runtimeConfig.js +44 -0
  84. package/dist-es/runtimeConfig.native.js +11 -0
  85. package/dist-es/runtimeConfig.shared.js +30 -0
  86. package/dist-es/runtimeExtensions.js +21 -0
  87. package/dist-types/PCS.d.ts +154 -0
  88. package/dist-types/PCSClient.d.ts +204 -0
  89. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  90. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  91. package/dist-types/commands/CreateClusterCommand.d.ts +237 -0
  92. package/dist-types/commands/CreateComputeNodeGroupCommand.d.ts +247 -0
  93. package/dist-types/commands/CreateQueueCommand.d.ts +190 -0
  94. package/dist-types/commands/DeleteClusterCommand.d.ts +137 -0
  95. package/dist-types/commands/DeleteComputeNodeGroupCommand.d.ts +138 -0
  96. package/dist-types/commands/DeleteQueueCommand.d.ts +139 -0
  97. package/dist-types/commands/GetClusterCommand.d.ts +186 -0
  98. package/dist-types/commands/GetComputeNodeGroupCommand.d.ts +184 -0
  99. package/dist-types/commands/GetQueueCommand.d.ts +158 -0
  100. package/dist-types/commands/ListClustersCommand.d.ts +148 -0
  101. package/dist-types/commands/ListComputeNodeGroupsCommand.d.ts +150 -0
  102. package/dist-types/commands/ListQueuesCommand.d.ts +150 -0
  103. package/dist-types/commands/ListTagsForResourceCommand.d.ts +69 -0
  104. package/dist-types/commands/RegisterComputeNodeGroupInstanceCommand.d.ts +97 -0
  105. package/dist-types/commands/TagResourceCommand.d.ts +71 -0
  106. package/dist-types/commands/UntagResourceCommand.d.ts +69 -0
  107. package/dist-types/commands/UpdateComputeNodeGroupCommand.d.ts +233 -0
  108. package/dist-types/commands/UpdateQueueCommand.d.ts +187 -0
  109. package/dist-types/commands/index.d.ts +18 -0
  110. package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
  111. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  112. package/dist-types/endpoint/ruleset.d.ts +2 -0
  113. package/dist-types/extensionConfiguration.d.ts +9 -0
  114. package/dist-types/index.d.ts +31 -0
  115. package/dist-types/models/PCSServiceException.d.ts +14 -0
  116. package/dist-types/models/index.d.ts +1 -0
  117. package/dist-types/models/models_0.d.ts +1871 -0
  118. package/dist-types/pagination/Interfaces.d.ts +8 -0
  119. package/dist-types/pagination/ListClustersPaginator.d.ts +7 -0
  120. package/dist-types/pagination/ListComputeNodeGroupsPaginator.d.ts +7 -0
  121. package/dist-types/pagination/ListQueuesPaginator.d.ts +7 -0
  122. package/dist-types/pagination/index.d.ts +4 -0
  123. package/dist-types/protocols/Aws_json1_0.d.ts +164 -0
  124. package/dist-types/runtimeConfig.browser.d.ts +45 -0
  125. package/dist-types/runtimeConfig.d.ts +45 -0
  126. package/dist-types/runtimeConfig.native.d.ts +44 -0
  127. package/dist-types/runtimeConfig.shared.d.ts +21 -0
  128. package/dist-types/runtimeExtensions.d.ts +17 -0
  129. package/dist-types/ts3.4/PCS.d.ts +312 -0
  130. package/dist-types/ts3.4/PCSClient.d.ts +223 -0
  131. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  132. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +43 -0
  133. package/dist-types/ts3.4/commands/CreateClusterCommand.d.ts +39 -0
  134. package/dist-types/ts3.4/commands/CreateComputeNodeGroupCommand.d.ts +40 -0
  135. package/dist-types/ts3.4/commands/CreateQueueCommand.d.ts +36 -0
  136. package/dist-types/ts3.4/commands/DeleteClusterCommand.d.ts +39 -0
  137. package/dist-types/ts3.4/commands/DeleteComputeNodeGroupCommand.d.ts +40 -0
  138. package/dist-types/ts3.4/commands/DeleteQueueCommand.d.ts +36 -0
  139. package/dist-types/ts3.4/commands/GetClusterCommand.d.ts +36 -0
  140. package/dist-types/ts3.4/commands/GetComputeNodeGroupCommand.d.ts +40 -0
  141. package/dist-types/ts3.4/commands/GetQueueCommand.d.ts +36 -0
  142. package/dist-types/ts3.4/commands/ListClustersCommand.d.ts +36 -0
  143. package/dist-types/ts3.4/commands/ListComputeNodeGroupsCommand.d.ts +40 -0
  144. package/dist-types/ts3.4/commands/ListQueuesCommand.d.ts +36 -0
  145. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +40 -0
  146. package/dist-types/ts3.4/commands/RegisterComputeNodeGroupInstanceCommand.d.ts +40 -0
  147. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  148. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +34 -0
  149. package/dist-types/ts3.4/commands/UpdateComputeNodeGroupCommand.d.ts +40 -0
  150. package/dist-types/ts3.4/commands/UpdateQueueCommand.d.ts +36 -0
  151. package/dist-types/ts3.4/commands/index.d.ts +18 -0
  152. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  153. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  154. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  155. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  156. package/dist-types/ts3.4/index.d.ts +9 -0
  157. package/dist-types/ts3.4/models/PCSServiceException.d.ts +9 -0
  158. package/dist-types/ts3.4/models/index.d.ts +1 -0
  159. package/dist-types/ts3.4/models/models_0.d.ts +431 -0
  160. package/dist-types/ts3.4/pagination/Interfaces.d.ts +5 -0
  161. package/dist-types/ts3.4/pagination/ListClustersPaginator.d.ts +11 -0
  162. package/dist-types/ts3.4/pagination/ListComputeNodeGroupsPaginator.d.ts +11 -0
  163. package/dist-types/ts3.4/pagination/ListQueuesPaginator.d.ts +11 -0
  164. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  165. package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +221 -0
  166. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +85 -0
  167. package/dist-types/ts3.4/runtimeConfig.d.ts +89 -0
  168. package/dist-types/ts3.4/runtimeConfig.native.d.ts +79 -0
  169. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
  170. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  171. package/package.json +103 -0
@@ -0,0 +1,718 @@
1
+ import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
+ import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
4
+ import { v4 as generateIdempotencyToken } from "uuid";
5
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
+ import { PCSServiceException as __BaseException } from "../models/PCSServiceException";
7
+ export const se_CreateClusterCommand = async (input, context) => {
8
+ const headers = sharedHeaders("CreateCluster");
9
+ let body;
10
+ body = JSON.stringify(se_CreateClusterRequest(input, context));
11
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
12
+ };
13
+ export const se_CreateComputeNodeGroupCommand = async (input, context) => {
14
+ const headers = sharedHeaders("CreateComputeNodeGroup");
15
+ let body;
16
+ body = JSON.stringify(se_CreateComputeNodeGroupRequest(input, context));
17
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
18
+ };
19
+ export const se_CreateQueueCommand = async (input, context) => {
20
+ const headers = sharedHeaders("CreateQueue");
21
+ let body;
22
+ body = JSON.stringify(se_CreateQueueRequest(input, context));
23
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
24
+ };
25
+ export const se_DeleteClusterCommand = async (input, context) => {
26
+ const headers = sharedHeaders("DeleteCluster");
27
+ let body;
28
+ body = JSON.stringify(se_DeleteClusterRequest(input, context));
29
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
30
+ };
31
+ export const se_DeleteComputeNodeGroupCommand = async (input, context) => {
32
+ const headers = sharedHeaders("DeleteComputeNodeGroup");
33
+ let body;
34
+ body = JSON.stringify(se_DeleteComputeNodeGroupRequest(input, context));
35
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
+ };
37
+ export const se_DeleteQueueCommand = async (input, context) => {
38
+ const headers = sharedHeaders("DeleteQueue");
39
+ let body;
40
+ body = JSON.stringify(se_DeleteQueueRequest(input, context));
41
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
+ };
43
+ export const se_GetClusterCommand = async (input, context) => {
44
+ const headers = sharedHeaders("GetCluster");
45
+ let body;
46
+ body = JSON.stringify(_json(input));
47
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
+ };
49
+ export const se_GetComputeNodeGroupCommand = async (input, context) => {
50
+ const headers = sharedHeaders("GetComputeNodeGroup");
51
+ let body;
52
+ body = JSON.stringify(_json(input));
53
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
54
+ };
55
+ export const se_GetQueueCommand = async (input, context) => {
56
+ const headers = sharedHeaders("GetQueue");
57
+ let body;
58
+ body = JSON.stringify(_json(input));
59
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
60
+ };
61
+ export const se_ListClustersCommand = async (input, context) => {
62
+ const headers = sharedHeaders("ListClusters");
63
+ let body;
64
+ body = JSON.stringify(_json(input));
65
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
66
+ };
67
+ export const se_ListComputeNodeGroupsCommand = async (input, context) => {
68
+ const headers = sharedHeaders("ListComputeNodeGroups");
69
+ let body;
70
+ body = JSON.stringify(_json(input));
71
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
72
+ };
73
+ export const se_ListQueuesCommand = async (input, context) => {
74
+ const headers = sharedHeaders("ListQueues");
75
+ let body;
76
+ body = JSON.stringify(_json(input));
77
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
78
+ };
79
+ export const se_ListTagsForResourceCommand = async (input, context) => {
80
+ const headers = sharedHeaders("ListTagsForResource");
81
+ let body;
82
+ body = JSON.stringify(_json(input));
83
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
+ };
85
+ export const se_RegisterComputeNodeGroupInstanceCommand = async (input, context) => {
86
+ const headers = sharedHeaders("RegisterComputeNodeGroupInstance");
87
+ let body;
88
+ body = JSON.stringify(_json(input));
89
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
+ };
91
+ export const se_TagResourceCommand = async (input, context) => {
92
+ const headers = sharedHeaders("TagResource");
93
+ let body;
94
+ body = JSON.stringify(_json(input));
95
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
96
+ };
97
+ export const se_UntagResourceCommand = async (input, context) => {
98
+ const headers = sharedHeaders("UntagResource");
99
+ let body;
100
+ body = JSON.stringify(_json(input));
101
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
102
+ };
103
+ export const se_UpdateComputeNodeGroupCommand = async (input, context) => {
104
+ const headers = sharedHeaders("UpdateComputeNodeGroup");
105
+ let body;
106
+ body = JSON.stringify(se_UpdateComputeNodeGroupRequest(input, context));
107
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
108
+ };
109
+ export const se_UpdateQueueCommand = async (input, context) => {
110
+ const headers = sharedHeaders("UpdateQueue");
111
+ let body;
112
+ body = JSON.stringify(se_UpdateQueueRequest(input, context));
113
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
114
+ };
115
+ export const de_CreateClusterCommand = async (output, context) => {
116
+ if (output.statusCode >= 300) {
117
+ return de_CommandError(output, context);
118
+ }
119
+ const data = await parseBody(output.body, context);
120
+ let contents = {};
121
+ contents = de_CreateClusterResponse(data, context);
122
+ const response = {
123
+ $metadata: deserializeMetadata(output),
124
+ ...contents,
125
+ };
126
+ return response;
127
+ };
128
+ export const de_CreateComputeNodeGroupCommand = async (output, context) => {
129
+ if (output.statusCode >= 300) {
130
+ return de_CommandError(output, context);
131
+ }
132
+ const data = await parseBody(output.body, context);
133
+ let contents = {};
134
+ contents = de_CreateComputeNodeGroupResponse(data, context);
135
+ const response = {
136
+ $metadata: deserializeMetadata(output),
137
+ ...contents,
138
+ };
139
+ return response;
140
+ };
141
+ export const de_CreateQueueCommand = async (output, context) => {
142
+ if (output.statusCode >= 300) {
143
+ return de_CommandError(output, context);
144
+ }
145
+ const data = await parseBody(output.body, context);
146
+ let contents = {};
147
+ contents = de_CreateQueueResponse(data, context);
148
+ const response = {
149
+ $metadata: deserializeMetadata(output),
150
+ ...contents,
151
+ };
152
+ return response;
153
+ };
154
+ export const de_DeleteClusterCommand = async (output, context) => {
155
+ if (output.statusCode >= 300) {
156
+ return de_CommandError(output, context);
157
+ }
158
+ const data = await parseBody(output.body, context);
159
+ let contents = {};
160
+ contents = _json(data);
161
+ const response = {
162
+ $metadata: deserializeMetadata(output),
163
+ ...contents,
164
+ };
165
+ return response;
166
+ };
167
+ export const de_DeleteComputeNodeGroupCommand = async (output, context) => {
168
+ if (output.statusCode >= 300) {
169
+ return de_CommandError(output, context);
170
+ }
171
+ const data = await parseBody(output.body, context);
172
+ let contents = {};
173
+ contents = _json(data);
174
+ const response = {
175
+ $metadata: deserializeMetadata(output),
176
+ ...contents,
177
+ };
178
+ return response;
179
+ };
180
+ export const de_DeleteQueueCommand = async (output, context) => {
181
+ if (output.statusCode >= 300) {
182
+ return de_CommandError(output, context);
183
+ }
184
+ const data = await parseBody(output.body, context);
185
+ let contents = {};
186
+ contents = _json(data);
187
+ const response = {
188
+ $metadata: deserializeMetadata(output),
189
+ ...contents,
190
+ };
191
+ return response;
192
+ };
193
+ export const de_GetClusterCommand = async (output, context) => {
194
+ if (output.statusCode >= 300) {
195
+ return de_CommandError(output, context);
196
+ }
197
+ const data = await parseBody(output.body, context);
198
+ let contents = {};
199
+ contents = de_GetClusterResponse(data, context);
200
+ const response = {
201
+ $metadata: deserializeMetadata(output),
202
+ ...contents,
203
+ };
204
+ return response;
205
+ };
206
+ export const de_GetComputeNodeGroupCommand = async (output, context) => {
207
+ if (output.statusCode >= 300) {
208
+ return de_CommandError(output, context);
209
+ }
210
+ const data = await parseBody(output.body, context);
211
+ let contents = {};
212
+ contents = de_GetComputeNodeGroupResponse(data, context);
213
+ const response = {
214
+ $metadata: deserializeMetadata(output),
215
+ ...contents,
216
+ };
217
+ return response;
218
+ };
219
+ export const de_GetQueueCommand = async (output, context) => {
220
+ if (output.statusCode >= 300) {
221
+ return de_CommandError(output, context);
222
+ }
223
+ const data = await parseBody(output.body, context);
224
+ let contents = {};
225
+ contents = de_GetQueueResponse(data, context);
226
+ const response = {
227
+ $metadata: deserializeMetadata(output),
228
+ ...contents,
229
+ };
230
+ return response;
231
+ };
232
+ export const de_ListClustersCommand = async (output, context) => {
233
+ if (output.statusCode >= 300) {
234
+ return de_CommandError(output, context);
235
+ }
236
+ const data = await parseBody(output.body, context);
237
+ let contents = {};
238
+ contents = de_ListClustersResponse(data, context);
239
+ const response = {
240
+ $metadata: deserializeMetadata(output),
241
+ ...contents,
242
+ };
243
+ return response;
244
+ };
245
+ export const de_ListComputeNodeGroupsCommand = async (output, context) => {
246
+ if (output.statusCode >= 300) {
247
+ return de_CommandError(output, context);
248
+ }
249
+ const data = await parseBody(output.body, context);
250
+ let contents = {};
251
+ contents = de_ListComputeNodeGroupsResponse(data, context);
252
+ const response = {
253
+ $metadata: deserializeMetadata(output),
254
+ ...contents,
255
+ };
256
+ return response;
257
+ };
258
+ export const de_ListQueuesCommand = async (output, context) => {
259
+ if (output.statusCode >= 300) {
260
+ return de_CommandError(output, context);
261
+ }
262
+ const data = await parseBody(output.body, context);
263
+ let contents = {};
264
+ contents = de_ListQueuesResponse(data, context);
265
+ const response = {
266
+ $metadata: deserializeMetadata(output),
267
+ ...contents,
268
+ };
269
+ return response;
270
+ };
271
+ export const de_ListTagsForResourceCommand = async (output, context) => {
272
+ if (output.statusCode >= 300) {
273
+ return de_CommandError(output, context);
274
+ }
275
+ const data = await parseBody(output.body, context);
276
+ let contents = {};
277
+ contents = _json(data);
278
+ const response = {
279
+ $metadata: deserializeMetadata(output),
280
+ ...contents,
281
+ };
282
+ return response;
283
+ };
284
+ export const de_RegisterComputeNodeGroupInstanceCommand = async (output, context) => {
285
+ if (output.statusCode >= 300) {
286
+ return de_CommandError(output, context);
287
+ }
288
+ const data = await parseBody(output.body, context);
289
+ let contents = {};
290
+ contents = _json(data);
291
+ const response = {
292
+ $metadata: deserializeMetadata(output),
293
+ ...contents,
294
+ };
295
+ return response;
296
+ };
297
+ export const de_TagResourceCommand = async (output, context) => {
298
+ if (output.statusCode >= 300) {
299
+ return de_CommandError(output, context);
300
+ }
301
+ await collectBody(output.body, context);
302
+ const response = {
303
+ $metadata: deserializeMetadata(output),
304
+ };
305
+ return response;
306
+ };
307
+ export const de_UntagResourceCommand = async (output, context) => {
308
+ if (output.statusCode >= 300) {
309
+ return de_CommandError(output, context);
310
+ }
311
+ await collectBody(output.body, context);
312
+ const response = {
313
+ $metadata: deserializeMetadata(output),
314
+ };
315
+ return response;
316
+ };
317
+ export const de_UpdateComputeNodeGroupCommand = async (output, context) => {
318
+ if (output.statusCode >= 300) {
319
+ return de_CommandError(output, context);
320
+ }
321
+ const data = await parseBody(output.body, context);
322
+ let contents = {};
323
+ contents = de_UpdateComputeNodeGroupResponse(data, context);
324
+ const response = {
325
+ $metadata: deserializeMetadata(output),
326
+ ...contents,
327
+ };
328
+ return response;
329
+ };
330
+ export const de_UpdateQueueCommand = async (output, context) => {
331
+ if (output.statusCode >= 300) {
332
+ return de_CommandError(output, context);
333
+ }
334
+ const data = await parseBody(output.body, context);
335
+ let contents = {};
336
+ contents = de_UpdateQueueResponse(data, context);
337
+ const response = {
338
+ $metadata: deserializeMetadata(output),
339
+ ...contents,
340
+ };
341
+ return response;
342
+ };
343
+ const de_CommandError = async (output, context) => {
344
+ const parsedOutput = {
345
+ ...output,
346
+ body: await parseErrorBody(output.body, context),
347
+ };
348
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
349
+ switch (errorCode) {
350
+ case "AccessDeniedException":
351
+ case "com.amazonaws.pcs#AccessDeniedException":
352
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
353
+ case "ConflictException":
354
+ case "com.amazonaws.pcs#ConflictException":
355
+ throw await de_ConflictExceptionRes(parsedOutput, context);
356
+ case "InternalServerException":
357
+ case "com.amazonaws.pcs#InternalServerException":
358
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
359
+ case "ServiceQuotaExceededException":
360
+ case "com.amazonaws.pcs#ServiceQuotaExceededException":
361
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
362
+ case "ThrottlingException":
363
+ case "com.amazonaws.pcs#ThrottlingException":
364
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
365
+ case "ValidationException":
366
+ case "com.amazonaws.pcs#ValidationException":
367
+ throw await de_ValidationExceptionRes(parsedOutput, context);
368
+ case "ResourceNotFoundException":
369
+ case "com.amazonaws.pcs#ResourceNotFoundException":
370
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
371
+ default:
372
+ const parsedBody = parsedOutput.body;
373
+ return throwDefaultError({
374
+ output,
375
+ parsedBody,
376
+ errorCode,
377
+ });
378
+ }
379
+ };
380
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
381
+ const body = parsedOutput.body;
382
+ const deserialized = _json(body);
383
+ const exception = new AccessDeniedException({
384
+ $metadata: deserializeMetadata(parsedOutput),
385
+ ...deserialized,
386
+ });
387
+ return __decorateServiceException(exception, body);
388
+ };
389
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
390
+ const body = parsedOutput.body;
391
+ const deserialized = _json(body);
392
+ const exception = new ConflictException({
393
+ $metadata: deserializeMetadata(parsedOutput),
394
+ ...deserialized,
395
+ });
396
+ return __decorateServiceException(exception, body);
397
+ };
398
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
399
+ const body = parsedOutput.body;
400
+ const deserialized = _json(body);
401
+ const exception = new InternalServerException({
402
+ $metadata: deserializeMetadata(parsedOutput),
403
+ ...deserialized,
404
+ });
405
+ return __decorateServiceException(exception, body);
406
+ };
407
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
408
+ const body = parsedOutput.body;
409
+ const deserialized = _json(body);
410
+ const exception = new ResourceNotFoundException({
411
+ $metadata: deserializeMetadata(parsedOutput),
412
+ ...deserialized,
413
+ });
414
+ return __decorateServiceException(exception, body);
415
+ };
416
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
417
+ const body = parsedOutput.body;
418
+ const deserialized = _json(body);
419
+ const exception = new ServiceQuotaExceededException({
420
+ $metadata: deserializeMetadata(parsedOutput),
421
+ ...deserialized,
422
+ });
423
+ return __decorateServiceException(exception, body);
424
+ };
425
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
426
+ const body = parsedOutput.body;
427
+ const deserialized = _json(body);
428
+ const exception = new ThrottlingException({
429
+ $metadata: deserializeMetadata(parsedOutput),
430
+ ...deserialized,
431
+ });
432
+ return __decorateServiceException(exception, body);
433
+ };
434
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
435
+ const body = parsedOutput.body;
436
+ const deserialized = _json(body);
437
+ const exception = new ValidationException({
438
+ $metadata: deserializeMetadata(parsedOutput),
439
+ ...deserialized,
440
+ });
441
+ return __decorateServiceException(exception, body);
442
+ };
443
+ const se_CreateClusterRequest = (input, context) => {
444
+ return take(input, {
445
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
446
+ clusterName: [],
447
+ networking: _json,
448
+ scheduler: _json,
449
+ size: [],
450
+ slurmConfiguration: _json,
451
+ tags: _json,
452
+ });
453
+ };
454
+ const se_CreateComputeNodeGroupRequest = (input, context) => {
455
+ return take(input, {
456
+ amiId: [],
457
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
458
+ clusterIdentifier: [],
459
+ computeNodeGroupName: [],
460
+ customLaunchTemplate: _json,
461
+ iamInstanceProfileArn: [],
462
+ instanceConfigs: _json,
463
+ purchaseOption: [],
464
+ scalingConfiguration: _json,
465
+ slurmConfiguration: _json,
466
+ spotOptions: _json,
467
+ subnetIds: _json,
468
+ tags: _json,
469
+ });
470
+ };
471
+ const se_CreateQueueRequest = (input, context) => {
472
+ return take(input, {
473
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
474
+ clusterIdentifier: [],
475
+ computeNodeGroupConfigurations: _json,
476
+ queueName: [],
477
+ tags: _json,
478
+ });
479
+ };
480
+ const se_DeleteClusterRequest = (input, context) => {
481
+ return take(input, {
482
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
483
+ clusterIdentifier: [],
484
+ });
485
+ };
486
+ const se_DeleteComputeNodeGroupRequest = (input, context) => {
487
+ return take(input, {
488
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
489
+ clusterIdentifier: [],
490
+ computeNodeGroupIdentifier: [],
491
+ });
492
+ };
493
+ const se_DeleteQueueRequest = (input, context) => {
494
+ return take(input, {
495
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
496
+ clusterIdentifier: [],
497
+ queueIdentifier: [],
498
+ });
499
+ };
500
+ const se_UpdateComputeNodeGroupRequest = (input, context) => {
501
+ return take(input, {
502
+ amiId: [],
503
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
504
+ clusterIdentifier: [],
505
+ computeNodeGroupIdentifier: [],
506
+ customLaunchTemplate: _json,
507
+ iamInstanceProfileArn: [],
508
+ purchaseOption: [],
509
+ scalingConfiguration: _json,
510
+ slurmConfiguration: _json,
511
+ spotOptions: _json,
512
+ subnetIds: _json,
513
+ });
514
+ };
515
+ const se_UpdateQueueRequest = (input, context) => {
516
+ return take(input, {
517
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
518
+ clusterIdentifier: [],
519
+ computeNodeGroupConfigurations: _json,
520
+ queueIdentifier: [],
521
+ });
522
+ };
523
+ const de_Cluster = (output, context) => {
524
+ return take(output, {
525
+ arn: __expectString,
526
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
527
+ endpoints: _json,
528
+ errorInfo: _json,
529
+ id: __expectString,
530
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
531
+ name: __expectString,
532
+ networking: _json,
533
+ scheduler: _json,
534
+ size: __expectString,
535
+ slurmConfiguration: _json,
536
+ status: __expectString,
537
+ });
538
+ };
539
+ const de_ClusterList = (output, context) => {
540
+ const retVal = (output || [])
541
+ .filter((e) => e != null)
542
+ .map((entry) => {
543
+ return de_ClusterSummary(entry, context);
544
+ });
545
+ return retVal;
546
+ };
547
+ const de_ClusterSummary = (output, context) => {
548
+ return take(output, {
549
+ arn: __expectString,
550
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
551
+ id: __expectString,
552
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
553
+ name: __expectString,
554
+ status: __expectString,
555
+ });
556
+ };
557
+ const de_ComputeNodeGroup = (output, context) => {
558
+ return take(output, {
559
+ amiId: __expectString,
560
+ arn: __expectString,
561
+ clusterId: __expectString,
562
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
563
+ customLaunchTemplate: _json,
564
+ errorInfo: _json,
565
+ iamInstanceProfileArn: __expectString,
566
+ id: __expectString,
567
+ instanceConfigs: _json,
568
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
569
+ name: __expectString,
570
+ purchaseOption: __expectString,
571
+ scalingConfiguration: _json,
572
+ slurmConfiguration: _json,
573
+ spotOptions: _json,
574
+ status: __expectString,
575
+ subnetIds: _json,
576
+ });
577
+ };
578
+ const de_ComputeNodeGroupList = (output, context) => {
579
+ const retVal = (output || [])
580
+ .filter((e) => e != null)
581
+ .map((entry) => {
582
+ return de_ComputeNodeGroupSummary(entry, context);
583
+ });
584
+ return retVal;
585
+ };
586
+ const de_ComputeNodeGroupSummary = (output, context) => {
587
+ return take(output, {
588
+ arn: __expectString,
589
+ clusterId: __expectString,
590
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
591
+ id: __expectString,
592
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
593
+ name: __expectString,
594
+ status: __expectString,
595
+ });
596
+ };
597
+ const de_CreateClusterResponse = (output, context) => {
598
+ return take(output, {
599
+ cluster: (_) => de_Cluster(_, context),
600
+ });
601
+ };
602
+ const de_CreateComputeNodeGroupResponse = (output, context) => {
603
+ return take(output, {
604
+ computeNodeGroup: (_) => de_ComputeNodeGroup(_, context),
605
+ });
606
+ };
607
+ const de_CreateQueueResponse = (output, context) => {
608
+ return take(output, {
609
+ queue: (_) => de_Queue(_, context),
610
+ });
611
+ };
612
+ const de_GetClusterResponse = (output, context) => {
613
+ return take(output, {
614
+ cluster: (_) => de_Cluster(_, context),
615
+ });
616
+ };
617
+ const de_GetComputeNodeGroupResponse = (output, context) => {
618
+ return take(output, {
619
+ computeNodeGroup: (_) => de_ComputeNodeGroup(_, context),
620
+ });
621
+ };
622
+ const de_GetQueueResponse = (output, context) => {
623
+ return take(output, {
624
+ queue: (_) => de_Queue(_, context),
625
+ });
626
+ };
627
+ const de_ListClustersResponse = (output, context) => {
628
+ return take(output, {
629
+ clusters: (_) => de_ClusterList(_, context),
630
+ nextToken: __expectString,
631
+ });
632
+ };
633
+ const de_ListComputeNodeGroupsResponse = (output, context) => {
634
+ return take(output, {
635
+ computeNodeGroups: (_) => de_ComputeNodeGroupList(_, context),
636
+ nextToken: __expectString,
637
+ });
638
+ };
639
+ const de_ListQueuesResponse = (output, context) => {
640
+ return take(output, {
641
+ nextToken: __expectString,
642
+ queues: (_) => de_QueueList(_, context),
643
+ });
644
+ };
645
+ const de_Queue = (output, context) => {
646
+ return take(output, {
647
+ arn: __expectString,
648
+ clusterId: __expectString,
649
+ computeNodeGroupConfigurations: _json,
650
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
651
+ errorInfo: _json,
652
+ id: __expectString,
653
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
654
+ name: __expectString,
655
+ status: __expectString,
656
+ });
657
+ };
658
+ const de_QueueList = (output, context) => {
659
+ const retVal = (output || [])
660
+ .filter((e) => e != null)
661
+ .map((entry) => {
662
+ return de_QueueSummary(entry, context);
663
+ });
664
+ return retVal;
665
+ };
666
+ const de_QueueSummary = (output, context) => {
667
+ return take(output, {
668
+ arn: __expectString,
669
+ clusterId: __expectString,
670
+ createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
671
+ id: __expectString,
672
+ modifiedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
673
+ name: __expectString,
674
+ status: __expectString,
675
+ });
676
+ };
677
+ const de_UpdateComputeNodeGroupResponse = (output, context) => {
678
+ return take(output, {
679
+ computeNodeGroup: (_) => de_ComputeNodeGroup(_, context),
680
+ });
681
+ };
682
+ const de_UpdateQueueResponse = (output, context) => {
683
+ return take(output, {
684
+ queue: (_) => de_Queue(_, context),
685
+ });
686
+ };
687
+ const deserializeMetadata = (output) => ({
688
+ httpStatusCode: output.statusCode,
689
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
690
+ extendedRequestId: output.headers["x-amz-id-2"],
691
+ cfId: output.headers["x-amz-cf-id"],
692
+ });
693
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
694
+ const throwDefaultError = withBaseException(__BaseException);
695
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
696
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
697
+ const contents = {
698
+ protocol,
699
+ hostname,
700
+ port,
701
+ method: "POST",
702
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
703
+ headers,
704
+ };
705
+ if (resolvedHostname !== undefined) {
706
+ contents.hostname = resolvedHostname;
707
+ }
708
+ if (body !== undefined) {
709
+ contents.body = body;
710
+ }
711
+ return new __HttpRequest(contents);
712
+ };
713
+ function sharedHeaders(operation) {
714
+ return {
715
+ "content-type": "application/x-amz-json-1.0",
716
+ "x-amz-target": `AWSParallelComputingService.${operation}`,
717
+ };
718
+ }