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