@aws-sdk/client-efs 3.35.0 → 3.36.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 (221) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist-cjs/EFS.js +0 -1
  3. package/dist-cjs/EFSClient.js +0 -1
  4. package/dist-cjs/commands/CreateAccessPointCommand.js +0 -1
  5. package/dist-cjs/commands/CreateFileSystemCommand.js +0 -1
  6. package/dist-cjs/commands/CreateMountTargetCommand.js +0 -1
  7. package/dist-cjs/commands/CreateTagsCommand.js +0 -1
  8. package/dist-cjs/commands/DeleteAccessPointCommand.js +0 -1
  9. package/dist-cjs/commands/DeleteFileSystemCommand.js +0 -1
  10. package/dist-cjs/commands/DeleteFileSystemPolicyCommand.js +0 -1
  11. package/dist-cjs/commands/DeleteMountTargetCommand.js +0 -1
  12. package/dist-cjs/commands/DeleteTagsCommand.js +0 -1
  13. package/dist-cjs/commands/DescribeAccessPointsCommand.js +0 -1
  14. package/dist-cjs/commands/DescribeAccountPreferencesCommand.js +0 -1
  15. package/dist-cjs/commands/DescribeBackupPolicyCommand.js +0 -1
  16. package/dist-cjs/commands/DescribeFileSystemPolicyCommand.js +0 -1
  17. package/dist-cjs/commands/DescribeFileSystemsCommand.js +0 -1
  18. package/dist-cjs/commands/DescribeLifecycleConfigurationCommand.js +0 -1
  19. package/dist-cjs/commands/DescribeMountTargetSecurityGroupsCommand.js +0 -1
  20. package/dist-cjs/commands/DescribeMountTargetsCommand.js +0 -1
  21. package/dist-cjs/commands/DescribeTagsCommand.js +0 -1
  22. package/dist-cjs/commands/ListTagsForResourceCommand.js +0 -1
  23. package/dist-cjs/commands/ModifyMountTargetSecurityGroupsCommand.js +0 -1
  24. package/dist-cjs/commands/PutAccountPreferencesCommand.js +0 -1
  25. package/dist-cjs/commands/PutBackupPolicyCommand.js +0 -1
  26. package/dist-cjs/commands/PutFileSystemPolicyCommand.js +0 -1
  27. package/dist-cjs/commands/PutLifecycleConfigurationCommand.js +0 -1
  28. package/dist-cjs/commands/TagResourceCommand.js +0 -1
  29. package/dist-cjs/commands/UntagResourceCommand.js +0 -1
  30. package/dist-cjs/commands/UpdateFileSystemCommand.js +0 -1
  31. package/dist-cjs/endpoints.js +0 -1
  32. package/dist-cjs/index.js +0 -1
  33. package/dist-cjs/models/index.js +0 -1
  34. package/dist-cjs/models/models_0.js +0 -1
  35. package/dist-cjs/pagination/DescribeAccessPointsPaginator.js +0 -1
  36. package/dist-cjs/pagination/DescribeFileSystemsPaginator.js +0 -1
  37. package/dist-cjs/pagination/DescribeTagsPaginator.js +0 -1
  38. package/dist-cjs/pagination/Interfaces.js +0 -1
  39. package/dist-cjs/pagination/ListTagsForResourcePaginator.js +0 -1
  40. package/dist-cjs/protocols/Aws_restJson1.js +8 -1
  41. package/dist-cjs/runtimeConfig.browser.js +2 -3
  42. package/dist-cjs/runtimeConfig.js +3 -4
  43. package/dist-cjs/runtimeConfig.native.js +0 -1
  44. package/dist-cjs/runtimeConfig.shared.js +0 -1
  45. package/dist-es/EFS.js +0 -1
  46. package/dist-es/EFSClient.js +0 -1
  47. package/dist-es/commands/CreateAccessPointCommand.js +0 -1
  48. package/dist-es/commands/CreateFileSystemCommand.js +0 -1
  49. package/dist-es/commands/CreateMountTargetCommand.js +0 -1
  50. package/dist-es/commands/CreateTagsCommand.js +0 -1
  51. package/dist-es/commands/DeleteAccessPointCommand.js +0 -1
  52. package/dist-es/commands/DeleteFileSystemCommand.js +0 -1
  53. package/dist-es/commands/DeleteFileSystemPolicyCommand.js +0 -1
  54. package/dist-es/commands/DeleteMountTargetCommand.js +0 -1
  55. package/dist-es/commands/DeleteTagsCommand.js +0 -1
  56. package/dist-es/commands/DescribeAccessPointsCommand.js +0 -1
  57. package/dist-es/commands/DescribeAccountPreferencesCommand.js +0 -1
  58. package/dist-es/commands/DescribeBackupPolicyCommand.js +0 -1
  59. package/dist-es/commands/DescribeFileSystemPolicyCommand.js +0 -1
  60. package/dist-es/commands/DescribeFileSystemsCommand.js +0 -1
  61. package/dist-es/commands/DescribeLifecycleConfigurationCommand.js +0 -1
  62. package/dist-es/commands/DescribeMountTargetSecurityGroupsCommand.js +0 -1
  63. package/dist-es/commands/DescribeMountTargetsCommand.js +0 -1
  64. package/dist-es/commands/DescribeTagsCommand.js +0 -1
  65. package/dist-es/commands/ListTagsForResourceCommand.js +0 -1
  66. package/dist-es/commands/ModifyMountTargetSecurityGroupsCommand.js +0 -1
  67. package/dist-es/commands/PutAccountPreferencesCommand.js +0 -1
  68. package/dist-es/commands/PutBackupPolicyCommand.js +0 -1
  69. package/dist-es/commands/PutFileSystemPolicyCommand.js +0 -1
  70. package/dist-es/commands/PutLifecycleConfigurationCommand.js +0 -1
  71. package/dist-es/commands/TagResourceCommand.js +0 -1
  72. package/dist-es/commands/UntagResourceCommand.js +0 -1
  73. package/dist-es/commands/UpdateFileSystemCommand.js +0 -1
  74. package/dist-es/endpoints.js +0 -1
  75. package/dist-es/index.js +0 -1
  76. package/dist-es/models/index.js +0 -1
  77. package/dist-es/models/models_0.js +0 -1
  78. package/dist-es/pagination/DescribeAccessPointsPaginator.js +0 -1
  79. package/dist-es/pagination/DescribeFileSystemsPaginator.js +0 -1
  80. package/dist-es/pagination/DescribeTagsPaginator.js +0 -1
  81. package/dist-es/pagination/Interfaces.js +0 -1
  82. package/dist-es/pagination/ListTagsForResourcePaginator.js +0 -1
  83. package/dist-es/protocols/Aws_restJson1.js +22 -15
  84. package/dist-es/runtimeConfig.browser.js +1 -2
  85. package/dist-es/runtimeConfig.js +2 -3
  86. package/dist-es/runtimeConfig.native.js +0 -1
  87. package/dist-es/runtimeConfig.shared.js +0 -1
  88. package/package.json +33 -30
  89. package/dist-cjs/EFS.js.map +0 -1
  90. package/dist-cjs/EFSClient.js.map +0 -1
  91. package/dist-cjs/commands/CreateAccessPointCommand.js.map +0 -1
  92. package/dist-cjs/commands/CreateFileSystemCommand.js.map +0 -1
  93. package/dist-cjs/commands/CreateMountTargetCommand.js.map +0 -1
  94. package/dist-cjs/commands/CreateTagsCommand.js.map +0 -1
  95. package/dist-cjs/commands/DeleteAccessPointCommand.js.map +0 -1
  96. package/dist-cjs/commands/DeleteFileSystemCommand.js.map +0 -1
  97. package/dist-cjs/commands/DeleteFileSystemPolicyCommand.js.map +0 -1
  98. package/dist-cjs/commands/DeleteMountTargetCommand.js.map +0 -1
  99. package/dist-cjs/commands/DeleteTagsCommand.js.map +0 -1
  100. package/dist-cjs/commands/DescribeAccessPointsCommand.js.map +0 -1
  101. package/dist-cjs/commands/DescribeAccountPreferencesCommand.js.map +0 -1
  102. package/dist-cjs/commands/DescribeBackupPolicyCommand.js.map +0 -1
  103. package/dist-cjs/commands/DescribeFileSystemPolicyCommand.js.map +0 -1
  104. package/dist-cjs/commands/DescribeFileSystemsCommand.js.map +0 -1
  105. package/dist-cjs/commands/DescribeLifecycleConfigurationCommand.js.map +0 -1
  106. package/dist-cjs/commands/DescribeMountTargetSecurityGroupsCommand.js.map +0 -1
  107. package/dist-cjs/commands/DescribeMountTargetsCommand.js.map +0 -1
  108. package/dist-cjs/commands/DescribeTagsCommand.js.map +0 -1
  109. package/dist-cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  110. package/dist-cjs/commands/ModifyMountTargetSecurityGroupsCommand.js.map +0 -1
  111. package/dist-cjs/commands/PutAccountPreferencesCommand.js.map +0 -1
  112. package/dist-cjs/commands/PutBackupPolicyCommand.js.map +0 -1
  113. package/dist-cjs/commands/PutFileSystemPolicyCommand.js.map +0 -1
  114. package/dist-cjs/commands/PutLifecycleConfigurationCommand.js.map +0 -1
  115. package/dist-cjs/commands/TagResourceCommand.js.map +0 -1
  116. package/dist-cjs/commands/UntagResourceCommand.js.map +0 -1
  117. package/dist-cjs/commands/UpdateFileSystemCommand.js.map +0 -1
  118. package/dist-cjs/endpoints.js.map +0 -1
  119. package/dist-cjs/index.js.map +0 -1
  120. package/dist-cjs/models/index.js.map +0 -1
  121. package/dist-cjs/models/models_0.js.map +0 -1
  122. package/dist-cjs/pagination/DescribeAccessPointsPaginator.js.map +0 -1
  123. package/dist-cjs/pagination/DescribeFileSystemsPaginator.js.map +0 -1
  124. package/dist-cjs/pagination/DescribeTagsPaginator.js.map +0 -1
  125. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  126. package/dist-cjs/pagination/ListTagsForResourcePaginator.js.map +0 -1
  127. package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
  128. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  129. package/dist-cjs/runtimeConfig.js.map +0 -1
  130. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  131. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  132. package/dist-es/EFS.js.map +0 -1
  133. package/dist-es/EFSClient.js.map +0 -1
  134. package/dist-es/commands/CreateAccessPointCommand.js.map +0 -1
  135. package/dist-es/commands/CreateFileSystemCommand.js.map +0 -1
  136. package/dist-es/commands/CreateMountTargetCommand.js.map +0 -1
  137. package/dist-es/commands/CreateTagsCommand.js.map +0 -1
  138. package/dist-es/commands/DeleteAccessPointCommand.js.map +0 -1
  139. package/dist-es/commands/DeleteFileSystemCommand.js.map +0 -1
  140. package/dist-es/commands/DeleteFileSystemPolicyCommand.js.map +0 -1
  141. package/dist-es/commands/DeleteMountTargetCommand.js.map +0 -1
  142. package/dist-es/commands/DeleteTagsCommand.js.map +0 -1
  143. package/dist-es/commands/DescribeAccessPointsCommand.js.map +0 -1
  144. package/dist-es/commands/DescribeAccountPreferencesCommand.js.map +0 -1
  145. package/dist-es/commands/DescribeBackupPolicyCommand.js.map +0 -1
  146. package/dist-es/commands/DescribeFileSystemPolicyCommand.js.map +0 -1
  147. package/dist-es/commands/DescribeFileSystemsCommand.js.map +0 -1
  148. package/dist-es/commands/DescribeLifecycleConfigurationCommand.js.map +0 -1
  149. package/dist-es/commands/DescribeMountTargetSecurityGroupsCommand.js.map +0 -1
  150. package/dist-es/commands/DescribeMountTargetsCommand.js.map +0 -1
  151. package/dist-es/commands/DescribeTagsCommand.js.map +0 -1
  152. package/dist-es/commands/ListTagsForResourceCommand.js.map +0 -1
  153. package/dist-es/commands/ModifyMountTargetSecurityGroupsCommand.js.map +0 -1
  154. package/dist-es/commands/PutAccountPreferencesCommand.js.map +0 -1
  155. package/dist-es/commands/PutBackupPolicyCommand.js.map +0 -1
  156. package/dist-es/commands/PutFileSystemPolicyCommand.js.map +0 -1
  157. package/dist-es/commands/PutLifecycleConfigurationCommand.js.map +0 -1
  158. package/dist-es/commands/TagResourceCommand.js.map +0 -1
  159. package/dist-es/commands/UntagResourceCommand.js.map +0 -1
  160. package/dist-es/commands/UpdateFileSystemCommand.js.map +0 -1
  161. package/dist-es/endpoints.js.map +0 -1
  162. package/dist-es/index.js.map +0 -1
  163. package/dist-es/models/index.js.map +0 -1
  164. package/dist-es/models/models_0.js.map +0 -1
  165. package/dist-es/pagination/DescribeAccessPointsPaginator.js.map +0 -1
  166. package/dist-es/pagination/DescribeFileSystemsPaginator.js.map +0 -1
  167. package/dist-es/pagination/DescribeTagsPaginator.js.map +0 -1
  168. package/dist-es/pagination/Interfaces.js.map +0 -1
  169. package/dist-es/pagination/ListTagsForResourcePaginator.js.map +0 -1
  170. package/dist-es/protocols/Aws_restJson1.js.map +0 -1
  171. package/dist-es/runtimeConfig.browser.js.map +0 -1
  172. package/dist-es/runtimeConfig.js.map +0 -1
  173. package/dist-es/runtimeConfig.native.js.map +0 -1
  174. package/dist-es/runtimeConfig.shared.js.map +0 -1
  175. package/jest.config.js +0 -4
  176. package/src/EFS.ts +0 -1386
  177. package/src/EFSClient.ts +0 -363
  178. package/src/commands/CreateAccessPointCommand.ts +0 -102
  179. package/src/commands/CreateFileSystemCommand.ts +0 -148
  180. package/src/commands/CreateMountTargetCommand.ts +0 -236
  181. package/src/commands/CreateTagsCommand.ts +0 -106
  182. package/src/commands/DeleteAccessPointCommand.ts +0 -98
  183. package/src/commands/DeleteFileSystemCommand.ts +0 -109
  184. package/src/commands/DeleteFileSystemPolicyCommand.ts +0 -98
  185. package/src/commands/DeleteMountTargetCommand.ts +0 -128
  186. package/src/commands/DeleteTagsCommand.ts +0 -107
  187. package/src/commands/DescribeAccessPointsCommand.ts +0 -98
  188. package/src/commands/DescribeAccountPreferencesCommand.ts +0 -99
  189. package/src/commands/DescribeBackupPolicyCommand.ts +0 -95
  190. package/src/commands/DescribeFileSystemPolicyCommand.ts +0 -96
  191. package/src/commands/DescribeFileSystemsCommand.ts +0 -117
  192. package/src/commands/DescribeLifecycleConfigurationCommand.ts +0 -110
  193. package/src/commands/DescribeMountTargetSecurityGroupsCommand.ts +0 -121
  194. package/src/commands/DescribeMountTargetsCommand.ts +0 -102
  195. package/src/commands/DescribeTagsCommand.ts +0 -105
  196. package/src/commands/ListTagsForResourceCommand.ts +0 -96
  197. package/src/commands/ModifyMountTargetSecurityGroupsCommand.ts +0 -120
  198. package/src/commands/PutAccountPreferencesCommand.ts +0 -98
  199. package/src/commands/PutBackupPolicyCommand.ts +0 -95
  200. package/src/commands/PutFileSystemPolicyCommand.ts +0 -104
  201. package/src/commands/PutLifecycleConfigurationCommand.ts +0 -128
  202. package/src/commands/TagResourceCommand.ts +0 -96
  203. package/src/commands/UntagResourceCommand.ts +0 -96
  204. package/src/commands/UpdateFileSystemCommand.ts +0 -96
  205. package/src/endpoints.ts +0 -183
  206. package/src/index.ts +0 -35
  207. package/src/models/index.ts +0 -1
  208. package/src/models/models_0.ts +0 -2185
  209. package/src/pagination/DescribeAccessPointsPaginator.ts +0 -59
  210. package/src/pagination/DescribeFileSystemsPaginator.ts +0 -59
  211. package/src/pagination/DescribeTagsPaginator.ts +0 -59
  212. package/src/pagination/Interfaces.ts +0 -8
  213. package/src/pagination/ListTagsForResourcePaginator.ts +0 -59
  214. package/src/protocols/Aws_restJson1.ts +0 -4420
  215. package/src/runtimeConfig.browser.ts +0 -41
  216. package/src/runtimeConfig.native.ts +0 -17
  217. package/src/runtimeConfig.shared.ts +0 -17
  218. package/src/runtimeConfig.ts +0 -46
  219. package/tsconfig.es.json +0 -10
  220. package/tsconfig.json +0 -33
  221. package/tsconfig.types.json +0 -9
@@ -1,4420 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectInt32 as __expectInt32,
5
- expectLong as __expectLong,
6
- expectNonNull as __expectNonNull,
7
- expectNumber as __expectNumber,
8
- expectObject as __expectObject,
9
- expectString as __expectString,
10
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
11
- limitedParseDouble as __limitedParseDouble,
12
- parseEpochTimestamp as __parseEpochTimestamp,
13
- serializeFloat as __serializeFloat,
14
- } from "@aws-sdk/smithy-client";
15
- import {
16
- Endpoint as __Endpoint,
17
- MetadataBearer as __MetadataBearer,
18
- ResponseMetadata as __ResponseMetadata,
19
- SerdeContext as __SerdeContext,
20
- SmithyException as __SmithyException,
21
- } from "@aws-sdk/types";
22
- import { v4 as generateIdempotencyToken } from "uuid";
23
-
24
- import { CreateAccessPointCommandInput, CreateAccessPointCommandOutput } from "../commands/CreateAccessPointCommand";
25
- import { CreateFileSystemCommandInput, CreateFileSystemCommandOutput } from "../commands/CreateFileSystemCommand";
26
- import { CreateMountTargetCommandInput, CreateMountTargetCommandOutput } from "../commands/CreateMountTargetCommand";
27
- import { CreateTagsCommandInput, CreateTagsCommandOutput } from "../commands/CreateTagsCommand";
28
- import { DeleteAccessPointCommandInput, DeleteAccessPointCommandOutput } from "../commands/DeleteAccessPointCommand";
29
- import { DeleteFileSystemCommandInput, DeleteFileSystemCommandOutput } from "../commands/DeleteFileSystemCommand";
30
- import {
31
- DeleteFileSystemPolicyCommandInput,
32
- DeleteFileSystemPolicyCommandOutput,
33
- } from "../commands/DeleteFileSystemPolicyCommand";
34
- import { DeleteMountTargetCommandInput, DeleteMountTargetCommandOutput } from "../commands/DeleteMountTargetCommand";
35
- import { DeleteTagsCommandInput, DeleteTagsCommandOutput } from "../commands/DeleteTagsCommand";
36
- import {
37
- DescribeAccessPointsCommandInput,
38
- DescribeAccessPointsCommandOutput,
39
- } from "../commands/DescribeAccessPointsCommand";
40
- import {
41
- DescribeAccountPreferencesCommandInput,
42
- DescribeAccountPreferencesCommandOutput,
43
- } from "../commands/DescribeAccountPreferencesCommand";
44
- import {
45
- DescribeBackupPolicyCommandInput,
46
- DescribeBackupPolicyCommandOutput,
47
- } from "../commands/DescribeBackupPolicyCommand";
48
- import {
49
- DescribeFileSystemPolicyCommandInput,
50
- DescribeFileSystemPolicyCommandOutput,
51
- } from "../commands/DescribeFileSystemPolicyCommand";
52
- import {
53
- DescribeFileSystemsCommandInput,
54
- DescribeFileSystemsCommandOutput,
55
- } from "../commands/DescribeFileSystemsCommand";
56
- import {
57
- DescribeLifecycleConfigurationCommandInput,
58
- DescribeLifecycleConfigurationCommandOutput,
59
- } from "../commands/DescribeLifecycleConfigurationCommand";
60
- import {
61
- DescribeMountTargetsCommandInput,
62
- DescribeMountTargetsCommandOutput,
63
- } from "../commands/DescribeMountTargetsCommand";
64
- import {
65
- DescribeMountTargetSecurityGroupsCommandInput,
66
- DescribeMountTargetSecurityGroupsCommandOutput,
67
- } from "../commands/DescribeMountTargetSecurityGroupsCommand";
68
- import { DescribeTagsCommandInput, DescribeTagsCommandOutput } from "../commands/DescribeTagsCommand";
69
- import {
70
- ListTagsForResourceCommandInput,
71
- ListTagsForResourceCommandOutput,
72
- } from "../commands/ListTagsForResourceCommand";
73
- import {
74
- ModifyMountTargetSecurityGroupsCommandInput,
75
- ModifyMountTargetSecurityGroupsCommandOutput,
76
- } from "../commands/ModifyMountTargetSecurityGroupsCommand";
77
- import {
78
- PutAccountPreferencesCommandInput,
79
- PutAccountPreferencesCommandOutput,
80
- } from "../commands/PutAccountPreferencesCommand";
81
- import { PutBackupPolicyCommandInput, PutBackupPolicyCommandOutput } from "../commands/PutBackupPolicyCommand";
82
- import {
83
- PutFileSystemPolicyCommandInput,
84
- PutFileSystemPolicyCommandOutput,
85
- } from "../commands/PutFileSystemPolicyCommand";
86
- import {
87
- PutLifecycleConfigurationCommandInput,
88
- PutLifecycleConfigurationCommandOutput,
89
- } from "../commands/PutLifecycleConfigurationCommand";
90
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
91
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
92
- import { UpdateFileSystemCommandInput, UpdateFileSystemCommandOutput } from "../commands/UpdateFileSystemCommand";
93
- import {
94
- AccessPointAlreadyExists,
95
- AccessPointDescription,
96
- AccessPointLimitExceeded,
97
- AccessPointNotFound,
98
- AvailabilityZonesMismatch,
99
- BackupPolicy,
100
- BadRequest,
101
- CreationInfo,
102
- DependencyTimeout,
103
- FileSystemAlreadyExists,
104
- FileSystemDescription,
105
- FileSystemInUse,
106
- FileSystemLimitExceeded,
107
- FileSystemNotFound,
108
- FileSystemSize,
109
- IncorrectFileSystemLifeCycleState,
110
- IncorrectMountTargetState,
111
- InsufficientThroughputCapacity,
112
- InternalServerError,
113
- InvalidPolicyException,
114
- IpAddressInUse,
115
- LifecyclePolicy,
116
- MountTargetConflict,
117
- MountTargetDescription,
118
- MountTargetNotFound,
119
- NetworkInterfaceLimitExceeded,
120
- NoFreeAddressesInSubnet,
121
- PolicyNotFound,
122
- PosixUser,
123
- Resource,
124
- ResourceIdPreference,
125
- RootDirectory,
126
- SecurityGroupLimitExceeded,
127
- SecurityGroupNotFound,
128
- SubnetNotFound,
129
- Tag,
130
- ThroughputLimitExceeded,
131
- TooManyRequests,
132
- UnsupportedAvailabilityZone,
133
- ValidationException,
134
- } from "../models/models_0";
135
-
136
- export const serializeAws_restJson1CreateAccessPointCommand = async (
137
- input: CreateAccessPointCommandInput,
138
- context: __SerdeContext
139
- ): Promise<__HttpRequest> => {
140
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
141
- const headers: any = {
142
- "content-type": "application/json",
143
- };
144
- const resolvedPath =
145
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/access-points";
146
- let body: any;
147
- body = JSON.stringify({
148
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
149
- ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }),
150
- ...(input.PosixUser !== undefined &&
151
- input.PosixUser !== null && { PosixUser: serializeAws_restJson1PosixUser(input.PosixUser, context) }),
152
- ...(input.RootDirectory !== undefined &&
153
- input.RootDirectory !== null && {
154
- RootDirectory: serializeAws_restJson1RootDirectory(input.RootDirectory, context),
155
- }),
156
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
157
- });
158
- return new __HttpRequest({
159
- protocol,
160
- hostname,
161
- port,
162
- method: "POST",
163
- headers,
164
- path: resolvedPath,
165
- body,
166
- });
167
- };
168
-
169
- export const serializeAws_restJson1CreateFileSystemCommand = async (
170
- input: CreateFileSystemCommandInput,
171
- context: __SerdeContext
172
- ): Promise<__HttpRequest> => {
173
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
174
- const headers: any = {
175
- "content-type": "application/json",
176
- };
177
- const resolvedPath =
178
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems";
179
- let body: any;
180
- body = JSON.stringify({
181
- ...(input.AvailabilityZoneName !== undefined &&
182
- input.AvailabilityZoneName !== null && { AvailabilityZoneName: input.AvailabilityZoneName }),
183
- ...(input.Backup !== undefined && input.Backup !== null && { Backup: input.Backup }),
184
- CreationToken: input.CreationToken ?? generateIdempotencyToken(),
185
- ...(input.Encrypted !== undefined && input.Encrypted !== null && { Encrypted: input.Encrypted }),
186
- ...(input.KmsKeyId !== undefined && input.KmsKeyId !== null && { KmsKeyId: input.KmsKeyId }),
187
- ...(input.PerformanceMode !== undefined &&
188
- input.PerformanceMode !== null && { PerformanceMode: input.PerformanceMode }),
189
- ...(input.ProvisionedThroughputInMibps !== undefined &&
190
- input.ProvisionedThroughputInMibps !== null && {
191
- ProvisionedThroughputInMibps: __serializeFloat(input.ProvisionedThroughputInMibps),
192
- }),
193
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
194
- ...(input.ThroughputMode !== undefined &&
195
- input.ThroughputMode !== null && { ThroughputMode: input.ThroughputMode }),
196
- });
197
- return new __HttpRequest({
198
- protocol,
199
- hostname,
200
- port,
201
- method: "POST",
202
- headers,
203
- path: resolvedPath,
204
- body,
205
- });
206
- };
207
-
208
- export const serializeAws_restJson1CreateMountTargetCommand = async (
209
- input: CreateMountTargetCommandInput,
210
- context: __SerdeContext
211
- ): Promise<__HttpRequest> => {
212
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
213
- const headers: any = {
214
- "content-type": "application/json",
215
- };
216
- const resolvedPath =
217
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/mount-targets";
218
- let body: any;
219
- body = JSON.stringify({
220
- ...(input.FileSystemId !== undefined && input.FileSystemId !== null && { FileSystemId: input.FileSystemId }),
221
- ...(input.IpAddress !== undefined && input.IpAddress !== null && { IpAddress: input.IpAddress }),
222
- ...(input.SecurityGroups !== undefined &&
223
- input.SecurityGroups !== null && {
224
- SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context),
225
- }),
226
- ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
227
- });
228
- return new __HttpRequest({
229
- protocol,
230
- hostname,
231
- port,
232
- method: "POST",
233
- headers,
234
- path: resolvedPath,
235
- body,
236
- });
237
- };
238
-
239
- export const serializeAws_restJson1CreateTagsCommand = async (
240
- input: CreateTagsCommandInput,
241
- context: __SerdeContext
242
- ): Promise<__HttpRequest> => {
243
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
244
- const headers: any = {
245
- "content-type": "application/json",
246
- };
247
- let resolvedPath =
248
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/create-tags/{FileSystemId}";
249
- if (input.FileSystemId !== undefined) {
250
- const labelValue: string = input.FileSystemId;
251
- if (labelValue.length <= 0) {
252
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
253
- }
254
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
255
- } else {
256
- throw new Error("No value provided for input HTTP label: FileSystemId.");
257
- }
258
- let body: any;
259
- body = JSON.stringify({
260
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
261
- });
262
- return new __HttpRequest({
263
- protocol,
264
- hostname,
265
- port,
266
- method: "POST",
267
- headers,
268
- path: resolvedPath,
269
- body,
270
- });
271
- };
272
-
273
- export const serializeAws_restJson1DeleteAccessPointCommand = async (
274
- input: DeleteAccessPointCommandInput,
275
- context: __SerdeContext
276
- ): Promise<__HttpRequest> => {
277
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
278
- const headers: any = {};
279
- let resolvedPath =
280
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/access-points/{AccessPointId}";
281
- if (input.AccessPointId !== undefined) {
282
- const labelValue: string = input.AccessPointId;
283
- if (labelValue.length <= 0) {
284
- throw new Error("Empty value provided for input HTTP label: AccessPointId.");
285
- }
286
- resolvedPath = resolvedPath.replace("{AccessPointId}", __extendedEncodeURIComponent(labelValue));
287
- } else {
288
- throw new Error("No value provided for input HTTP label: AccessPointId.");
289
- }
290
- let body: any;
291
- return new __HttpRequest({
292
- protocol,
293
- hostname,
294
- port,
295
- method: "DELETE",
296
- headers,
297
- path: resolvedPath,
298
- body,
299
- });
300
- };
301
-
302
- export const serializeAws_restJson1DeleteFileSystemCommand = async (
303
- input: DeleteFileSystemCommandInput,
304
- context: __SerdeContext
305
- ): Promise<__HttpRequest> => {
306
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
307
- const headers: any = {};
308
- let resolvedPath =
309
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems/{FileSystemId}";
310
- if (input.FileSystemId !== undefined) {
311
- const labelValue: string = input.FileSystemId;
312
- if (labelValue.length <= 0) {
313
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
314
- }
315
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
316
- } else {
317
- throw new Error("No value provided for input HTTP label: FileSystemId.");
318
- }
319
- let body: any;
320
- return new __HttpRequest({
321
- protocol,
322
- hostname,
323
- port,
324
- method: "DELETE",
325
- headers,
326
- path: resolvedPath,
327
- body,
328
- });
329
- };
330
-
331
- export const serializeAws_restJson1DeleteFileSystemPolicyCommand = async (
332
- input: DeleteFileSystemPolicyCommandInput,
333
- context: __SerdeContext
334
- ): Promise<__HttpRequest> => {
335
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
336
- const headers: any = {};
337
- let resolvedPath =
338
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
339
- "/2015-02-01/file-systems/{FileSystemId}/policy";
340
- if (input.FileSystemId !== undefined) {
341
- const labelValue: string = input.FileSystemId;
342
- if (labelValue.length <= 0) {
343
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
344
- }
345
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
346
- } else {
347
- throw new Error("No value provided for input HTTP label: FileSystemId.");
348
- }
349
- let body: any;
350
- return new __HttpRequest({
351
- protocol,
352
- hostname,
353
- port,
354
- method: "DELETE",
355
- headers,
356
- path: resolvedPath,
357
- body,
358
- });
359
- };
360
-
361
- export const serializeAws_restJson1DeleteMountTargetCommand = async (
362
- input: DeleteMountTargetCommandInput,
363
- context: __SerdeContext
364
- ): Promise<__HttpRequest> => {
365
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
366
- const headers: any = {};
367
- let resolvedPath =
368
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/mount-targets/{MountTargetId}";
369
- if (input.MountTargetId !== undefined) {
370
- const labelValue: string = input.MountTargetId;
371
- if (labelValue.length <= 0) {
372
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
373
- }
374
- resolvedPath = resolvedPath.replace("{MountTargetId}", __extendedEncodeURIComponent(labelValue));
375
- } else {
376
- throw new Error("No value provided for input HTTP label: MountTargetId.");
377
- }
378
- let body: any;
379
- return new __HttpRequest({
380
- protocol,
381
- hostname,
382
- port,
383
- method: "DELETE",
384
- headers,
385
- path: resolvedPath,
386
- body,
387
- });
388
- };
389
-
390
- export const serializeAws_restJson1DeleteTagsCommand = async (
391
- input: DeleteTagsCommandInput,
392
- context: __SerdeContext
393
- ): Promise<__HttpRequest> => {
394
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
395
- const headers: any = {
396
- "content-type": "application/json",
397
- };
398
- let resolvedPath =
399
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/delete-tags/{FileSystemId}";
400
- if (input.FileSystemId !== undefined) {
401
- const labelValue: string = input.FileSystemId;
402
- if (labelValue.length <= 0) {
403
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
404
- }
405
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
406
- } else {
407
- throw new Error("No value provided for input HTTP label: FileSystemId.");
408
- }
409
- let body: any;
410
- body = JSON.stringify({
411
- ...(input.TagKeys !== undefined &&
412
- input.TagKeys !== null && { TagKeys: serializeAws_restJson1TagKeys(input.TagKeys, context) }),
413
- });
414
- return new __HttpRequest({
415
- protocol,
416
- hostname,
417
- port,
418
- method: "POST",
419
- headers,
420
- path: resolvedPath,
421
- body,
422
- });
423
- };
424
-
425
- export const serializeAws_restJson1DescribeAccessPointsCommand = async (
426
- input: DescribeAccessPointsCommandInput,
427
- context: __SerdeContext
428
- ): Promise<__HttpRequest> => {
429
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
430
- const headers: any = {};
431
- const resolvedPath =
432
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/access-points";
433
- const query: any = {
434
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
435
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
436
- ...(input.AccessPointId !== undefined && { AccessPointId: input.AccessPointId }),
437
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
438
- };
439
- let body: any;
440
- return new __HttpRequest({
441
- protocol,
442
- hostname,
443
- port,
444
- method: "GET",
445
- headers,
446
- path: resolvedPath,
447
- query,
448
- body,
449
- });
450
- };
451
-
452
- export const serializeAws_restJson1DescribeAccountPreferencesCommand = async (
453
- input: DescribeAccountPreferencesCommandInput,
454
- context: __SerdeContext
455
- ): Promise<__HttpRequest> => {
456
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
457
- const headers: any = {
458
- "content-type": "application/json",
459
- };
460
- const resolvedPath =
461
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/account-preferences";
462
- let body: any;
463
- body = JSON.stringify({
464
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
465
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
466
- });
467
- return new __HttpRequest({
468
- protocol,
469
- hostname,
470
- port,
471
- method: "GET",
472
- headers,
473
- path: resolvedPath,
474
- body,
475
- });
476
- };
477
-
478
- export const serializeAws_restJson1DescribeBackupPolicyCommand = async (
479
- input: DescribeBackupPolicyCommandInput,
480
- context: __SerdeContext
481
- ): Promise<__HttpRequest> => {
482
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
483
- const headers: any = {};
484
- let resolvedPath =
485
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
486
- "/2015-02-01/file-systems/{FileSystemId}/backup-policy";
487
- if (input.FileSystemId !== undefined) {
488
- const labelValue: string = input.FileSystemId;
489
- if (labelValue.length <= 0) {
490
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
491
- }
492
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
493
- } else {
494
- throw new Error("No value provided for input HTTP label: FileSystemId.");
495
- }
496
- let body: any;
497
- return new __HttpRequest({
498
- protocol,
499
- hostname,
500
- port,
501
- method: "GET",
502
- headers,
503
- path: resolvedPath,
504
- body,
505
- });
506
- };
507
-
508
- export const serializeAws_restJson1DescribeFileSystemPolicyCommand = async (
509
- input: DescribeFileSystemPolicyCommandInput,
510
- context: __SerdeContext
511
- ): Promise<__HttpRequest> => {
512
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
513
- const headers: any = {};
514
- let resolvedPath =
515
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
516
- "/2015-02-01/file-systems/{FileSystemId}/policy";
517
- if (input.FileSystemId !== undefined) {
518
- const labelValue: string = input.FileSystemId;
519
- if (labelValue.length <= 0) {
520
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
521
- }
522
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
523
- } else {
524
- throw new Error("No value provided for input HTTP label: FileSystemId.");
525
- }
526
- let body: any;
527
- return new __HttpRequest({
528
- protocol,
529
- hostname,
530
- port,
531
- method: "GET",
532
- headers,
533
- path: resolvedPath,
534
- body,
535
- });
536
- };
537
-
538
- export const serializeAws_restJson1DescribeFileSystemsCommand = async (
539
- input: DescribeFileSystemsCommandInput,
540
- context: __SerdeContext
541
- ): Promise<__HttpRequest> => {
542
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
543
- const headers: any = {};
544
- const resolvedPath =
545
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems";
546
- const query: any = {
547
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
548
- ...(input.Marker !== undefined && { Marker: input.Marker }),
549
- ...(input.CreationToken !== undefined && { CreationToken: input.CreationToken }),
550
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
551
- };
552
- let body: any;
553
- return new __HttpRequest({
554
- protocol,
555
- hostname,
556
- port,
557
- method: "GET",
558
- headers,
559
- path: resolvedPath,
560
- query,
561
- body,
562
- });
563
- };
564
-
565
- export const serializeAws_restJson1DescribeLifecycleConfigurationCommand = async (
566
- input: DescribeLifecycleConfigurationCommandInput,
567
- context: __SerdeContext
568
- ): Promise<__HttpRequest> => {
569
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
570
- const headers: any = {};
571
- let resolvedPath =
572
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
573
- "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration";
574
- if (input.FileSystemId !== undefined) {
575
- const labelValue: string = input.FileSystemId;
576
- if (labelValue.length <= 0) {
577
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
578
- }
579
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
580
- } else {
581
- throw new Error("No value provided for input HTTP label: FileSystemId.");
582
- }
583
- let body: any;
584
- return new __HttpRequest({
585
- protocol,
586
- hostname,
587
- port,
588
- method: "GET",
589
- headers,
590
- path: resolvedPath,
591
- body,
592
- });
593
- };
594
-
595
- export const serializeAws_restJson1DescribeMountTargetsCommand = async (
596
- input: DescribeMountTargetsCommandInput,
597
- context: __SerdeContext
598
- ): Promise<__HttpRequest> => {
599
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
600
- const headers: any = {};
601
- const resolvedPath =
602
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/mount-targets";
603
- const query: any = {
604
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
605
- ...(input.Marker !== undefined && { Marker: input.Marker }),
606
- ...(input.FileSystemId !== undefined && { FileSystemId: input.FileSystemId }),
607
- ...(input.MountTargetId !== undefined && { MountTargetId: input.MountTargetId }),
608
- ...(input.AccessPointId !== undefined && { AccessPointId: input.AccessPointId }),
609
- };
610
- let body: any;
611
- return new __HttpRequest({
612
- protocol,
613
- hostname,
614
- port,
615
- method: "GET",
616
- headers,
617
- path: resolvedPath,
618
- query,
619
- body,
620
- });
621
- };
622
-
623
- export const serializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = async (
624
- input: DescribeMountTargetSecurityGroupsCommandInput,
625
- context: __SerdeContext
626
- ): Promise<__HttpRequest> => {
627
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
628
- const headers: any = {};
629
- let resolvedPath =
630
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
631
- "/2015-02-01/mount-targets/{MountTargetId}/security-groups";
632
- if (input.MountTargetId !== undefined) {
633
- const labelValue: string = input.MountTargetId;
634
- if (labelValue.length <= 0) {
635
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
636
- }
637
- resolvedPath = resolvedPath.replace("{MountTargetId}", __extendedEncodeURIComponent(labelValue));
638
- } else {
639
- throw new Error("No value provided for input HTTP label: MountTargetId.");
640
- }
641
- let body: any;
642
- return new __HttpRequest({
643
- protocol,
644
- hostname,
645
- port,
646
- method: "GET",
647
- headers,
648
- path: resolvedPath,
649
- body,
650
- });
651
- };
652
-
653
- export const serializeAws_restJson1DescribeTagsCommand = async (
654
- input: DescribeTagsCommandInput,
655
- context: __SerdeContext
656
- ): Promise<__HttpRequest> => {
657
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
658
- const headers: any = {};
659
- let resolvedPath =
660
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/tags/{FileSystemId}";
661
- if (input.FileSystemId !== undefined) {
662
- const labelValue: string = input.FileSystemId;
663
- if (labelValue.length <= 0) {
664
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
665
- }
666
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
667
- } else {
668
- throw new Error("No value provided for input HTTP label: FileSystemId.");
669
- }
670
- const query: any = {
671
- ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems.toString() }),
672
- ...(input.Marker !== undefined && { Marker: input.Marker }),
673
- };
674
- let body: any;
675
- return new __HttpRequest({
676
- protocol,
677
- hostname,
678
- port,
679
- method: "GET",
680
- headers,
681
- path: resolvedPath,
682
- query,
683
- body,
684
- });
685
- };
686
-
687
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
688
- input: ListTagsForResourceCommandInput,
689
- context: __SerdeContext
690
- ): Promise<__HttpRequest> => {
691
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
692
- const headers: any = {};
693
- let resolvedPath =
694
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
695
- if (input.ResourceId !== undefined) {
696
- const labelValue: string = input.ResourceId;
697
- if (labelValue.length <= 0) {
698
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
699
- }
700
- resolvedPath = resolvedPath.replace("{ResourceId}", __extendedEncodeURIComponent(labelValue));
701
- } else {
702
- throw new Error("No value provided for input HTTP label: ResourceId.");
703
- }
704
- const query: any = {
705
- ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() }),
706
- ...(input.NextToken !== undefined && { NextToken: input.NextToken }),
707
- };
708
- let body: any;
709
- return new __HttpRequest({
710
- protocol,
711
- hostname,
712
- port,
713
- method: "GET",
714
- headers,
715
- path: resolvedPath,
716
- query,
717
- body,
718
- });
719
- };
720
-
721
- export const serializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = async (
722
- input: ModifyMountTargetSecurityGroupsCommandInput,
723
- context: __SerdeContext
724
- ): Promise<__HttpRequest> => {
725
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
726
- const headers: any = {
727
- "content-type": "application/json",
728
- };
729
- let resolvedPath =
730
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
731
- "/2015-02-01/mount-targets/{MountTargetId}/security-groups";
732
- if (input.MountTargetId !== undefined) {
733
- const labelValue: string = input.MountTargetId;
734
- if (labelValue.length <= 0) {
735
- throw new Error("Empty value provided for input HTTP label: MountTargetId.");
736
- }
737
- resolvedPath = resolvedPath.replace("{MountTargetId}", __extendedEncodeURIComponent(labelValue));
738
- } else {
739
- throw new Error("No value provided for input HTTP label: MountTargetId.");
740
- }
741
- let body: any;
742
- body = JSON.stringify({
743
- ...(input.SecurityGroups !== undefined &&
744
- input.SecurityGroups !== null && {
745
- SecurityGroups: serializeAws_restJson1SecurityGroups(input.SecurityGroups, context),
746
- }),
747
- });
748
- return new __HttpRequest({
749
- protocol,
750
- hostname,
751
- port,
752
- method: "PUT",
753
- headers,
754
- path: resolvedPath,
755
- body,
756
- });
757
- };
758
-
759
- export const serializeAws_restJson1PutAccountPreferencesCommand = async (
760
- input: PutAccountPreferencesCommandInput,
761
- context: __SerdeContext
762
- ): Promise<__HttpRequest> => {
763
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
764
- const headers: any = {
765
- "content-type": "application/json",
766
- };
767
- const resolvedPath =
768
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/account-preferences";
769
- let body: any;
770
- body = JSON.stringify({
771
- ...(input.ResourceIdType !== undefined &&
772
- input.ResourceIdType !== null && { ResourceIdType: input.ResourceIdType }),
773
- });
774
- return new __HttpRequest({
775
- protocol,
776
- hostname,
777
- port,
778
- method: "PUT",
779
- headers,
780
- path: resolvedPath,
781
- body,
782
- });
783
- };
784
-
785
- export const serializeAws_restJson1PutBackupPolicyCommand = async (
786
- input: PutBackupPolicyCommandInput,
787
- context: __SerdeContext
788
- ): Promise<__HttpRequest> => {
789
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
790
- const headers: any = {
791
- "content-type": "application/json",
792
- };
793
- let resolvedPath =
794
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
795
- "/2015-02-01/file-systems/{FileSystemId}/backup-policy";
796
- if (input.FileSystemId !== undefined) {
797
- const labelValue: string = input.FileSystemId;
798
- if (labelValue.length <= 0) {
799
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
800
- }
801
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
802
- } else {
803
- throw new Error("No value provided for input HTTP label: FileSystemId.");
804
- }
805
- let body: any;
806
- body = JSON.stringify({
807
- ...(input.BackupPolicy !== undefined &&
808
- input.BackupPolicy !== null && { BackupPolicy: serializeAws_restJson1BackupPolicy(input.BackupPolicy, context) }),
809
- });
810
- return new __HttpRequest({
811
- protocol,
812
- hostname,
813
- port,
814
- method: "PUT",
815
- headers,
816
- path: resolvedPath,
817
- body,
818
- });
819
- };
820
-
821
- export const serializeAws_restJson1PutFileSystemPolicyCommand = async (
822
- input: PutFileSystemPolicyCommandInput,
823
- context: __SerdeContext
824
- ): Promise<__HttpRequest> => {
825
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
826
- const headers: any = {
827
- "content-type": "application/json",
828
- };
829
- let resolvedPath =
830
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
831
- "/2015-02-01/file-systems/{FileSystemId}/policy";
832
- if (input.FileSystemId !== undefined) {
833
- const labelValue: string = input.FileSystemId;
834
- if (labelValue.length <= 0) {
835
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
836
- }
837
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
838
- } else {
839
- throw new Error("No value provided for input HTTP label: FileSystemId.");
840
- }
841
- let body: any;
842
- body = JSON.stringify({
843
- ...(input.BypassPolicyLockoutSafetyCheck !== undefined &&
844
- input.BypassPolicyLockoutSafetyCheck !== null && {
845
- BypassPolicyLockoutSafetyCheck: input.BypassPolicyLockoutSafetyCheck,
846
- }),
847
- ...(input.Policy !== undefined && input.Policy !== null && { Policy: input.Policy }),
848
- });
849
- return new __HttpRequest({
850
- protocol,
851
- hostname,
852
- port,
853
- method: "PUT",
854
- headers,
855
- path: resolvedPath,
856
- body,
857
- });
858
- };
859
-
860
- export const serializeAws_restJson1PutLifecycleConfigurationCommand = async (
861
- input: PutLifecycleConfigurationCommandInput,
862
- context: __SerdeContext
863
- ): Promise<__HttpRequest> => {
864
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
865
- const headers: any = {
866
- "content-type": "application/json",
867
- };
868
- let resolvedPath =
869
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
870
- "/2015-02-01/file-systems/{FileSystemId}/lifecycle-configuration";
871
- if (input.FileSystemId !== undefined) {
872
- const labelValue: string = input.FileSystemId;
873
- if (labelValue.length <= 0) {
874
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
875
- }
876
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
877
- } else {
878
- throw new Error("No value provided for input HTTP label: FileSystemId.");
879
- }
880
- let body: any;
881
- body = JSON.stringify({
882
- ...(input.LifecyclePolicies !== undefined &&
883
- input.LifecyclePolicies !== null && {
884
- LifecyclePolicies: serializeAws_restJson1LifecyclePolicies(input.LifecyclePolicies, context),
885
- }),
886
- });
887
- return new __HttpRequest({
888
- protocol,
889
- hostname,
890
- port,
891
- method: "PUT",
892
- headers,
893
- path: resolvedPath,
894
- body,
895
- });
896
- };
897
-
898
- export const serializeAws_restJson1TagResourceCommand = async (
899
- input: TagResourceCommandInput,
900
- context: __SerdeContext
901
- ): Promise<__HttpRequest> => {
902
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
903
- const headers: any = {
904
- "content-type": "application/json",
905
- };
906
- let resolvedPath =
907
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
908
- if (input.ResourceId !== undefined) {
909
- const labelValue: string = input.ResourceId;
910
- if (labelValue.length <= 0) {
911
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
912
- }
913
- resolvedPath = resolvedPath.replace("{ResourceId}", __extendedEncodeURIComponent(labelValue));
914
- } else {
915
- throw new Error("No value provided for input HTTP label: ResourceId.");
916
- }
917
- let body: any;
918
- body = JSON.stringify({
919
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_restJson1Tags(input.Tags, context) }),
920
- });
921
- return new __HttpRequest({
922
- protocol,
923
- hostname,
924
- port,
925
- method: "POST",
926
- headers,
927
- path: resolvedPath,
928
- body,
929
- });
930
- };
931
-
932
- export const serializeAws_restJson1UntagResourceCommand = async (
933
- input: UntagResourceCommandInput,
934
- context: __SerdeContext
935
- ): Promise<__HttpRequest> => {
936
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
937
- const headers: any = {};
938
- let resolvedPath =
939
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/resource-tags/{ResourceId}";
940
- if (input.ResourceId !== undefined) {
941
- const labelValue: string = input.ResourceId;
942
- if (labelValue.length <= 0) {
943
- throw new Error("Empty value provided for input HTTP label: ResourceId.");
944
- }
945
- resolvedPath = resolvedPath.replace("{ResourceId}", __extendedEncodeURIComponent(labelValue));
946
- } else {
947
- throw new Error("No value provided for input HTTP label: ResourceId.");
948
- }
949
- const query: any = {
950
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry as any) }),
951
- };
952
- let body: any;
953
- return new __HttpRequest({
954
- protocol,
955
- hostname,
956
- port,
957
- method: "DELETE",
958
- headers,
959
- path: resolvedPath,
960
- query,
961
- body,
962
- });
963
- };
964
-
965
- export const serializeAws_restJson1UpdateFileSystemCommand = async (
966
- input: UpdateFileSystemCommandInput,
967
- context: __SerdeContext
968
- ): Promise<__HttpRequest> => {
969
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
970
- const headers: any = {
971
- "content-type": "application/json",
972
- };
973
- let resolvedPath =
974
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2015-02-01/file-systems/{FileSystemId}";
975
- if (input.FileSystemId !== undefined) {
976
- const labelValue: string = input.FileSystemId;
977
- if (labelValue.length <= 0) {
978
- throw new Error("Empty value provided for input HTTP label: FileSystemId.");
979
- }
980
- resolvedPath = resolvedPath.replace("{FileSystemId}", __extendedEncodeURIComponent(labelValue));
981
- } else {
982
- throw new Error("No value provided for input HTTP label: FileSystemId.");
983
- }
984
- let body: any;
985
- body = JSON.stringify({
986
- ...(input.ProvisionedThroughputInMibps !== undefined &&
987
- input.ProvisionedThroughputInMibps !== null && {
988
- ProvisionedThroughputInMibps: __serializeFloat(input.ProvisionedThroughputInMibps),
989
- }),
990
- ...(input.ThroughputMode !== undefined &&
991
- input.ThroughputMode !== null && { ThroughputMode: input.ThroughputMode }),
992
- });
993
- return new __HttpRequest({
994
- protocol,
995
- hostname,
996
- port,
997
- method: "PUT",
998
- headers,
999
- path: resolvedPath,
1000
- body,
1001
- });
1002
- };
1003
-
1004
- export const deserializeAws_restJson1CreateAccessPointCommand = async (
1005
- output: __HttpResponse,
1006
- context: __SerdeContext
1007
- ): Promise<CreateAccessPointCommandOutput> => {
1008
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1009
- return deserializeAws_restJson1CreateAccessPointCommandError(output, context);
1010
- }
1011
- const contents: CreateAccessPointCommandOutput = {
1012
- $metadata: deserializeMetadata(output),
1013
- AccessPointArn: undefined,
1014
- AccessPointId: undefined,
1015
- ClientToken: undefined,
1016
- FileSystemId: undefined,
1017
- LifeCycleState: undefined,
1018
- Name: undefined,
1019
- OwnerId: undefined,
1020
- PosixUser: undefined,
1021
- RootDirectory: undefined,
1022
- Tags: undefined,
1023
- };
1024
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1025
- if (data.AccessPointArn !== undefined && data.AccessPointArn !== null) {
1026
- contents.AccessPointArn = __expectString(data.AccessPointArn);
1027
- }
1028
- if (data.AccessPointId !== undefined && data.AccessPointId !== null) {
1029
- contents.AccessPointId = __expectString(data.AccessPointId);
1030
- }
1031
- if (data.ClientToken !== undefined && data.ClientToken !== null) {
1032
- contents.ClientToken = __expectString(data.ClientToken);
1033
- }
1034
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
1035
- contents.FileSystemId = __expectString(data.FileSystemId);
1036
- }
1037
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
1038
- contents.LifeCycleState = __expectString(data.LifeCycleState);
1039
- }
1040
- if (data.Name !== undefined && data.Name !== null) {
1041
- contents.Name = __expectString(data.Name);
1042
- }
1043
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
1044
- contents.OwnerId = __expectString(data.OwnerId);
1045
- }
1046
- if (data.PosixUser !== undefined && data.PosixUser !== null) {
1047
- contents.PosixUser = deserializeAws_restJson1PosixUser(data.PosixUser, context);
1048
- }
1049
- if (data.RootDirectory !== undefined && data.RootDirectory !== null) {
1050
- contents.RootDirectory = deserializeAws_restJson1RootDirectory(data.RootDirectory, context);
1051
- }
1052
- if (data.Tags !== undefined && data.Tags !== null) {
1053
- contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
1054
- }
1055
- return Promise.resolve(contents);
1056
- };
1057
-
1058
- const deserializeAws_restJson1CreateAccessPointCommandError = async (
1059
- output: __HttpResponse,
1060
- context: __SerdeContext
1061
- ): Promise<CreateAccessPointCommandOutput> => {
1062
- const parsedOutput: any = {
1063
- ...output,
1064
- body: await parseBody(output.body, context),
1065
- };
1066
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1067
- let errorCode = "UnknownError";
1068
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1069
- switch (errorCode) {
1070
- case "AccessPointAlreadyExists":
1071
- case "com.amazonaws.efs#AccessPointAlreadyExists":
1072
- response = {
1073
- ...(await deserializeAws_restJson1AccessPointAlreadyExistsResponse(parsedOutput, context)),
1074
- name: errorCode,
1075
- $metadata: deserializeMetadata(output),
1076
- };
1077
- break;
1078
- case "AccessPointLimitExceeded":
1079
- case "com.amazonaws.efs#AccessPointLimitExceeded":
1080
- response = {
1081
- ...(await deserializeAws_restJson1AccessPointLimitExceededResponse(parsedOutput, context)),
1082
- name: errorCode,
1083
- $metadata: deserializeMetadata(output),
1084
- };
1085
- break;
1086
- case "BadRequest":
1087
- case "com.amazonaws.efs#BadRequest":
1088
- response = {
1089
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1090
- name: errorCode,
1091
- $metadata: deserializeMetadata(output),
1092
- };
1093
- break;
1094
- case "FileSystemNotFound":
1095
- case "com.amazonaws.efs#FileSystemNotFound":
1096
- response = {
1097
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1098
- name: errorCode,
1099
- $metadata: deserializeMetadata(output),
1100
- };
1101
- break;
1102
- case "IncorrectFileSystemLifeCycleState":
1103
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
1104
- response = {
1105
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
1106
- name: errorCode,
1107
- $metadata: deserializeMetadata(output),
1108
- };
1109
- break;
1110
- case "InternalServerError":
1111
- case "com.amazonaws.efs#InternalServerError":
1112
- response = {
1113
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1114
- name: errorCode,
1115
- $metadata: deserializeMetadata(output),
1116
- };
1117
- break;
1118
- default:
1119
- const parsedBody = parsedOutput.body;
1120
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1121
- response = {
1122
- ...parsedBody,
1123
- name: `${errorCode}`,
1124
- message: parsedBody.message || parsedBody.Message || errorCode,
1125
- $fault: "client",
1126
- $metadata: deserializeMetadata(output),
1127
- } as any;
1128
- }
1129
- const message = response.message || response.Message || errorCode;
1130
- response.message = message;
1131
- delete response.Message;
1132
- return Promise.reject(Object.assign(new Error(message), response));
1133
- };
1134
-
1135
- export const deserializeAws_restJson1CreateFileSystemCommand = async (
1136
- output: __HttpResponse,
1137
- context: __SerdeContext
1138
- ): Promise<CreateFileSystemCommandOutput> => {
1139
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1140
- return deserializeAws_restJson1CreateFileSystemCommandError(output, context);
1141
- }
1142
- const contents: CreateFileSystemCommandOutput = {
1143
- $metadata: deserializeMetadata(output),
1144
- AvailabilityZoneId: undefined,
1145
- AvailabilityZoneName: undefined,
1146
- CreationTime: undefined,
1147
- CreationToken: undefined,
1148
- Encrypted: undefined,
1149
- FileSystemArn: undefined,
1150
- FileSystemId: undefined,
1151
- KmsKeyId: undefined,
1152
- LifeCycleState: undefined,
1153
- Name: undefined,
1154
- NumberOfMountTargets: undefined,
1155
- OwnerId: undefined,
1156
- PerformanceMode: undefined,
1157
- ProvisionedThroughputInMibps: undefined,
1158
- SizeInBytes: undefined,
1159
- Tags: undefined,
1160
- ThroughputMode: undefined,
1161
- };
1162
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1163
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
1164
- contents.AvailabilityZoneId = __expectString(data.AvailabilityZoneId);
1165
- }
1166
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
1167
- contents.AvailabilityZoneName = __expectString(data.AvailabilityZoneName);
1168
- }
1169
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
1170
- contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
1171
- }
1172
- if (data.CreationToken !== undefined && data.CreationToken !== null) {
1173
- contents.CreationToken = __expectString(data.CreationToken);
1174
- }
1175
- if (data.Encrypted !== undefined && data.Encrypted !== null) {
1176
- contents.Encrypted = __expectBoolean(data.Encrypted);
1177
- }
1178
- if (data.FileSystemArn !== undefined && data.FileSystemArn !== null) {
1179
- contents.FileSystemArn = __expectString(data.FileSystemArn);
1180
- }
1181
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
1182
- contents.FileSystemId = __expectString(data.FileSystemId);
1183
- }
1184
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
1185
- contents.KmsKeyId = __expectString(data.KmsKeyId);
1186
- }
1187
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
1188
- contents.LifeCycleState = __expectString(data.LifeCycleState);
1189
- }
1190
- if (data.Name !== undefined && data.Name !== null) {
1191
- contents.Name = __expectString(data.Name);
1192
- }
1193
- if (data.NumberOfMountTargets !== undefined && data.NumberOfMountTargets !== null) {
1194
- contents.NumberOfMountTargets = __expectInt32(data.NumberOfMountTargets);
1195
- }
1196
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
1197
- contents.OwnerId = __expectString(data.OwnerId);
1198
- }
1199
- if (data.PerformanceMode !== undefined && data.PerformanceMode !== null) {
1200
- contents.PerformanceMode = __expectString(data.PerformanceMode);
1201
- }
1202
- if (data.ProvisionedThroughputInMibps !== undefined && data.ProvisionedThroughputInMibps !== null) {
1203
- contents.ProvisionedThroughputInMibps = __limitedParseDouble(data.ProvisionedThroughputInMibps);
1204
- }
1205
- if (data.SizeInBytes !== undefined && data.SizeInBytes !== null) {
1206
- contents.SizeInBytes = deserializeAws_restJson1FileSystemSize(data.SizeInBytes, context);
1207
- }
1208
- if (data.Tags !== undefined && data.Tags !== null) {
1209
- contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
1210
- }
1211
- if (data.ThroughputMode !== undefined && data.ThroughputMode !== null) {
1212
- contents.ThroughputMode = __expectString(data.ThroughputMode);
1213
- }
1214
- return Promise.resolve(contents);
1215
- };
1216
-
1217
- const deserializeAws_restJson1CreateFileSystemCommandError = async (
1218
- output: __HttpResponse,
1219
- context: __SerdeContext
1220
- ): Promise<CreateFileSystemCommandOutput> => {
1221
- const parsedOutput: any = {
1222
- ...output,
1223
- body: await parseBody(output.body, context),
1224
- };
1225
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1226
- let errorCode = "UnknownError";
1227
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1228
- switch (errorCode) {
1229
- case "BadRequest":
1230
- case "com.amazonaws.efs#BadRequest":
1231
- response = {
1232
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1233
- name: errorCode,
1234
- $metadata: deserializeMetadata(output),
1235
- };
1236
- break;
1237
- case "FileSystemAlreadyExists":
1238
- case "com.amazonaws.efs#FileSystemAlreadyExists":
1239
- response = {
1240
- ...(await deserializeAws_restJson1FileSystemAlreadyExistsResponse(parsedOutput, context)),
1241
- name: errorCode,
1242
- $metadata: deserializeMetadata(output),
1243
- };
1244
- break;
1245
- case "FileSystemLimitExceeded":
1246
- case "com.amazonaws.efs#FileSystemLimitExceeded":
1247
- response = {
1248
- ...(await deserializeAws_restJson1FileSystemLimitExceededResponse(parsedOutput, context)),
1249
- name: errorCode,
1250
- $metadata: deserializeMetadata(output),
1251
- };
1252
- break;
1253
- case "InsufficientThroughputCapacity":
1254
- case "com.amazonaws.efs#InsufficientThroughputCapacity":
1255
- response = {
1256
- ...(await deserializeAws_restJson1InsufficientThroughputCapacityResponse(parsedOutput, context)),
1257
- name: errorCode,
1258
- $metadata: deserializeMetadata(output),
1259
- };
1260
- break;
1261
- case "InternalServerError":
1262
- case "com.amazonaws.efs#InternalServerError":
1263
- response = {
1264
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1265
- name: errorCode,
1266
- $metadata: deserializeMetadata(output),
1267
- };
1268
- break;
1269
- case "ThroughputLimitExceeded":
1270
- case "com.amazonaws.efs#ThroughputLimitExceeded":
1271
- response = {
1272
- ...(await deserializeAws_restJson1ThroughputLimitExceededResponse(parsedOutput, context)),
1273
- name: errorCode,
1274
- $metadata: deserializeMetadata(output),
1275
- };
1276
- break;
1277
- case "UnsupportedAvailabilityZone":
1278
- case "com.amazonaws.efs#UnsupportedAvailabilityZone":
1279
- response = {
1280
- ...(await deserializeAws_restJson1UnsupportedAvailabilityZoneResponse(parsedOutput, context)),
1281
- name: errorCode,
1282
- $metadata: deserializeMetadata(output),
1283
- };
1284
- break;
1285
- default:
1286
- const parsedBody = parsedOutput.body;
1287
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1288
- response = {
1289
- ...parsedBody,
1290
- name: `${errorCode}`,
1291
- message: parsedBody.message || parsedBody.Message || errorCode,
1292
- $fault: "client",
1293
- $metadata: deserializeMetadata(output),
1294
- } as any;
1295
- }
1296
- const message = response.message || response.Message || errorCode;
1297
- response.message = message;
1298
- delete response.Message;
1299
- return Promise.reject(Object.assign(new Error(message), response));
1300
- };
1301
-
1302
- export const deserializeAws_restJson1CreateMountTargetCommand = async (
1303
- output: __HttpResponse,
1304
- context: __SerdeContext
1305
- ): Promise<CreateMountTargetCommandOutput> => {
1306
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1307
- return deserializeAws_restJson1CreateMountTargetCommandError(output, context);
1308
- }
1309
- const contents: CreateMountTargetCommandOutput = {
1310
- $metadata: deserializeMetadata(output),
1311
- AvailabilityZoneId: undefined,
1312
- AvailabilityZoneName: undefined,
1313
- FileSystemId: undefined,
1314
- IpAddress: undefined,
1315
- LifeCycleState: undefined,
1316
- MountTargetId: undefined,
1317
- NetworkInterfaceId: undefined,
1318
- OwnerId: undefined,
1319
- SubnetId: undefined,
1320
- VpcId: undefined,
1321
- };
1322
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1323
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
1324
- contents.AvailabilityZoneId = __expectString(data.AvailabilityZoneId);
1325
- }
1326
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
1327
- contents.AvailabilityZoneName = __expectString(data.AvailabilityZoneName);
1328
- }
1329
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
1330
- contents.FileSystemId = __expectString(data.FileSystemId);
1331
- }
1332
- if (data.IpAddress !== undefined && data.IpAddress !== null) {
1333
- contents.IpAddress = __expectString(data.IpAddress);
1334
- }
1335
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
1336
- contents.LifeCycleState = __expectString(data.LifeCycleState);
1337
- }
1338
- if (data.MountTargetId !== undefined && data.MountTargetId !== null) {
1339
- contents.MountTargetId = __expectString(data.MountTargetId);
1340
- }
1341
- if (data.NetworkInterfaceId !== undefined && data.NetworkInterfaceId !== null) {
1342
- contents.NetworkInterfaceId = __expectString(data.NetworkInterfaceId);
1343
- }
1344
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
1345
- contents.OwnerId = __expectString(data.OwnerId);
1346
- }
1347
- if (data.SubnetId !== undefined && data.SubnetId !== null) {
1348
- contents.SubnetId = __expectString(data.SubnetId);
1349
- }
1350
- if (data.VpcId !== undefined && data.VpcId !== null) {
1351
- contents.VpcId = __expectString(data.VpcId);
1352
- }
1353
- return Promise.resolve(contents);
1354
- };
1355
-
1356
- const deserializeAws_restJson1CreateMountTargetCommandError = async (
1357
- output: __HttpResponse,
1358
- context: __SerdeContext
1359
- ): Promise<CreateMountTargetCommandOutput> => {
1360
- const parsedOutput: any = {
1361
- ...output,
1362
- body: await parseBody(output.body, context),
1363
- };
1364
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1365
- let errorCode = "UnknownError";
1366
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1367
- switch (errorCode) {
1368
- case "AvailabilityZonesMismatch":
1369
- case "com.amazonaws.efs#AvailabilityZonesMismatch":
1370
- response = {
1371
- ...(await deserializeAws_restJson1AvailabilityZonesMismatchResponse(parsedOutput, context)),
1372
- name: errorCode,
1373
- $metadata: deserializeMetadata(output),
1374
- };
1375
- break;
1376
- case "BadRequest":
1377
- case "com.amazonaws.efs#BadRequest":
1378
- response = {
1379
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1380
- name: errorCode,
1381
- $metadata: deserializeMetadata(output),
1382
- };
1383
- break;
1384
- case "FileSystemNotFound":
1385
- case "com.amazonaws.efs#FileSystemNotFound":
1386
- response = {
1387
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1388
- name: errorCode,
1389
- $metadata: deserializeMetadata(output),
1390
- };
1391
- break;
1392
- case "IncorrectFileSystemLifeCycleState":
1393
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
1394
- response = {
1395
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
1396
- name: errorCode,
1397
- $metadata: deserializeMetadata(output),
1398
- };
1399
- break;
1400
- case "InternalServerError":
1401
- case "com.amazonaws.efs#InternalServerError":
1402
- response = {
1403
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1404
- name: errorCode,
1405
- $metadata: deserializeMetadata(output),
1406
- };
1407
- break;
1408
- case "IpAddressInUse":
1409
- case "com.amazonaws.efs#IpAddressInUse":
1410
- response = {
1411
- ...(await deserializeAws_restJson1IpAddressInUseResponse(parsedOutput, context)),
1412
- name: errorCode,
1413
- $metadata: deserializeMetadata(output),
1414
- };
1415
- break;
1416
- case "MountTargetConflict":
1417
- case "com.amazonaws.efs#MountTargetConflict":
1418
- response = {
1419
- ...(await deserializeAws_restJson1MountTargetConflictResponse(parsedOutput, context)),
1420
- name: errorCode,
1421
- $metadata: deserializeMetadata(output),
1422
- };
1423
- break;
1424
- case "NetworkInterfaceLimitExceeded":
1425
- case "com.amazonaws.efs#NetworkInterfaceLimitExceeded":
1426
- response = {
1427
- ...(await deserializeAws_restJson1NetworkInterfaceLimitExceededResponse(parsedOutput, context)),
1428
- name: errorCode,
1429
- $metadata: deserializeMetadata(output),
1430
- };
1431
- break;
1432
- case "NoFreeAddressesInSubnet":
1433
- case "com.amazonaws.efs#NoFreeAddressesInSubnet":
1434
- response = {
1435
- ...(await deserializeAws_restJson1NoFreeAddressesInSubnetResponse(parsedOutput, context)),
1436
- name: errorCode,
1437
- $metadata: deserializeMetadata(output),
1438
- };
1439
- break;
1440
- case "SecurityGroupLimitExceeded":
1441
- case "com.amazonaws.efs#SecurityGroupLimitExceeded":
1442
- response = {
1443
- ...(await deserializeAws_restJson1SecurityGroupLimitExceededResponse(parsedOutput, context)),
1444
- name: errorCode,
1445
- $metadata: deserializeMetadata(output),
1446
- };
1447
- break;
1448
- case "SecurityGroupNotFound":
1449
- case "com.amazonaws.efs#SecurityGroupNotFound":
1450
- response = {
1451
- ...(await deserializeAws_restJson1SecurityGroupNotFoundResponse(parsedOutput, context)),
1452
- name: errorCode,
1453
- $metadata: deserializeMetadata(output),
1454
- };
1455
- break;
1456
- case "SubnetNotFound":
1457
- case "com.amazonaws.efs#SubnetNotFound":
1458
- response = {
1459
- ...(await deserializeAws_restJson1SubnetNotFoundResponse(parsedOutput, context)),
1460
- name: errorCode,
1461
- $metadata: deserializeMetadata(output),
1462
- };
1463
- break;
1464
- case "UnsupportedAvailabilityZone":
1465
- case "com.amazonaws.efs#UnsupportedAvailabilityZone":
1466
- response = {
1467
- ...(await deserializeAws_restJson1UnsupportedAvailabilityZoneResponse(parsedOutput, context)),
1468
- name: errorCode,
1469
- $metadata: deserializeMetadata(output),
1470
- };
1471
- break;
1472
- default:
1473
- const parsedBody = parsedOutput.body;
1474
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1475
- response = {
1476
- ...parsedBody,
1477
- name: `${errorCode}`,
1478
- message: parsedBody.message || parsedBody.Message || errorCode,
1479
- $fault: "client",
1480
- $metadata: deserializeMetadata(output),
1481
- } as any;
1482
- }
1483
- const message = response.message || response.Message || errorCode;
1484
- response.message = message;
1485
- delete response.Message;
1486
- return Promise.reject(Object.assign(new Error(message), response));
1487
- };
1488
-
1489
- export const deserializeAws_restJson1CreateTagsCommand = async (
1490
- output: __HttpResponse,
1491
- context: __SerdeContext
1492
- ): Promise<CreateTagsCommandOutput> => {
1493
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1494
- return deserializeAws_restJson1CreateTagsCommandError(output, context);
1495
- }
1496
- const contents: CreateTagsCommandOutput = {
1497
- $metadata: deserializeMetadata(output),
1498
- };
1499
- await collectBody(output.body, context);
1500
- return Promise.resolve(contents);
1501
- };
1502
-
1503
- const deserializeAws_restJson1CreateTagsCommandError = async (
1504
- output: __HttpResponse,
1505
- context: __SerdeContext
1506
- ): Promise<CreateTagsCommandOutput> => {
1507
- const parsedOutput: any = {
1508
- ...output,
1509
- body: await parseBody(output.body, context),
1510
- };
1511
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1512
- let errorCode = "UnknownError";
1513
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1514
- switch (errorCode) {
1515
- case "BadRequest":
1516
- case "com.amazonaws.efs#BadRequest":
1517
- response = {
1518
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1519
- name: errorCode,
1520
- $metadata: deserializeMetadata(output),
1521
- };
1522
- break;
1523
- case "FileSystemNotFound":
1524
- case "com.amazonaws.efs#FileSystemNotFound":
1525
- response = {
1526
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1527
- name: errorCode,
1528
- $metadata: deserializeMetadata(output),
1529
- };
1530
- break;
1531
- case "InternalServerError":
1532
- case "com.amazonaws.efs#InternalServerError":
1533
- response = {
1534
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1535
- name: errorCode,
1536
- $metadata: deserializeMetadata(output),
1537
- };
1538
- break;
1539
- default:
1540
- const parsedBody = parsedOutput.body;
1541
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1542
- response = {
1543
- ...parsedBody,
1544
- name: `${errorCode}`,
1545
- message: parsedBody.message || parsedBody.Message || errorCode,
1546
- $fault: "client",
1547
- $metadata: deserializeMetadata(output),
1548
- } as any;
1549
- }
1550
- const message = response.message || response.Message || errorCode;
1551
- response.message = message;
1552
- delete response.Message;
1553
- return Promise.reject(Object.assign(new Error(message), response));
1554
- };
1555
-
1556
- export const deserializeAws_restJson1DeleteAccessPointCommand = async (
1557
- output: __HttpResponse,
1558
- context: __SerdeContext
1559
- ): Promise<DeleteAccessPointCommandOutput> => {
1560
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1561
- return deserializeAws_restJson1DeleteAccessPointCommandError(output, context);
1562
- }
1563
- const contents: DeleteAccessPointCommandOutput = {
1564
- $metadata: deserializeMetadata(output),
1565
- };
1566
- await collectBody(output.body, context);
1567
- return Promise.resolve(contents);
1568
- };
1569
-
1570
- const deserializeAws_restJson1DeleteAccessPointCommandError = async (
1571
- output: __HttpResponse,
1572
- context: __SerdeContext
1573
- ): Promise<DeleteAccessPointCommandOutput> => {
1574
- const parsedOutput: any = {
1575
- ...output,
1576
- body: await parseBody(output.body, context),
1577
- };
1578
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1579
- let errorCode = "UnknownError";
1580
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1581
- switch (errorCode) {
1582
- case "AccessPointNotFound":
1583
- case "com.amazonaws.efs#AccessPointNotFound":
1584
- response = {
1585
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
1586
- name: errorCode,
1587
- $metadata: deserializeMetadata(output),
1588
- };
1589
- break;
1590
- case "BadRequest":
1591
- case "com.amazonaws.efs#BadRequest":
1592
- response = {
1593
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1594
- name: errorCode,
1595
- $metadata: deserializeMetadata(output),
1596
- };
1597
- break;
1598
- case "InternalServerError":
1599
- case "com.amazonaws.efs#InternalServerError":
1600
- response = {
1601
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1602
- name: errorCode,
1603
- $metadata: deserializeMetadata(output),
1604
- };
1605
- break;
1606
- default:
1607
- const parsedBody = parsedOutput.body;
1608
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1609
- response = {
1610
- ...parsedBody,
1611
- name: `${errorCode}`,
1612
- message: parsedBody.message || parsedBody.Message || errorCode,
1613
- $fault: "client",
1614
- $metadata: deserializeMetadata(output),
1615
- } as any;
1616
- }
1617
- const message = response.message || response.Message || errorCode;
1618
- response.message = message;
1619
- delete response.Message;
1620
- return Promise.reject(Object.assign(new Error(message), response));
1621
- };
1622
-
1623
- export const deserializeAws_restJson1DeleteFileSystemCommand = async (
1624
- output: __HttpResponse,
1625
- context: __SerdeContext
1626
- ): Promise<DeleteFileSystemCommandOutput> => {
1627
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1628
- return deserializeAws_restJson1DeleteFileSystemCommandError(output, context);
1629
- }
1630
- const contents: DeleteFileSystemCommandOutput = {
1631
- $metadata: deserializeMetadata(output),
1632
- };
1633
- await collectBody(output.body, context);
1634
- return Promise.resolve(contents);
1635
- };
1636
-
1637
- const deserializeAws_restJson1DeleteFileSystemCommandError = async (
1638
- output: __HttpResponse,
1639
- context: __SerdeContext
1640
- ): Promise<DeleteFileSystemCommandOutput> => {
1641
- const parsedOutput: any = {
1642
- ...output,
1643
- body: await parseBody(output.body, context),
1644
- };
1645
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1646
- let errorCode = "UnknownError";
1647
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1648
- switch (errorCode) {
1649
- case "BadRequest":
1650
- case "com.amazonaws.efs#BadRequest":
1651
- response = {
1652
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1653
- name: errorCode,
1654
- $metadata: deserializeMetadata(output),
1655
- };
1656
- break;
1657
- case "FileSystemInUse":
1658
- case "com.amazonaws.efs#FileSystemInUse":
1659
- response = {
1660
- ...(await deserializeAws_restJson1FileSystemInUseResponse(parsedOutput, context)),
1661
- name: errorCode,
1662
- $metadata: deserializeMetadata(output),
1663
- };
1664
- break;
1665
- case "FileSystemNotFound":
1666
- case "com.amazonaws.efs#FileSystemNotFound":
1667
- response = {
1668
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1669
- name: errorCode,
1670
- $metadata: deserializeMetadata(output),
1671
- };
1672
- break;
1673
- case "InternalServerError":
1674
- case "com.amazonaws.efs#InternalServerError":
1675
- response = {
1676
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1677
- name: errorCode,
1678
- $metadata: deserializeMetadata(output),
1679
- };
1680
- break;
1681
- default:
1682
- const parsedBody = parsedOutput.body;
1683
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1684
- response = {
1685
- ...parsedBody,
1686
- name: `${errorCode}`,
1687
- message: parsedBody.message || parsedBody.Message || errorCode,
1688
- $fault: "client",
1689
- $metadata: deserializeMetadata(output),
1690
- } as any;
1691
- }
1692
- const message = response.message || response.Message || errorCode;
1693
- response.message = message;
1694
- delete response.Message;
1695
- return Promise.reject(Object.assign(new Error(message), response));
1696
- };
1697
-
1698
- export const deserializeAws_restJson1DeleteFileSystemPolicyCommand = async (
1699
- output: __HttpResponse,
1700
- context: __SerdeContext
1701
- ): Promise<DeleteFileSystemPolicyCommandOutput> => {
1702
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1703
- return deserializeAws_restJson1DeleteFileSystemPolicyCommandError(output, context);
1704
- }
1705
- const contents: DeleteFileSystemPolicyCommandOutput = {
1706
- $metadata: deserializeMetadata(output),
1707
- };
1708
- await collectBody(output.body, context);
1709
- return Promise.resolve(contents);
1710
- };
1711
-
1712
- const deserializeAws_restJson1DeleteFileSystemPolicyCommandError = async (
1713
- output: __HttpResponse,
1714
- context: __SerdeContext
1715
- ): Promise<DeleteFileSystemPolicyCommandOutput> => {
1716
- const parsedOutput: any = {
1717
- ...output,
1718
- body: await parseBody(output.body, context),
1719
- };
1720
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1721
- let errorCode = "UnknownError";
1722
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1723
- switch (errorCode) {
1724
- case "FileSystemNotFound":
1725
- case "com.amazonaws.efs#FileSystemNotFound":
1726
- response = {
1727
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1728
- name: errorCode,
1729
- $metadata: deserializeMetadata(output),
1730
- };
1731
- break;
1732
- case "IncorrectFileSystemLifeCycleState":
1733
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
1734
- response = {
1735
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
1736
- name: errorCode,
1737
- $metadata: deserializeMetadata(output),
1738
- };
1739
- break;
1740
- case "InternalServerError":
1741
- case "com.amazonaws.efs#InternalServerError":
1742
- response = {
1743
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1744
- name: errorCode,
1745
- $metadata: deserializeMetadata(output),
1746
- };
1747
- break;
1748
- default:
1749
- const parsedBody = parsedOutput.body;
1750
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1751
- response = {
1752
- ...parsedBody,
1753
- name: `${errorCode}`,
1754
- message: parsedBody.message || parsedBody.Message || errorCode,
1755
- $fault: "client",
1756
- $metadata: deserializeMetadata(output),
1757
- } as any;
1758
- }
1759
- const message = response.message || response.Message || errorCode;
1760
- response.message = message;
1761
- delete response.Message;
1762
- return Promise.reject(Object.assign(new Error(message), response));
1763
- };
1764
-
1765
- export const deserializeAws_restJson1DeleteMountTargetCommand = async (
1766
- output: __HttpResponse,
1767
- context: __SerdeContext
1768
- ): Promise<DeleteMountTargetCommandOutput> => {
1769
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1770
- return deserializeAws_restJson1DeleteMountTargetCommandError(output, context);
1771
- }
1772
- const contents: DeleteMountTargetCommandOutput = {
1773
- $metadata: deserializeMetadata(output),
1774
- };
1775
- await collectBody(output.body, context);
1776
- return Promise.resolve(contents);
1777
- };
1778
-
1779
- const deserializeAws_restJson1DeleteMountTargetCommandError = async (
1780
- output: __HttpResponse,
1781
- context: __SerdeContext
1782
- ): Promise<DeleteMountTargetCommandOutput> => {
1783
- const parsedOutput: any = {
1784
- ...output,
1785
- body: await parseBody(output.body, context),
1786
- };
1787
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1788
- let errorCode = "UnknownError";
1789
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1790
- switch (errorCode) {
1791
- case "BadRequest":
1792
- case "com.amazonaws.efs#BadRequest":
1793
- response = {
1794
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1795
- name: errorCode,
1796
- $metadata: deserializeMetadata(output),
1797
- };
1798
- break;
1799
- case "DependencyTimeout":
1800
- case "com.amazonaws.efs#DependencyTimeout":
1801
- response = {
1802
- ...(await deserializeAws_restJson1DependencyTimeoutResponse(parsedOutput, context)),
1803
- name: errorCode,
1804
- $metadata: deserializeMetadata(output),
1805
- };
1806
- break;
1807
- case "InternalServerError":
1808
- case "com.amazonaws.efs#InternalServerError":
1809
- response = {
1810
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1811
- name: errorCode,
1812
- $metadata: deserializeMetadata(output),
1813
- };
1814
- break;
1815
- case "MountTargetNotFound":
1816
- case "com.amazonaws.efs#MountTargetNotFound":
1817
- response = {
1818
- ...(await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context)),
1819
- name: errorCode,
1820
- $metadata: deserializeMetadata(output),
1821
- };
1822
- break;
1823
- default:
1824
- const parsedBody = parsedOutput.body;
1825
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1826
- response = {
1827
- ...parsedBody,
1828
- name: `${errorCode}`,
1829
- message: parsedBody.message || parsedBody.Message || errorCode,
1830
- $fault: "client",
1831
- $metadata: deserializeMetadata(output),
1832
- } as any;
1833
- }
1834
- const message = response.message || response.Message || errorCode;
1835
- response.message = message;
1836
- delete response.Message;
1837
- return Promise.reject(Object.assign(new Error(message), response));
1838
- };
1839
-
1840
- export const deserializeAws_restJson1DeleteTagsCommand = async (
1841
- output: __HttpResponse,
1842
- context: __SerdeContext
1843
- ): Promise<DeleteTagsCommandOutput> => {
1844
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1845
- return deserializeAws_restJson1DeleteTagsCommandError(output, context);
1846
- }
1847
- const contents: DeleteTagsCommandOutput = {
1848
- $metadata: deserializeMetadata(output),
1849
- };
1850
- await collectBody(output.body, context);
1851
- return Promise.resolve(contents);
1852
- };
1853
-
1854
- const deserializeAws_restJson1DeleteTagsCommandError = async (
1855
- output: __HttpResponse,
1856
- context: __SerdeContext
1857
- ): Promise<DeleteTagsCommandOutput> => {
1858
- const parsedOutput: any = {
1859
- ...output,
1860
- body: await parseBody(output.body, context),
1861
- };
1862
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1863
- let errorCode = "UnknownError";
1864
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1865
- switch (errorCode) {
1866
- case "BadRequest":
1867
- case "com.amazonaws.efs#BadRequest":
1868
- response = {
1869
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1870
- name: errorCode,
1871
- $metadata: deserializeMetadata(output),
1872
- };
1873
- break;
1874
- case "FileSystemNotFound":
1875
- case "com.amazonaws.efs#FileSystemNotFound":
1876
- response = {
1877
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1878
- name: errorCode,
1879
- $metadata: deserializeMetadata(output),
1880
- };
1881
- break;
1882
- case "InternalServerError":
1883
- case "com.amazonaws.efs#InternalServerError":
1884
- response = {
1885
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1886
- name: errorCode,
1887
- $metadata: deserializeMetadata(output),
1888
- };
1889
- break;
1890
- default:
1891
- const parsedBody = parsedOutput.body;
1892
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1893
- response = {
1894
- ...parsedBody,
1895
- name: `${errorCode}`,
1896
- message: parsedBody.message || parsedBody.Message || errorCode,
1897
- $fault: "client",
1898
- $metadata: deserializeMetadata(output),
1899
- } as any;
1900
- }
1901
- const message = response.message || response.Message || errorCode;
1902
- response.message = message;
1903
- delete response.Message;
1904
- return Promise.reject(Object.assign(new Error(message), response));
1905
- };
1906
-
1907
- export const deserializeAws_restJson1DescribeAccessPointsCommand = async (
1908
- output: __HttpResponse,
1909
- context: __SerdeContext
1910
- ): Promise<DescribeAccessPointsCommandOutput> => {
1911
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1912
- return deserializeAws_restJson1DescribeAccessPointsCommandError(output, context);
1913
- }
1914
- const contents: DescribeAccessPointsCommandOutput = {
1915
- $metadata: deserializeMetadata(output),
1916
- AccessPoints: undefined,
1917
- NextToken: undefined,
1918
- };
1919
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1920
- if (data.AccessPoints !== undefined && data.AccessPoints !== null) {
1921
- contents.AccessPoints = deserializeAws_restJson1AccessPointDescriptions(data.AccessPoints, context);
1922
- }
1923
- if (data.NextToken !== undefined && data.NextToken !== null) {
1924
- contents.NextToken = __expectString(data.NextToken);
1925
- }
1926
- return Promise.resolve(contents);
1927
- };
1928
-
1929
- const deserializeAws_restJson1DescribeAccessPointsCommandError = async (
1930
- output: __HttpResponse,
1931
- context: __SerdeContext
1932
- ): Promise<DescribeAccessPointsCommandOutput> => {
1933
- const parsedOutput: any = {
1934
- ...output,
1935
- body: await parseBody(output.body, context),
1936
- };
1937
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1938
- let errorCode = "UnknownError";
1939
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1940
- switch (errorCode) {
1941
- case "AccessPointNotFound":
1942
- case "com.amazonaws.efs#AccessPointNotFound":
1943
- response = {
1944
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
1945
- name: errorCode,
1946
- $metadata: deserializeMetadata(output),
1947
- };
1948
- break;
1949
- case "BadRequest":
1950
- case "com.amazonaws.efs#BadRequest":
1951
- response = {
1952
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
1953
- name: errorCode,
1954
- $metadata: deserializeMetadata(output),
1955
- };
1956
- break;
1957
- case "FileSystemNotFound":
1958
- case "com.amazonaws.efs#FileSystemNotFound":
1959
- response = {
1960
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
1961
- name: errorCode,
1962
- $metadata: deserializeMetadata(output),
1963
- };
1964
- break;
1965
- case "InternalServerError":
1966
- case "com.amazonaws.efs#InternalServerError":
1967
- response = {
1968
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
1969
- name: errorCode,
1970
- $metadata: deserializeMetadata(output),
1971
- };
1972
- break;
1973
- default:
1974
- const parsedBody = parsedOutput.body;
1975
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1976
- response = {
1977
- ...parsedBody,
1978
- name: `${errorCode}`,
1979
- message: parsedBody.message || parsedBody.Message || errorCode,
1980
- $fault: "client",
1981
- $metadata: deserializeMetadata(output),
1982
- } as any;
1983
- }
1984
- const message = response.message || response.Message || errorCode;
1985
- response.message = message;
1986
- delete response.Message;
1987
- return Promise.reject(Object.assign(new Error(message), response));
1988
- };
1989
-
1990
- export const deserializeAws_restJson1DescribeAccountPreferencesCommand = async (
1991
- output: __HttpResponse,
1992
- context: __SerdeContext
1993
- ): Promise<DescribeAccountPreferencesCommandOutput> => {
1994
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1995
- return deserializeAws_restJson1DescribeAccountPreferencesCommandError(output, context);
1996
- }
1997
- const contents: DescribeAccountPreferencesCommandOutput = {
1998
- $metadata: deserializeMetadata(output),
1999
- NextToken: undefined,
2000
- ResourceIdPreference: undefined,
2001
- };
2002
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2003
- if (data.NextToken !== undefined && data.NextToken !== null) {
2004
- contents.NextToken = __expectString(data.NextToken);
2005
- }
2006
- if (data.ResourceIdPreference !== undefined && data.ResourceIdPreference !== null) {
2007
- contents.ResourceIdPreference = deserializeAws_restJson1ResourceIdPreference(data.ResourceIdPreference, context);
2008
- }
2009
- return Promise.resolve(contents);
2010
- };
2011
-
2012
- const deserializeAws_restJson1DescribeAccountPreferencesCommandError = async (
2013
- output: __HttpResponse,
2014
- context: __SerdeContext
2015
- ): Promise<DescribeAccountPreferencesCommandOutput> => {
2016
- const parsedOutput: any = {
2017
- ...output,
2018
- body: await parseBody(output.body, context),
2019
- };
2020
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2021
- let errorCode = "UnknownError";
2022
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2023
- switch (errorCode) {
2024
- case "InternalServerError":
2025
- case "com.amazonaws.efs#InternalServerError":
2026
- response = {
2027
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2028
- name: errorCode,
2029
- $metadata: deserializeMetadata(output),
2030
- };
2031
- break;
2032
- default:
2033
- const parsedBody = parsedOutput.body;
2034
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2035
- response = {
2036
- ...parsedBody,
2037
- name: `${errorCode}`,
2038
- message: parsedBody.message || parsedBody.Message || errorCode,
2039
- $fault: "client",
2040
- $metadata: deserializeMetadata(output),
2041
- } as any;
2042
- }
2043
- const message = response.message || response.Message || errorCode;
2044
- response.message = message;
2045
- delete response.Message;
2046
- return Promise.reject(Object.assign(new Error(message), response));
2047
- };
2048
-
2049
- export const deserializeAws_restJson1DescribeBackupPolicyCommand = async (
2050
- output: __HttpResponse,
2051
- context: __SerdeContext
2052
- ): Promise<DescribeBackupPolicyCommandOutput> => {
2053
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2054
- return deserializeAws_restJson1DescribeBackupPolicyCommandError(output, context);
2055
- }
2056
- const contents: DescribeBackupPolicyCommandOutput = {
2057
- $metadata: deserializeMetadata(output),
2058
- BackupPolicy: undefined,
2059
- };
2060
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2061
- if (data.BackupPolicy !== undefined && data.BackupPolicy !== null) {
2062
- contents.BackupPolicy = deserializeAws_restJson1BackupPolicy(data.BackupPolicy, context);
2063
- }
2064
- return Promise.resolve(contents);
2065
- };
2066
-
2067
- const deserializeAws_restJson1DescribeBackupPolicyCommandError = async (
2068
- output: __HttpResponse,
2069
- context: __SerdeContext
2070
- ): Promise<DescribeBackupPolicyCommandOutput> => {
2071
- const parsedOutput: any = {
2072
- ...output,
2073
- body: await parseBody(output.body, context),
2074
- };
2075
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2076
- let errorCode = "UnknownError";
2077
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2078
- switch (errorCode) {
2079
- case "BadRequest":
2080
- case "com.amazonaws.efs#BadRequest":
2081
- response = {
2082
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2083
- name: errorCode,
2084
- $metadata: deserializeMetadata(output),
2085
- };
2086
- break;
2087
- case "FileSystemNotFound":
2088
- case "com.amazonaws.efs#FileSystemNotFound":
2089
- response = {
2090
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2091
- name: errorCode,
2092
- $metadata: deserializeMetadata(output),
2093
- };
2094
- break;
2095
- case "InternalServerError":
2096
- case "com.amazonaws.efs#InternalServerError":
2097
- response = {
2098
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2099
- name: errorCode,
2100
- $metadata: deserializeMetadata(output),
2101
- };
2102
- break;
2103
- case "PolicyNotFound":
2104
- case "com.amazonaws.efs#PolicyNotFound":
2105
- response = {
2106
- ...(await deserializeAws_restJson1PolicyNotFoundResponse(parsedOutput, context)),
2107
- name: errorCode,
2108
- $metadata: deserializeMetadata(output),
2109
- };
2110
- break;
2111
- case "ValidationException":
2112
- case "com.amazonaws.efs#ValidationException":
2113
- response = {
2114
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2115
- name: errorCode,
2116
- $metadata: deserializeMetadata(output),
2117
- };
2118
- break;
2119
- default:
2120
- const parsedBody = parsedOutput.body;
2121
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2122
- response = {
2123
- ...parsedBody,
2124
- name: `${errorCode}`,
2125
- message: parsedBody.message || parsedBody.Message || errorCode,
2126
- $fault: "client",
2127
- $metadata: deserializeMetadata(output),
2128
- } as any;
2129
- }
2130
- const message = response.message || response.Message || errorCode;
2131
- response.message = message;
2132
- delete response.Message;
2133
- return Promise.reject(Object.assign(new Error(message), response));
2134
- };
2135
-
2136
- export const deserializeAws_restJson1DescribeFileSystemPolicyCommand = async (
2137
- output: __HttpResponse,
2138
- context: __SerdeContext
2139
- ): Promise<DescribeFileSystemPolicyCommandOutput> => {
2140
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2141
- return deserializeAws_restJson1DescribeFileSystemPolicyCommandError(output, context);
2142
- }
2143
- const contents: DescribeFileSystemPolicyCommandOutput = {
2144
- $metadata: deserializeMetadata(output),
2145
- FileSystemId: undefined,
2146
- Policy: undefined,
2147
- };
2148
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2149
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
2150
- contents.FileSystemId = __expectString(data.FileSystemId);
2151
- }
2152
- if (data.Policy !== undefined && data.Policy !== null) {
2153
- contents.Policy = __expectString(data.Policy);
2154
- }
2155
- return Promise.resolve(contents);
2156
- };
2157
-
2158
- const deserializeAws_restJson1DescribeFileSystemPolicyCommandError = async (
2159
- output: __HttpResponse,
2160
- context: __SerdeContext
2161
- ): Promise<DescribeFileSystemPolicyCommandOutput> => {
2162
- const parsedOutput: any = {
2163
- ...output,
2164
- body: await parseBody(output.body, context),
2165
- };
2166
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2167
- let errorCode = "UnknownError";
2168
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2169
- switch (errorCode) {
2170
- case "FileSystemNotFound":
2171
- case "com.amazonaws.efs#FileSystemNotFound":
2172
- response = {
2173
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2174
- name: errorCode,
2175
- $metadata: deserializeMetadata(output),
2176
- };
2177
- break;
2178
- case "InternalServerError":
2179
- case "com.amazonaws.efs#InternalServerError":
2180
- response = {
2181
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2182
- name: errorCode,
2183
- $metadata: deserializeMetadata(output),
2184
- };
2185
- break;
2186
- case "PolicyNotFound":
2187
- case "com.amazonaws.efs#PolicyNotFound":
2188
- response = {
2189
- ...(await deserializeAws_restJson1PolicyNotFoundResponse(parsedOutput, context)),
2190
- name: errorCode,
2191
- $metadata: deserializeMetadata(output),
2192
- };
2193
- break;
2194
- default:
2195
- const parsedBody = parsedOutput.body;
2196
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2197
- response = {
2198
- ...parsedBody,
2199
- name: `${errorCode}`,
2200
- message: parsedBody.message || parsedBody.Message || errorCode,
2201
- $fault: "client",
2202
- $metadata: deserializeMetadata(output),
2203
- } as any;
2204
- }
2205
- const message = response.message || response.Message || errorCode;
2206
- response.message = message;
2207
- delete response.Message;
2208
- return Promise.reject(Object.assign(new Error(message), response));
2209
- };
2210
-
2211
- export const deserializeAws_restJson1DescribeFileSystemsCommand = async (
2212
- output: __HttpResponse,
2213
- context: __SerdeContext
2214
- ): Promise<DescribeFileSystemsCommandOutput> => {
2215
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2216
- return deserializeAws_restJson1DescribeFileSystemsCommandError(output, context);
2217
- }
2218
- const contents: DescribeFileSystemsCommandOutput = {
2219
- $metadata: deserializeMetadata(output),
2220
- FileSystems: undefined,
2221
- Marker: undefined,
2222
- NextMarker: undefined,
2223
- };
2224
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2225
- if (data.FileSystems !== undefined && data.FileSystems !== null) {
2226
- contents.FileSystems = deserializeAws_restJson1FileSystemDescriptions(data.FileSystems, context);
2227
- }
2228
- if (data.Marker !== undefined && data.Marker !== null) {
2229
- contents.Marker = __expectString(data.Marker);
2230
- }
2231
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
2232
- contents.NextMarker = __expectString(data.NextMarker);
2233
- }
2234
- return Promise.resolve(contents);
2235
- };
2236
-
2237
- const deserializeAws_restJson1DescribeFileSystemsCommandError = async (
2238
- output: __HttpResponse,
2239
- context: __SerdeContext
2240
- ): Promise<DescribeFileSystemsCommandOutput> => {
2241
- const parsedOutput: any = {
2242
- ...output,
2243
- body: await parseBody(output.body, context),
2244
- };
2245
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2246
- let errorCode = "UnknownError";
2247
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2248
- switch (errorCode) {
2249
- case "BadRequest":
2250
- case "com.amazonaws.efs#BadRequest":
2251
- response = {
2252
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2253
- name: errorCode,
2254
- $metadata: deserializeMetadata(output),
2255
- };
2256
- break;
2257
- case "FileSystemNotFound":
2258
- case "com.amazonaws.efs#FileSystemNotFound":
2259
- response = {
2260
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2261
- name: errorCode,
2262
- $metadata: deserializeMetadata(output),
2263
- };
2264
- break;
2265
- case "InternalServerError":
2266
- case "com.amazonaws.efs#InternalServerError":
2267
- response = {
2268
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2269
- name: errorCode,
2270
- $metadata: deserializeMetadata(output),
2271
- };
2272
- break;
2273
- default:
2274
- const parsedBody = parsedOutput.body;
2275
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2276
- response = {
2277
- ...parsedBody,
2278
- name: `${errorCode}`,
2279
- message: parsedBody.message || parsedBody.Message || errorCode,
2280
- $fault: "client",
2281
- $metadata: deserializeMetadata(output),
2282
- } as any;
2283
- }
2284
- const message = response.message || response.Message || errorCode;
2285
- response.message = message;
2286
- delete response.Message;
2287
- return Promise.reject(Object.assign(new Error(message), response));
2288
- };
2289
-
2290
- export const deserializeAws_restJson1DescribeLifecycleConfigurationCommand = async (
2291
- output: __HttpResponse,
2292
- context: __SerdeContext
2293
- ): Promise<DescribeLifecycleConfigurationCommandOutput> => {
2294
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2295
- return deserializeAws_restJson1DescribeLifecycleConfigurationCommandError(output, context);
2296
- }
2297
- const contents: DescribeLifecycleConfigurationCommandOutput = {
2298
- $metadata: deserializeMetadata(output),
2299
- LifecyclePolicies: undefined,
2300
- };
2301
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2302
- if (data.LifecyclePolicies !== undefined && data.LifecyclePolicies !== null) {
2303
- contents.LifecyclePolicies = deserializeAws_restJson1LifecyclePolicies(data.LifecyclePolicies, context);
2304
- }
2305
- return Promise.resolve(contents);
2306
- };
2307
-
2308
- const deserializeAws_restJson1DescribeLifecycleConfigurationCommandError = async (
2309
- output: __HttpResponse,
2310
- context: __SerdeContext
2311
- ): Promise<DescribeLifecycleConfigurationCommandOutput> => {
2312
- const parsedOutput: any = {
2313
- ...output,
2314
- body: await parseBody(output.body, context),
2315
- };
2316
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2317
- let errorCode = "UnknownError";
2318
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2319
- switch (errorCode) {
2320
- case "BadRequest":
2321
- case "com.amazonaws.efs#BadRequest":
2322
- response = {
2323
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2324
- name: errorCode,
2325
- $metadata: deserializeMetadata(output),
2326
- };
2327
- break;
2328
- case "FileSystemNotFound":
2329
- case "com.amazonaws.efs#FileSystemNotFound":
2330
- response = {
2331
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2332
- name: errorCode,
2333
- $metadata: deserializeMetadata(output),
2334
- };
2335
- break;
2336
- case "InternalServerError":
2337
- case "com.amazonaws.efs#InternalServerError":
2338
- response = {
2339
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2340
- name: errorCode,
2341
- $metadata: deserializeMetadata(output),
2342
- };
2343
- break;
2344
- default:
2345
- const parsedBody = parsedOutput.body;
2346
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2347
- response = {
2348
- ...parsedBody,
2349
- name: `${errorCode}`,
2350
- message: parsedBody.message || parsedBody.Message || errorCode,
2351
- $fault: "client",
2352
- $metadata: deserializeMetadata(output),
2353
- } as any;
2354
- }
2355
- const message = response.message || response.Message || errorCode;
2356
- response.message = message;
2357
- delete response.Message;
2358
- return Promise.reject(Object.assign(new Error(message), response));
2359
- };
2360
-
2361
- export const deserializeAws_restJson1DescribeMountTargetsCommand = async (
2362
- output: __HttpResponse,
2363
- context: __SerdeContext
2364
- ): Promise<DescribeMountTargetsCommandOutput> => {
2365
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2366
- return deserializeAws_restJson1DescribeMountTargetsCommandError(output, context);
2367
- }
2368
- const contents: DescribeMountTargetsCommandOutput = {
2369
- $metadata: deserializeMetadata(output),
2370
- Marker: undefined,
2371
- MountTargets: undefined,
2372
- NextMarker: undefined,
2373
- };
2374
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2375
- if (data.Marker !== undefined && data.Marker !== null) {
2376
- contents.Marker = __expectString(data.Marker);
2377
- }
2378
- if (data.MountTargets !== undefined && data.MountTargets !== null) {
2379
- contents.MountTargets = deserializeAws_restJson1MountTargetDescriptions(data.MountTargets, context);
2380
- }
2381
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
2382
- contents.NextMarker = __expectString(data.NextMarker);
2383
- }
2384
- return Promise.resolve(contents);
2385
- };
2386
-
2387
- const deserializeAws_restJson1DescribeMountTargetsCommandError = async (
2388
- output: __HttpResponse,
2389
- context: __SerdeContext
2390
- ): Promise<DescribeMountTargetsCommandOutput> => {
2391
- const parsedOutput: any = {
2392
- ...output,
2393
- body: await parseBody(output.body, context),
2394
- };
2395
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2396
- let errorCode = "UnknownError";
2397
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2398
- switch (errorCode) {
2399
- case "AccessPointNotFound":
2400
- case "com.amazonaws.efs#AccessPointNotFound":
2401
- response = {
2402
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
2403
- name: errorCode,
2404
- $metadata: deserializeMetadata(output),
2405
- };
2406
- break;
2407
- case "BadRequest":
2408
- case "com.amazonaws.efs#BadRequest":
2409
- response = {
2410
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2411
- name: errorCode,
2412
- $metadata: deserializeMetadata(output),
2413
- };
2414
- break;
2415
- case "FileSystemNotFound":
2416
- case "com.amazonaws.efs#FileSystemNotFound":
2417
- response = {
2418
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2419
- name: errorCode,
2420
- $metadata: deserializeMetadata(output),
2421
- };
2422
- break;
2423
- case "InternalServerError":
2424
- case "com.amazonaws.efs#InternalServerError":
2425
- response = {
2426
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2427
- name: errorCode,
2428
- $metadata: deserializeMetadata(output),
2429
- };
2430
- break;
2431
- case "MountTargetNotFound":
2432
- case "com.amazonaws.efs#MountTargetNotFound":
2433
- response = {
2434
- ...(await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context)),
2435
- name: errorCode,
2436
- $metadata: deserializeMetadata(output),
2437
- };
2438
- break;
2439
- default:
2440
- const parsedBody = parsedOutput.body;
2441
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2442
- response = {
2443
- ...parsedBody,
2444
- name: `${errorCode}`,
2445
- message: parsedBody.message || parsedBody.Message || errorCode,
2446
- $fault: "client",
2447
- $metadata: deserializeMetadata(output),
2448
- } as any;
2449
- }
2450
- const message = response.message || response.Message || errorCode;
2451
- response.message = message;
2452
- delete response.Message;
2453
- return Promise.reject(Object.assign(new Error(message), response));
2454
- };
2455
-
2456
- export const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommand = async (
2457
- output: __HttpResponse,
2458
- context: __SerdeContext
2459
- ): Promise<DescribeMountTargetSecurityGroupsCommandOutput> => {
2460
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2461
- return deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError(output, context);
2462
- }
2463
- const contents: DescribeMountTargetSecurityGroupsCommandOutput = {
2464
- $metadata: deserializeMetadata(output),
2465
- SecurityGroups: undefined,
2466
- };
2467
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2468
- if (data.SecurityGroups !== undefined && data.SecurityGroups !== null) {
2469
- contents.SecurityGroups = deserializeAws_restJson1SecurityGroups(data.SecurityGroups, context);
2470
- }
2471
- return Promise.resolve(contents);
2472
- };
2473
-
2474
- const deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError = async (
2475
- output: __HttpResponse,
2476
- context: __SerdeContext
2477
- ): Promise<DescribeMountTargetSecurityGroupsCommandOutput> => {
2478
- const parsedOutput: any = {
2479
- ...output,
2480
- body: await parseBody(output.body, context),
2481
- };
2482
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2483
- let errorCode = "UnknownError";
2484
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2485
- switch (errorCode) {
2486
- case "BadRequest":
2487
- case "com.amazonaws.efs#BadRequest":
2488
- response = {
2489
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2490
- name: errorCode,
2491
- $metadata: deserializeMetadata(output),
2492
- };
2493
- break;
2494
- case "IncorrectMountTargetState":
2495
- case "com.amazonaws.efs#IncorrectMountTargetState":
2496
- response = {
2497
- ...(await deserializeAws_restJson1IncorrectMountTargetStateResponse(parsedOutput, context)),
2498
- name: errorCode,
2499
- $metadata: deserializeMetadata(output),
2500
- };
2501
- break;
2502
- case "InternalServerError":
2503
- case "com.amazonaws.efs#InternalServerError":
2504
- response = {
2505
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2506
- name: errorCode,
2507
- $metadata: deserializeMetadata(output),
2508
- };
2509
- break;
2510
- case "MountTargetNotFound":
2511
- case "com.amazonaws.efs#MountTargetNotFound":
2512
- response = {
2513
- ...(await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context)),
2514
- name: errorCode,
2515
- $metadata: deserializeMetadata(output),
2516
- };
2517
- break;
2518
- default:
2519
- const parsedBody = parsedOutput.body;
2520
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2521
- response = {
2522
- ...parsedBody,
2523
- name: `${errorCode}`,
2524
- message: parsedBody.message || parsedBody.Message || errorCode,
2525
- $fault: "client",
2526
- $metadata: deserializeMetadata(output),
2527
- } as any;
2528
- }
2529
- const message = response.message || response.Message || errorCode;
2530
- response.message = message;
2531
- delete response.Message;
2532
- return Promise.reject(Object.assign(new Error(message), response));
2533
- };
2534
-
2535
- export const deserializeAws_restJson1DescribeTagsCommand = async (
2536
- output: __HttpResponse,
2537
- context: __SerdeContext
2538
- ): Promise<DescribeTagsCommandOutput> => {
2539
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2540
- return deserializeAws_restJson1DescribeTagsCommandError(output, context);
2541
- }
2542
- const contents: DescribeTagsCommandOutput = {
2543
- $metadata: deserializeMetadata(output),
2544
- Marker: undefined,
2545
- NextMarker: undefined,
2546
- Tags: undefined,
2547
- };
2548
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2549
- if (data.Marker !== undefined && data.Marker !== null) {
2550
- contents.Marker = __expectString(data.Marker);
2551
- }
2552
- if (data.NextMarker !== undefined && data.NextMarker !== null) {
2553
- contents.NextMarker = __expectString(data.NextMarker);
2554
- }
2555
- if (data.Tags !== undefined && data.Tags !== null) {
2556
- contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
2557
- }
2558
- return Promise.resolve(contents);
2559
- };
2560
-
2561
- const deserializeAws_restJson1DescribeTagsCommandError = async (
2562
- output: __HttpResponse,
2563
- context: __SerdeContext
2564
- ): Promise<DescribeTagsCommandOutput> => {
2565
- const parsedOutput: any = {
2566
- ...output,
2567
- body: await parseBody(output.body, context),
2568
- };
2569
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2570
- let errorCode = "UnknownError";
2571
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2572
- switch (errorCode) {
2573
- case "BadRequest":
2574
- case "com.amazonaws.efs#BadRequest":
2575
- response = {
2576
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2577
- name: errorCode,
2578
- $metadata: deserializeMetadata(output),
2579
- };
2580
- break;
2581
- case "FileSystemNotFound":
2582
- case "com.amazonaws.efs#FileSystemNotFound":
2583
- response = {
2584
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2585
- name: errorCode,
2586
- $metadata: deserializeMetadata(output),
2587
- };
2588
- break;
2589
- case "InternalServerError":
2590
- case "com.amazonaws.efs#InternalServerError":
2591
- response = {
2592
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2593
- name: errorCode,
2594
- $metadata: deserializeMetadata(output),
2595
- };
2596
- break;
2597
- default:
2598
- const parsedBody = parsedOutput.body;
2599
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2600
- response = {
2601
- ...parsedBody,
2602
- name: `${errorCode}`,
2603
- message: parsedBody.message || parsedBody.Message || errorCode,
2604
- $fault: "client",
2605
- $metadata: deserializeMetadata(output),
2606
- } as any;
2607
- }
2608
- const message = response.message || response.Message || errorCode;
2609
- response.message = message;
2610
- delete response.Message;
2611
- return Promise.reject(Object.assign(new Error(message), response));
2612
- };
2613
-
2614
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
2615
- output: __HttpResponse,
2616
- context: __SerdeContext
2617
- ): Promise<ListTagsForResourceCommandOutput> => {
2618
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2619
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2620
- }
2621
- const contents: ListTagsForResourceCommandOutput = {
2622
- $metadata: deserializeMetadata(output),
2623
- NextToken: undefined,
2624
- Tags: undefined,
2625
- };
2626
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2627
- if (data.NextToken !== undefined && data.NextToken !== null) {
2628
- contents.NextToken = __expectString(data.NextToken);
2629
- }
2630
- if (data.Tags !== undefined && data.Tags !== null) {
2631
- contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
2632
- }
2633
- return Promise.resolve(contents);
2634
- };
2635
-
2636
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
2637
- output: __HttpResponse,
2638
- context: __SerdeContext
2639
- ): Promise<ListTagsForResourceCommandOutput> => {
2640
- const parsedOutput: any = {
2641
- ...output,
2642
- body: await parseBody(output.body, context),
2643
- };
2644
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2645
- let errorCode = "UnknownError";
2646
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2647
- switch (errorCode) {
2648
- case "AccessPointNotFound":
2649
- case "com.amazonaws.efs#AccessPointNotFound":
2650
- response = {
2651
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
2652
- name: errorCode,
2653
- $metadata: deserializeMetadata(output),
2654
- };
2655
- break;
2656
- case "BadRequest":
2657
- case "com.amazonaws.efs#BadRequest":
2658
- response = {
2659
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2660
- name: errorCode,
2661
- $metadata: deserializeMetadata(output),
2662
- };
2663
- break;
2664
- case "FileSystemNotFound":
2665
- case "com.amazonaws.efs#FileSystemNotFound":
2666
- response = {
2667
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2668
- name: errorCode,
2669
- $metadata: deserializeMetadata(output),
2670
- };
2671
- break;
2672
- case "InternalServerError":
2673
- case "com.amazonaws.efs#InternalServerError":
2674
- response = {
2675
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2676
- name: errorCode,
2677
- $metadata: deserializeMetadata(output),
2678
- };
2679
- break;
2680
- default:
2681
- const parsedBody = parsedOutput.body;
2682
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2683
- response = {
2684
- ...parsedBody,
2685
- name: `${errorCode}`,
2686
- message: parsedBody.message || parsedBody.Message || errorCode,
2687
- $fault: "client",
2688
- $metadata: deserializeMetadata(output),
2689
- } as any;
2690
- }
2691
- const message = response.message || response.Message || errorCode;
2692
- response.message = message;
2693
- delete response.Message;
2694
- return Promise.reject(Object.assign(new Error(message), response));
2695
- };
2696
-
2697
- export const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommand = async (
2698
- output: __HttpResponse,
2699
- context: __SerdeContext
2700
- ): Promise<ModifyMountTargetSecurityGroupsCommandOutput> => {
2701
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2702
- return deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError(output, context);
2703
- }
2704
- const contents: ModifyMountTargetSecurityGroupsCommandOutput = {
2705
- $metadata: deserializeMetadata(output),
2706
- };
2707
- await collectBody(output.body, context);
2708
- return Promise.resolve(contents);
2709
- };
2710
-
2711
- const deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError = async (
2712
- output: __HttpResponse,
2713
- context: __SerdeContext
2714
- ): Promise<ModifyMountTargetSecurityGroupsCommandOutput> => {
2715
- const parsedOutput: any = {
2716
- ...output,
2717
- body: await parseBody(output.body, context),
2718
- };
2719
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2720
- let errorCode = "UnknownError";
2721
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2722
- switch (errorCode) {
2723
- case "BadRequest":
2724
- case "com.amazonaws.efs#BadRequest":
2725
- response = {
2726
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2727
- name: errorCode,
2728
- $metadata: deserializeMetadata(output),
2729
- };
2730
- break;
2731
- case "IncorrectMountTargetState":
2732
- case "com.amazonaws.efs#IncorrectMountTargetState":
2733
- response = {
2734
- ...(await deserializeAws_restJson1IncorrectMountTargetStateResponse(parsedOutput, context)),
2735
- name: errorCode,
2736
- $metadata: deserializeMetadata(output),
2737
- };
2738
- break;
2739
- case "InternalServerError":
2740
- case "com.amazonaws.efs#InternalServerError":
2741
- response = {
2742
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2743
- name: errorCode,
2744
- $metadata: deserializeMetadata(output),
2745
- };
2746
- break;
2747
- case "MountTargetNotFound":
2748
- case "com.amazonaws.efs#MountTargetNotFound":
2749
- response = {
2750
- ...(await deserializeAws_restJson1MountTargetNotFoundResponse(parsedOutput, context)),
2751
- name: errorCode,
2752
- $metadata: deserializeMetadata(output),
2753
- };
2754
- break;
2755
- case "SecurityGroupLimitExceeded":
2756
- case "com.amazonaws.efs#SecurityGroupLimitExceeded":
2757
- response = {
2758
- ...(await deserializeAws_restJson1SecurityGroupLimitExceededResponse(parsedOutput, context)),
2759
- name: errorCode,
2760
- $metadata: deserializeMetadata(output),
2761
- };
2762
- break;
2763
- case "SecurityGroupNotFound":
2764
- case "com.amazonaws.efs#SecurityGroupNotFound":
2765
- response = {
2766
- ...(await deserializeAws_restJson1SecurityGroupNotFoundResponse(parsedOutput, context)),
2767
- name: errorCode,
2768
- $metadata: deserializeMetadata(output),
2769
- };
2770
- break;
2771
- default:
2772
- const parsedBody = parsedOutput.body;
2773
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2774
- response = {
2775
- ...parsedBody,
2776
- name: `${errorCode}`,
2777
- message: parsedBody.message || parsedBody.Message || errorCode,
2778
- $fault: "client",
2779
- $metadata: deserializeMetadata(output),
2780
- } as any;
2781
- }
2782
- const message = response.message || response.Message || errorCode;
2783
- response.message = message;
2784
- delete response.Message;
2785
- return Promise.reject(Object.assign(new Error(message), response));
2786
- };
2787
-
2788
- export const deserializeAws_restJson1PutAccountPreferencesCommand = async (
2789
- output: __HttpResponse,
2790
- context: __SerdeContext
2791
- ): Promise<PutAccountPreferencesCommandOutput> => {
2792
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2793
- return deserializeAws_restJson1PutAccountPreferencesCommandError(output, context);
2794
- }
2795
- const contents: PutAccountPreferencesCommandOutput = {
2796
- $metadata: deserializeMetadata(output),
2797
- ResourceIdPreference: undefined,
2798
- };
2799
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2800
- if (data.ResourceIdPreference !== undefined && data.ResourceIdPreference !== null) {
2801
- contents.ResourceIdPreference = deserializeAws_restJson1ResourceIdPreference(data.ResourceIdPreference, context);
2802
- }
2803
- return Promise.resolve(contents);
2804
- };
2805
-
2806
- const deserializeAws_restJson1PutAccountPreferencesCommandError = async (
2807
- output: __HttpResponse,
2808
- context: __SerdeContext
2809
- ): Promise<PutAccountPreferencesCommandOutput> => {
2810
- const parsedOutput: any = {
2811
- ...output,
2812
- body: await parseBody(output.body, context),
2813
- };
2814
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2815
- let errorCode = "UnknownError";
2816
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2817
- switch (errorCode) {
2818
- case "InternalServerError":
2819
- case "com.amazonaws.efs#InternalServerError":
2820
- response = {
2821
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2822
- name: errorCode,
2823
- $metadata: deserializeMetadata(output),
2824
- };
2825
- break;
2826
- default:
2827
- const parsedBody = parsedOutput.body;
2828
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2829
- response = {
2830
- ...parsedBody,
2831
- name: `${errorCode}`,
2832
- message: parsedBody.message || parsedBody.Message || errorCode,
2833
- $fault: "client",
2834
- $metadata: deserializeMetadata(output),
2835
- } as any;
2836
- }
2837
- const message = response.message || response.Message || errorCode;
2838
- response.message = message;
2839
- delete response.Message;
2840
- return Promise.reject(Object.assign(new Error(message), response));
2841
- };
2842
-
2843
- export const deserializeAws_restJson1PutBackupPolicyCommand = async (
2844
- output: __HttpResponse,
2845
- context: __SerdeContext
2846
- ): Promise<PutBackupPolicyCommandOutput> => {
2847
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2848
- return deserializeAws_restJson1PutBackupPolicyCommandError(output, context);
2849
- }
2850
- const contents: PutBackupPolicyCommandOutput = {
2851
- $metadata: deserializeMetadata(output),
2852
- BackupPolicy: undefined,
2853
- };
2854
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2855
- if (data.BackupPolicy !== undefined && data.BackupPolicy !== null) {
2856
- contents.BackupPolicy = deserializeAws_restJson1BackupPolicy(data.BackupPolicy, context);
2857
- }
2858
- return Promise.resolve(contents);
2859
- };
2860
-
2861
- const deserializeAws_restJson1PutBackupPolicyCommandError = async (
2862
- output: __HttpResponse,
2863
- context: __SerdeContext
2864
- ): Promise<PutBackupPolicyCommandOutput> => {
2865
- const parsedOutput: any = {
2866
- ...output,
2867
- body: await parseBody(output.body, context),
2868
- };
2869
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2870
- let errorCode = "UnknownError";
2871
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2872
- switch (errorCode) {
2873
- case "BadRequest":
2874
- case "com.amazonaws.efs#BadRequest":
2875
- response = {
2876
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
2877
- name: errorCode,
2878
- $metadata: deserializeMetadata(output),
2879
- };
2880
- break;
2881
- case "FileSystemNotFound":
2882
- case "com.amazonaws.efs#FileSystemNotFound":
2883
- response = {
2884
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2885
- name: errorCode,
2886
- $metadata: deserializeMetadata(output),
2887
- };
2888
- break;
2889
- case "IncorrectFileSystemLifeCycleState":
2890
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
2891
- response = {
2892
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
2893
- name: errorCode,
2894
- $metadata: deserializeMetadata(output),
2895
- };
2896
- break;
2897
- case "InternalServerError":
2898
- case "com.amazonaws.efs#InternalServerError":
2899
- response = {
2900
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2901
- name: errorCode,
2902
- $metadata: deserializeMetadata(output),
2903
- };
2904
- break;
2905
- case "ValidationException":
2906
- case "com.amazonaws.efs#ValidationException":
2907
- response = {
2908
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2909
- name: errorCode,
2910
- $metadata: deserializeMetadata(output),
2911
- };
2912
- break;
2913
- default:
2914
- const parsedBody = parsedOutput.body;
2915
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2916
- response = {
2917
- ...parsedBody,
2918
- name: `${errorCode}`,
2919
- message: parsedBody.message || parsedBody.Message || errorCode,
2920
- $fault: "client",
2921
- $metadata: deserializeMetadata(output),
2922
- } as any;
2923
- }
2924
- const message = response.message || response.Message || errorCode;
2925
- response.message = message;
2926
- delete response.Message;
2927
- return Promise.reject(Object.assign(new Error(message), response));
2928
- };
2929
-
2930
- export const deserializeAws_restJson1PutFileSystemPolicyCommand = async (
2931
- output: __HttpResponse,
2932
- context: __SerdeContext
2933
- ): Promise<PutFileSystemPolicyCommandOutput> => {
2934
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2935
- return deserializeAws_restJson1PutFileSystemPolicyCommandError(output, context);
2936
- }
2937
- const contents: PutFileSystemPolicyCommandOutput = {
2938
- $metadata: deserializeMetadata(output),
2939
- FileSystemId: undefined,
2940
- Policy: undefined,
2941
- };
2942
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2943
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
2944
- contents.FileSystemId = __expectString(data.FileSystemId);
2945
- }
2946
- if (data.Policy !== undefined && data.Policy !== null) {
2947
- contents.Policy = __expectString(data.Policy);
2948
- }
2949
- return Promise.resolve(contents);
2950
- };
2951
-
2952
- const deserializeAws_restJson1PutFileSystemPolicyCommandError = async (
2953
- output: __HttpResponse,
2954
- context: __SerdeContext
2955
- ): Promise<PutFileSystemPolicyCommandOutput> => {
2956
- const parsedOutput: any = {
2957
- ...output,
2958
- body: await parseBody(output.body, context),
2959
- };
2960
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2961
- let errorCode = "UnknownError";
2962
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2963
- switch (errorCode) {
2964
- case "FileSystemNotFound":
2965
- case "com.amazonaws.efs#FileSystemNotFound":
2966
- response = {
2967
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
2968
- name: errorCode,
2969
- $metadata: deserializeMetadata(output),
2970
- };
2971
- break;
2972
- case "IncorrectFileSystemLifeCycleState":
2973
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
2974
- response = {
2975
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
2976
- name: errorCode,
2977
- $metadata: deserializeMetadata(output),
2978
- };
2979
- break;
2980
- case "InternalServerError":
2981
- case "com.amazonaws.efs#InternalServerError":
2982
- response = {
2983
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
2984
- name: errorCode,
2985
- $metadata: deserializeMetadata(output),
2986
- };
2987
- break;
2988
- case "InvalidPolicyException":
2989
- case "com.amazonaws.efs#InvalidPolicyException":
2990
- response = {
2991
- ...(await deserializeAws_restJson1InvalidPolicyExceptionResponse(parsedOutput, context)),
2992
- name: errorCode,
2993
- $metadata: deserializeMetadata(output),
2994
- };
2995
- break;
2996
- default:
2997
- const parsedBody = parsedOutput.body;
2998
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2999
- response = {
3000
- ...parsedBody,
3001
- name: `${errorCode}`,
3002
- message: parsedBody.message || parsedBody.Message || errorCode,
3003
- $fault: "client",
3004
- $metadata: deserializeMetadata(output),
3005
- } as any;
3006
- }
3007
- const message = response.message || response.Message || errorCode;
3008
- response.message = message;
3009
- delete response.Message;
3010
- return Promise.reject(Object.assign(new Error(message), response));
3011
- };
3012
-
3013
- export const deserializeAws_restJson1PutLifecycleConfigurationCommand = async (
3014
- output: __HttpResponse,
3015
- context: __SerdeContext
3016
- ): Promise<PutLifecycleConfigurationCommandOutput> => {
3017
- if (output.statusCode !== 200 && output.statusCode >= 300) {
3018
- return deserializeAws_restJson1PutLifecycleConfigurationCommandError(output, context);
3019
- }
3020
- const contents: PutLifecycleConfigurationCommandOutput = {
3021
- $metadata: deserializeMetadata(output),
3022
- LifecyclePolicies: undefined,
3023
- };
3024
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3025
- if (data.LifecyclePolicies !== undefined && data.LifecyclePolicies !== null) {
3026
- contents.LifecyclePolicies = deserializeAws_restJson1LifecyclePolicies(data.LifecyclePolicies, context);
3027
- }
3028
- return Promise.resolve(contents);
3029
- };
3030
-
3031
- const deserializeAws_restJson1PutLifecycleConfigurationCommandError = async (
3032
- output: __HttpResponse,
3033
- context: __SerdeContext
3034
- ): Promise<PutLifecycleConfigurationCommandOutput> => {
3035
- const parsedOutput: any = {
3036
- ...output,
3037
- body: await parseBody(output.body, context),
3038
- };
3039
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3040
- let errorCode = "UnknownError";
3041
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3042
- switch (errorCode) {
3043
- case "BadRequest":
3044
- case "com.amazonaws.efs#BadRequest":
3045
- response = {
3046
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
3047
- name: errorCode,
3048
- $metadata: deserializeMetadata(output),
3049
- };
3050
- break;
3051
- case "FileSystemNotFound":
3052
- case "com.amazonaws.efs#FileSystemNotFound":
3053
- response = {
3054
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
3055
- name: errorCode,
3056
- $metadata: deserializeMetadata(output),
3057
- };
3058
- break;
3059
- case "IncorrectFileSystemLifeCycleState":
3060
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
3061
- response = {
3062
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
3063
- name: errorCode,
3064
- $metadata: deserializeMetadata(output),
3065
- };
3066
- break;
3067
- case "InternalServerError":
3068
- case "com.amazonaws.efs#InternalServerError":
3069
- response = {
3070
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
3071
- name: errorCode,
3072
- $metadata: deserializeMetadata(output),
3073
- };
3074
- break;
3075
- default:
3076
- const parsedBody = parsedOutput.body;
3077
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3078
- response = {
3079
- ...parsedBody,
3080
- name: `${errorCode}`,
3081
- message: parsedBody.message || parsedBody.Message || errorCode,
3082
- $fault: "client",
3083
- $metadata: deserializeMetadata(output),
3084
- } as any;
3085
- }
3086
- const message = response.message || response.Message || errorCode;
3087
- response.message = message;
3088
- delete response.Message;
3089
- return Promise.reject(Object.assign(new Error(message), response));
3090
- };
3091
-
3092
- export const deserializeAws_restJson1TagResourceCommand = async (
3093
- output: __HttpResponse,
3094
- context: __SerdeContext
3095
- ): Promise<TagResourceCommandOutput> => {
3096
- if (output.statusCode !== 200 && output.statusCode >= 300) {
3097
- return deserializeAws_restJson1TagResourceCommandError(output, context);
3098
- }
3099
- const contents: TagResourceCommandOutput = {
3100
- $metadata: deserializeMetadata(output),
3101
- };
3102
- await collectBody(output.body, context);
3103
- return Promise.resolve(contents);
3104
- };
3105
-
3106
- const deserializeAws_restJson1TagResourceCommandError = async (
3107
- output: __HttpResponse,
3108
- context: __SerdeContext
3109
- ): Promise<TagResourceCommandOutput> => {
3110
- const parsedOutput: any = {
3111
- ...output,
3112
- body: await parseBody(output.body, context),
3113
- };
3114
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3115
- let errorCode = "UnknownError";
3116
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3117
- switch (errorCode) {
3118
- case "AccessPointNotFound":
3119
- case "com.amazonaws.efs#AccessPointNotFound":
3120
- response = {
3121
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
3122
- name: errorCode,
3123
- $metadata: deserializeMetadata(output),
3124
- };
3125
- break;
3126
- case "BadRequest":
3127
- case "com.amazonaws.efs#BadRequest":
3128
- response = {
3129
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
3130
- name: errorCode,
3131
- $metadata: deserializeMetadata(output),
3132
- };
3133
- break;
3134
- case "FileSystemNotFound":
3135
- case "com.amazonaws.efs#FileSystemNotFound":
3136
- response = {
3137
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
3138
- name: errorCode,
3139
- $metadata: deserializeMetadata(output),
3140
- };
3141
- break;
3142
- case "InternalServerError":
3143
- case "com.amazonaws.efs#InternalServerError":
3144
- response = {
3145
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
3146
- name: errorCode,
3147
- $metadata: deserializeMetadata(output),
3148
- };
3149
- break;
3150
- default:
3151
- const parsedBody = parsedOutput.body;
3152
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3153
- response = {
3154
- ...parsedBody,
3155
- name: `${errorCode}`,
3156
- message: parsedBody.message || parsedBody.Message || errorCode,
3157
- $fault: "client",
3158
- $metadata: deserializeMetadata(output),
3159
- } as any;
3160
- }
3161
- const message = response.message || response.Message || errorCode;
3162
- response.message = message;
3163
- delete response.Message;
3164
- return Promise.reject(Object.assign(new Error(message), response));
3165
- };
3166
-
3167
- export const deserializeAws_restJson1UntagResourceCommand = async (
3168
- output: __HttpResponse,
3169
- context: __SerdeContext
3170
- ): Promise<UntagResourceCommandOutput> => {
3171
- if (output.statusCode !== 200 && output.statusCode >= 300) {
3172
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
3173
- }
3174
- const contents: UntagResourceCommandOutput = {
3175
- $metadata: deserializeMetadata(output),
3176
- };
3177
- await collectBody(output.body, context);
3178
- return Promise.resolve(contents);
3179
- };
3180
-
3181
- const deserializeAws_restJson1UntagResourceCommandError = async (
3182
- output: __HttpResponse,
3183
- context: __SerdeContext
3184
- ): Promise<UntagResourceCommandOutput> => {
3185
- const parsedOutput: any = {
3186
- ...output,
3187
- body: await parseBody(output.body, context),
3188
- };
3189
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3190
- let errorCode = "UnknownError";
3191
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3192
- switch (errorCode) {
3193
- case "AccessPointNotFound":
3194
- case "com.amazonaws.efs#AccessPointNotFound":
3195
- response = {
3196
- ...(await deserializeAws_restJson1AccessPointNotFoundResponse(parsedOutput, context)),
3197
- name: errorCode,
3198
- $metadata: deserializeMetadata(output),
3199
- };
3200
- break;
3201
- case "BadRequest":
3202
- case "com.amazonaws.efs#BadRequest":
3203
- response = {
3204
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
3205
- name: errorCode,
3206
- $metadata: deserializeMetadata(output),
3207
- };
3208
- break;
3209
- case "FileSystemNotFound":
3210
- case "com.amazonaws.efs#FileSystemNotFound":
3211
- response = {
3212
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
3213
- name: errorCode,
3214
- $metadata: deserializeMetadata(output),
3215
- };
3216
- break;
3217
- case "InternalServerError":
3218
- case "com.amazonaws.efs#InternalServerError":
3219
- response = {
3220
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
3221
- name: errorCode,
3222
- $metadata: deserializeMetadata(output),
3223
- };
3224
- break;
3225
- default:
3226
- const parsedBody = parsedOutput.body;
3227
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3228
- response = {
3229
- ...parsedBody,
3230
- name: `${errorCode}`,
3231
- message: parsedBody.message || parsedBody.Message || errorCode,
3232
- $fault: "client",
3233
- $metadata: deserializeMetadata(output),
3234
- } as any;
3235
- }
3236
- const message = response.message || response.Message || errorCode;
3237
- response.message = message;
3238
- delete response.Message;
3239
- return Promise.reject(Object.assign(new Error(message), response));
3240
- };
3241
-
3242
- export const deserializeAws_restJson1UpdateFileSystemCommand = async (
3243
- output: __HttpResponse,
3244
- context: __SerdeContext
3245
- ): Promise<UpdateFileSystemCommandOutput> => {
3246
- if (output.statusCode !== 202 && output.statusCode >= 300) {
3247
- return deserializeAws_restJson1UpdateFileSystemCommandError(output, context);
3248
- }
3249
- const contents: UpdateFileSystemCommandOutput = {
3250
- $metadata: deserializeMetadata(output),
3251
- AvailabilityZoneId: undefined,
3252
- AvailabilityZoneName: undefined,
3253
- CreationTime: undefined,
3254
- CreationToken: undefined,
3255
- Encrypted: undefined,
3256
- FileSystemArn: undefined,
3257
- FileSystemId: undefined,
3258
- KmsKeyId: undefined,
3259
- LifeCycleState: undefined,
3260
- Name: undefined,
3261
- NumberOfMountTargets: undefined,
3262
- OwnerId: undefined,
3263
- PerformanceMode: undefined,
3264
- ProvisionedThroughputInMibps: undefined,
3265
- SizeInBytes: undefined,
3266
- Tags: undefined,
3267
- ThroughputMode: undefined,
3268
- };
3269
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3270
- if (data.AvailabilityZoneId !== undefined && data.AvailabilityZoneId !== null) {
3271
- contents.AvailabilityZoneId = __expectString(data.AvailabilityZoneId);
3272
- }
3273
- if (data.AvailabilityZoneName !== undefined && data.AvailabilityZoneName !== null) {
3274
- contents.AvailabilityZoneName = __expectString(data.AvailabilityZoneName);
3275
- }
3276
- if (data.CreationTime !== undefined && data.CreationTime !== null) {
3277
- contents.CreationTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.CreationTime)));
3278
- }
3279
- if (data.CreationToken !== undefined && data.CreationToken !== null) {
3280
- contents.CreationToken = __expectString(data.CreationToken);
3281
- }
3282
- if (data.Encrypted !== undefined && data.Encrypted !== null) {
3283
- contents.Encrypted = __expectBoolean(data.Encrypted);
3284
- }
3285
- if (data.FileSystemArn !== undefined && data.FileSystemArn !== null) {
3286
- contents.FileSystemArn = __expectString(data.FileSystemArn);
3287
- }
3288
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
3289
- contents.FileSystemId = __expectString(data.FileSystemId);
3290
- }
3291
- if (data.KmsKeyId !== undefined && data.KmsKeyId !== null) {
3292
- contents.KmsKeyId = __expectString(data.KmsKeyId);
3293
- }
3294
- if (data.LifeCycleState !== undefined && data.LifeCycleState !== null) {
3295
- contents.LifeCycleState = __expectString(data.LifeCycleState);
3296
- }
3297
- if (data.Name !== undefined && data.Name !== null) {
3298
- contents.Name = __expectString(data.Name);
3299
- }
3300
- if (data.NumberOfMountTargets !== undefined && data.NumberOfMountTargets !== null) {
3301
- contents.NumberOfMountTargets = __expectInt32(data.NumberOfMountTargets);
3302
- }
3303
- if (data.OwnerId !== undefined && data.OwnerId !== null) {
3304
- contents.OwnerId = __expectString(data.OwnerId);
3305
- }
3306
- if (data.PerformanceMode !== undefined && data.PerformanceMode !== null) {
3307
- contents.PerformanceMode = __expectString(data.PerformanceMode);
3308
- }
3309
- if (data.ProvisionedThroughputInMibps !== undefined && data.ProvisionedThroughputInMibps !== null) {
3310
- contents.ProvisionedThroughputInMibps = __limitedParseDouble(data.ProvisionedThroughputInMibps);
3311
- }
3312
- if (data.SizeInBytes !== undefined && data.SizeInBytes !== null) {
3313
- contents.SizeInBytes = deserializeAws_restJson1FileSystemSize(data.SizeInBytes, context);
3314
- }
3315
- if (data.Tags !== undefined && data.Tags !== null) {
3316
- contents.Tags = deserializeAws_restJson1Tags(data.Tags, context);
3317
- }
3318
- if (data.ThroughputMode !== undefined && data.ThroughputMode !== null) {
3319
- contents.ThroughputMode = __expectString(data.ThroughputMode);
3320
- }
3321
- return Promise.resolve(contents);
3322
- };
3323
-
3324
- const deserializeAws_restJson1UpdateFileSystemCommandError = async (
3325
- output: __HttpResponse,
3326
- context: __SerdeContext
3327
- ): Promise<UpdateFileSystemCommandOutput> => {
3328
- const parsedOutput: any = {
3329
- ...output,
3330
- body: await parseBody(output.body, context),
3331
- };
3332
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3333
- let errorCode = "UnknownError";
3334
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3335
- switch (errorCode) {
3336
- case "BadRequest":
3337
- case "com.amazonaws.efs#BadRequest":
3338
- response = {
3339
- ...(await deserializeAws_restJson1BadRequestResponse(parsedOutput, context)),
3340
- name: errorCode,
3341
- $metadata: deserializeMetadata(output),
3342
- };
3343
- break;
3344
- case "FileSystemNotFound":
3345
- case "com.amazonaws.efs#FileSystemNotFound":
3346
- response = {
3347
- ...(await deserializeAws_restJson1FileSystemNotFoundResponse(parsedOutput, context)),
3348
- name: errorCode,
3349
- $metadata: deserializeMetadata(output),
3350
- };
3351
- break;
3352
- case "IncorrectFileSystemLifeCycleState":
3353
- case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState":
3354
- response = {
3355
- ...(await deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse(parsedOutput, context)),
3356
- name: errorCode,
3357
- $metadata: deserializeMetadata(output),
3358
- };
3359
- break;
3360
- case "InsufficientThroughputCapacity":
3361
- case "com.amazonaws.efs#InsufficientThroughputCapacity":
3362
- response = {
3363
- ...(await deserializeAws_restJson1InsufficientThroughputCapacityResponse(parsedOutput, context)),
3364
- name: errorCode,
3365
- $metadata: deserializeMetadata(output),
3366
- };
3367
- break;
3368
- case "InternalServerError":
3369
- case "com.amazonaws.efs#InternalServerError":
3370
- response = {
3371
- ...(await deserializeAws_restJson1InternalServerErrorResponse(parsedOutput, context)),
3372
- name: errorCode,
3373
- $metadata: deserializeMetadata(output),
3374
- };
3375
- break;
3376
- case "ThroughputLimitExceeded":
3377
- case "com.amazonaws.efs#ThroughputLimitExceeded":
3378
- response = {
3379
- ...(await deserializeAws_restJson1ThroughputLimitExceededResponse(parsedOutput, context)),
3380
- name: errorCode,
3381
- $metadata: deserializeMetadata(output),
3382
- };
3383
- break;
3384
- case "TooManyRequests":
3385
- case "com.amazonaws.efs#TooManyRequests":
3386
- response = {
3387
- ...(await deserializeAws_restJson1TooManyRequestsResponse(parsedOutput, context)),
3388
- name: errorCode,
3389
- $metadata: deserializeMetadata(output),
3390
- };
3391
- break;
3392
- default:
3393
- const parsedBody = parsedOutput.body;
3394
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3395
- response = {
3396
- ...parsedBody,
3397
- name: `${errorCode}`,
3398
- message: parsedBody.message || parsedBody.Message || errorCode,
3399
- $fault: "client",
3400
- $metadata: deserializeMetadata(output),
3401
- } as any;
3402
- }
3403
- const message = response.message || response.Message || errorCode;
3404
- response.message = message;
3405
- delete response.Message;
3406
- return Promise.reject(Object.assign(new Error(message), response));
3407
- };
3408
-
3409
- const deserializeAws_restJson1AccessPointAlreadyExistsResponse = async (
3410
- parsedOutput: any,
3411
- context: __SerdeContext
3412
- ): Promise<AccessPointAlreadyExists> => {
3413
- const contents: AccessPointAlreadyExists = {
3414
- name: "AccessPointAlreadyExists",
3415
- $fault: "client",
3416
- $metadata: deserializeMetadata(parsedOutput),
3417
- AccessPointId: undefined,
3418
- ErrorCode: undefined,
3419
- Message: undefined,
3420
- };
3421
- const data: any = parsedOutput.body;
3422
- if (data.AccessPointId !== undefined && data.AccessPointId !== null) {
3423
- contents.AccessPointId = __expectString(data.AccessPointId);
3424
- }
3425
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3426
- contents.ErrorCode = __expectString(data.ErrorCode);
3427
- }
3428
- if (data.Message !== undefined && data.Message !== null) {
3429
- contents.Message = __expectString(data.Message);
3430
- }
3431
- return contents;
3432
- };
3433
-
3434
- const deserializeAws_restJson1AccessPointLimitExceededResponse = async (
3435
- parsedOutput: any,
3436
- context: __SerdeContext
3437
- ): Promise<AccessPointLimitExceeded> => {
3438
- const contents: AccessPointLimitExceeded = {
3439
- name: "AccessPointLimitExceeded",
3440
- $fault: "client",
3441
- $metadata: deserializeMetadata(parsedOutput),
3442
- ErrorCode: undefined,
3443
- Message: undefined,
3444
- };
3445
- const data: any = parsedOutput.body;
3446
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3447
- contents.ErrorCode = __expectString(data.ErrorCode);
3448
- }
3449
- if (data.Message !== undefined && data.Message !== null) {
3450
- contents.Message = __expectString(data.Message);
3451
- }
3452
- return contents;
3453
- };
3454
-
3455
- const deserializeAws_restJson1AccessPointNotFoundResponse = async (
3456
- parsedOutput: any,
3457
- context: __SerdeContext
3458
- ): Promise<AccessPointNotFound> => {
3459
- const contents: AccessPointNotFound = {
3460
- name: "AccessPointNotFound",
3461
- $fault: "client",
3462
- $metadata: deserializeMetadata(parsedOutput),
3463
- ErrorCode: undefined,
3464
- Message: undefined,
3465
- };
3466
- const data: any = parsedOutput.body;
3467
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3468
- contents.ErrorCode = __expectString(data.ErrorCode);
3469
- }
3470
- if (data.Message !== undefined && data.Message !== null) {
3471
- contents.Message = __expectString(data.Message);
3472
- }
3473
- return contents;
3474
- };
3475
-
3476
- const deserializeAws_restJson1AvailabilityZonesMismatchResponse = async (
3477
- parsedOutput: any,
3478
- context: __SerdeContext
3479
- ): Promise<AvailabilityZonesMismatch> => {
3480
- const contents: AvailabilityZonesMismatch = {
3481
- name: "AvailabilityZonesMismatch",
3482
- $fault: "client",
3483
- $metadata: deserializeMetadata(parsedOutput),
3484
- ErrorCode: undefined,
3485
- Message: undefined,
3486
- };
3487
- const data: any = parsedOutput.body;
3488
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3489
- contents.ErrorCode = __expectString(data.ErrorCode);
3490
- }
3491
- if (data.Message !== undefined && data.Message !== null) {
3492
- contents.Message = __expectString(data.Message);
3493
- }
3494
- return contents;
3495
- };
3496
-
3497
- const deserializeAws_restJson1BadRequestResponse = async (
3498
- parsedOutput: any,
3499
- context: __SerdeContext
3500
- ): Promise<BadRequest> => {
3501
- const contents: BadRequest = {
3502
- name: "BadRequest",
3503
- $fault: "client",
3504
- $metadata: deserializeMetadata(parsedOutput),
3505
- ErrorCode: undefined,
3506
- Message: undefined,
3507
- };
3508
- const data: any = parsedOutput.body;
3509
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3510
- contents.ErrorCode = __expectString(data.ErrorCode);
3511
- }
3512
- if (data.Message !== undefined && data.Message !== null) {
3513
- contents.Message = __expectString(data.Message);
3514
- }
3515
- return contents;
3516
- };
3517
-
3518
- const deserializeAws_restJson1DependencyTimeoutResponse = async (
3519
- parsedOutput: any,
3520
- context: __SerdeContext
3521
- ): Promise<DependencyTimeout> => {
3522
- const contents: DependencyTimeout = {
3523
- name: "DependencyTimeout",
3524
- $fault: "server",
3525
- $metadata: deserializeMetadata(parsedOutput),
3526
- ErrorCode: undefined,
3527
- Message: undefined,
3528
- };
3529
- const data: any = parsedOutput.body;
3530
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3531
- contents.ErrorCode = __expectString(data.ErrorCode);
3532
- }
3533
- if (data.Message !== undefined && data.Message !== null) {
3534
- contents.Message = __expectString(data.Message);
3535
- }
3536
- return contents;
3537
- };
3538
-
3539
- const deserializeAws_restJson1FileSystemAlreadyExistsResponse = async (
3540
- parsedOutput: any,
3541
- context: __SerdeContext
3542
- ): Promise<FileSystemAlreadyExists> => {
3543
- const contents: FileSystemAlreadyExists = {
3544
- name: "FileSystemAlreadyExists",
3545
- $fault: "client",
3546
- $metadata: deserializeMetadata(parsedOutput),
3547
- ErrorCode: undefined,
3548
- FileSystemId: undefined,
3549
- Message: undefined,
3550
- };
3551
- const data: any = parsedOutput.body;
3552
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3553
- contents.ErrorCode = __expectString(data.ErrorCode);
3554
- }
3555
- if (data.FileSystemId !== undefined && data.FileSystemId !== null) {
3556
- contents.FileSystemId = __expectString(data.FileSystemId);
3557
- }
3558
- if (data.Message !== undefined && data.Message !== null) {
3559
- contents.Message = __expectString(data.Message);
3560
- }
3561
- return contents;
3562
- };
3563
-
3564
- const deserializeAws_restJson1FileSystemInUseResponse = async (
3565
- parsedOutput: any,
3566
- context: __SerdeContext
3567
- ): Promise<FileSystemInUse> => {
3568
- const contents: FileSystemInUse = {
3569
- name: "FileSystemInUse",
3570
- $fault: "client",
3571
- $metadata: deserializeMetadata(parsedOutput),
3572
- ErrorCode: undefined,
3573
- Message: undefined,
3574
- };
3575
- const data: any = parsedOutput.body;
3576
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3577
- contents.ErrorCode = __expectString(data.ErrorCode);
3578
- }
3579
- if (data.Message !== undefined && data.Message !== null) {
3580
- contents.Message = __expectString(data.Message);
3581
- }
3582
- return contents;
3583
- };
3584
-
3585
- const deserializeAws_restJson1FileSystemLimitExceededResponse = async (
3586
- parsedOutput: any,
3587
- context: __SerdeContext
3588
- ): Promise<FileSystemLimitExceeded> => {
3589
- const contents: FileSystemLimitExceeded = {
3590
- name: "FileSystemLimitExceeded",
3591
- $fault: "client",
3592
- $metadata: deserializeMetadata(parsedOutput),
3593
- ErrorCode: undefined,
3594
- Message: undefined,
3595
- };
3596
- const data: any = parsedOutput.body;
3597
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3598
- contents.ErrorCode = __expectString(data.ErrorCode);
3599
- }
3600
- if (data.Message !== undefined && data.Message !== null) {
3601
- contents.Message = __expectString(data.Message);
3602
- }
3603
- return contents;
3604
- };
3605
-
3606
- const deserializeAws_restJson1FileSystemNotFoundResponse = async (
3607
- parsedOutput: any,
3608
- context: __SerdeContext
3609
- ): Promise<FileSystemNotFound> => {
3610
- const contents: FileSystemNotFound = {
3611
- name: "FileSystemNotFound",
3612
- $fault: "client",
3613
- $metadata: deserializeMetadata(parsedOutput),
3614
- ErrorCode: undefined,
3615
- Message: undefined,
3616
- };
3617
- const data: any = parsedOutput.body;
3618
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3619
- contents.ErrorCode = __expectString(data.ErrorCode);
3620
- }
3621
- if (data.Message !== undefined && data.Message !== null) {
3622
- contents.Message = __expectString(data.Message);
3623
- }
3624
- return contents;
3625
- };
3626
-
3627
- const deserializeAws_restJson1IncorrectFileSystemLifeCycleStateResponse = async (
3628
- parsedOutput: any,
3629
- context: __SerdeContext
3630
- ): Promise<IncorrectFileSystemLifeCycleState> => {
3631
- const contents: IncorrectFileSystemLifeCycleState = {
3632
- name: "IncorrectFileSystemLifeCycleState",
3633
- $fault: "client",
3634
- $metadata: deserializeMetadata(parsedOutput),
3635
- ErrorCode: undefined,
3636
- Message: undefined,
3637
- };
3638
- const data: any = parsedOutput.body;
3639
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3640
- contents.ErrorCode = __expectString(data.ErrorCode);
3641
- }
3642
- if (data.Message !== undefined && data.Message !== null) {
3643
- contents.Message = __expectString(data.Message);
3644
- }
3645
- return contents;
3646
- };
3647
-
3648
- const deserializeAws_restJson1IncorrectMountTargetStateResponse = async (
3649
- parsedOutput: any,
3650
- context: __SerdeContext
3651
- ): Promise<IncorrectMountTargetState> => {
3652
- const contents: IncorrectMountTargetState = {
3653
- name: "IncorrectMountTargetState",
3654
- $fault: "client",
3655
- $metadata: deserializeMetadata(parsedOutput),
3656
- ErrorCode: undefined,
3657
- Message: undefined,
3658
- };
3659
- const data: any = parsedOutput.body;
3660
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3661
- contents.ErrorCode = __expectString(data.ErrorCode);
3662
- }
3663
- if (data.Message !== undefined && data.Message !== null) {
3664
- contents.Message = __expectString(data.Message);
3665
- }
3666
- return contents;
3667
- };
3668
-
3669
- const deserializeAws_restJson1InsufficientThroughputCapacityResponse = async (
3670
- parsedOutput: any,
3671
- context: __SerdeContext
3672
- ): Promise<InsufficientThroughputCapacity> => {
3673
- const contents: InsufficientThroughputCapacity = {
3674
- name: "InsufficientThroughputCapacity",
3675
- $fault: "server",
3676
- $metadata: deserializeMetadata(parsedOutput),
3677
- ErrorCode: undefined,
3678
- Message: undefined,
3679
- };
3680
- const data: any = parsedOutput.body;
3681
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3682
- contents.ErrorCode = __expectString(data.ErrorCode);
3683
- }
3684
- if (data.Message !== undefined && data.Message !== null) {
3685
- contents.Message = __expectString(data.Message);
3686
- }
3687
- return contents;
3688
- };
3689
-
3690
- const deserializeAws_restJson1InternalServerErrorResponse = async (
3691
- parsedOutput: any,
3692
- context: __SerdeContext
3693
- ): Promise<InternalServerError> => {
3694
- const contents: InternalServerError = {
3695
- name: "InternalServerError",
3696
- $fault: "server",
3697
- $metadata: deserializeMetadata(parsedOutput),
3698
- ErrorCode: undefined,
3699
- Message: undefined,
3700
- };
3701
- const data: any = parsedOutput.body;
3702
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3703
- contents.ErrorCode = __expectString(data.ErrorCode);
3704
- }
3705
- if (data.Message !== undefined && data.Message !== null) {
3706
- contents.Message = __expectString(data.Message);
3707
- }
3708
- return contents;
3709
- };
3710
-
3711
- const deserializeAws_restJson1InvalidPolicyExceptionResponse = async (
3712
- parsedOutput: any,
3713
- context: __SerdeContext
3714
- ): Promise<InvalidPolicyException> => {
3715
- const contents: InvalidPolicyException = {
3716
- name: "InvalidPolicyException",
3717
- $fault: "client",
3718
- $metadata: deserializeMetadata(parsedOutput),
3719
- ErrorCode: undefined,
3720
- Message: undefined,
3721
- };
3722
- const data: any = parsedOutput.body;
3723
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3724
- contents.ErrorCode = __expectString(data.ErrorCode);
3725
- }
3726
- if (data.Message !== undefined && data.Message !== null) {
3727
- contents.Message = __expectString(data.Message);
3728
- }
3729
- return contents;
3730
- };
3731
-
3732
- const deserializeAws_restJson1IpAddressInUseResponse = async (
3733
- parsedOutput: any,
3734
- context: __SerdeContext
3735
- ): Promise<IpAddressInUse> => {
3736
- const contents: IpAddressInUse = {
3737
- name: "IpAddressInUse",
3738
- $fault: "client",
3739
- $metadata: deserializeMetadata(parsedOutput),
3740
- ErrorCode: undefined,
3741
- Message: undefined,
3742
- };
3743
- const data: any = parsedOutput.body;
3744
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3745
- contents.ErrorCode = __expectString(data.ErrorCode);
3746
- }
3747
- if (data.Message !== undefined && data.Message !== null) {
3748
- contents.Message = __expectString(data.Message);
3749
- }
3750
- return contents;
3751
- };
3752
-
3753
- const deserializeAws_restJson1MountTargetConflictResponse = async (
3754
- parsedOutput: any,
3755
- context: __SerdeContext
3756
- ): Promise<MountTargetConflict> => {
3757
- const contents: MountTargetConflict = {
3758
- name: "MountTargetConflict",
3759
- $fault: "client",
3760
- $metadata: deserializeMetadata(parsedOutput),
3761
- ErrorCode: undefined,
3762
- Message: undefined,
3763
- };
3764
- const data: any = parsedOutput.body;
3765
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3766
- contents.ErrorCode = __expectString(data.ErrorCode);
3767
- }
3768
- if (data.Message !== undefined && data.Message !== null) {
3769
- contents.Message = __expectString(data.Message);
3770
- }
3771
- return contents;
3772
- };
3773
-
3774
- const deserializeAws_restJson1MountTargetNotFoundResponse = async (
3775
- parsedOutput: any,
3776
- context: __SerdeContext
3777
- ): Promise<MountTargetNotFound> => {
3778
- const contents: MountTargetNotFound = {
3779
- name: "MountTargetNotFound",
3780
- $fault: "client",
3781
- $metadata: deserializeMetadata(parsedOutput),
3782
- ErrorCode: undefined,
3783
- Message: undefined,
3784
- };
3785
- const data: any = parsedOutput.body;
3786
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3787
- contents.ErrorCode = __expectString(data.ErrorCode);
3788
- }
3789
- if (data.Message !== undefined && data.Message !== null) {
3790
- contents.Message = __expectString(data.Message);
3791
- }
3792
- return contents;
3793
- };
3794
-
3795
- const deserializeAws_restJson1NetworkInterfaceLimitExceededResponse = async (
3796
- parsedOutput: any,
3797
- context: __SerdeContext
3798
- ): Promise<NetworkInterfaceLimitExceeded> => {
3799
- const contents: NetworkInterfaceLimitExceeded = {
3800
- name: "NetworkInterfaceLimitExceeded",
3801
- $fault: "client",
3802
- $metadata: deserializeMetadata(parsedOutput),
3803
- ErrorCode: undefined,
3804
- Message: undefined,
3805
- };
3806
- const data: any = parsedOutput.body;
3807
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3808
- contents.ErrorCode = __expectString(data.ErrorCode);
3809
- }
3810
- if (data.Message !== undefined && data.Message !== null) {
3811
- contents.Message = __expectString(data.Message);
3812
- }
3813
- return contents;
3814
- };
3815
-
3816
- const deserializeAws_restJson1NoFreeAddressesInSubnetResponse = async (
3817
- parsedOutput: any,
3818
- context: __SerdeContext
3819
- ): Promise<NoFreeAddressesInSubnet> => {
3820
- const contents: NoFreeAddressesInSubnet = {
3821
- name: "NoFreeAddressesInSubnet",
3822
- $fault: "client",
3823
- $metadata: deserializeMetadata(parsedOutput),
3824
- ErrorCode: undefined,
3825
- Message: undefined,
3826
- };
3827
- const data: any = parsedOutput.body;
3828
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3829
- contents.ErrorCode = __expectString(data.ErrorCode);
3830
- }
3831
- if (data.Message !== undefined && data.Message !== null) {
3832
- contents.Message = __expectString(data.Message);
3833
- }
3834
- return contents;
3835
- };
3836
-
3837
- const deserializeAws_restJson1PolicyNotFoundResponse = async (
3838
- parsedOutput: any,
3839
- context: __SerdeContext
3840
- ): Promise<PolicyNotFound> => {
3841
- const contents: PolicyNotFound = {
3842
- name: "PolicyNotFound",
3843
- $fault: "client",
3844
- $metadata: deserializeMetadata(parsedOutput),
3845
- ErrorCode: undefined,
3846
- Message: undefined,
3847
- };
3848
- const data: any = parsedOutput.body;
3849
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3850
- contents.ErrorCode = __expectString(data.ErrorCode);
3851
- }
3852
- if (data.Message !== undefined && data.Message !== null) {
3853
- contents.Message = __expectString(data.Message);
3854
- }
3855
- return contents;
3856
- };
3857
-
3858
- const deserializeAws_restJson1SecurityGroupLimitExceededResponse = async (
3859
- parsedOutput: any,
3860
- context: __SerdeContext
3861
- ): Promise<SecurityGroupLimitExceeded> => {
3862
- const contents: SecurityGroupLimitExceeded = {
3863
- name: "SecurityGroupLimitExceeded",
3864
- $fault: "client",
3865
- $metadata: deserializeMetadata(parsedOutput),
3866
- ErrorCode: undefined,
3867
- Message: undefined,
3868
- };
3869
- const data: any = parsedOutput.body;
3870
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3871
- contents.ErrorCode = __expectString(data.ErrorCode);
3872
- }
3873
- if (data.Message !== undefined && data.Message !== null) {
3874
- contents.Message = __expectString(data.Message);
3875
- }
3876
- return contents;
3877
- };
3878
-
3879
- const deserializeAws_restJson1SecurityGroupNotFoundResponse = async (
3880
- parsedOutput: any,
3881
- context: __SerdeContext
3882
- ): Promise<SecurityGroupNotFound> => {
3883
- const contents: SecurityGroupNotFound = {
3884
- name: "SecurityGroupNotFound",
3885
- $fault: "client",
3886
- $metadata: deserializeMetadata(parsedOutput),
3887
- ErrorCode: undefined,
3888
- Message: undefined,
3889
- };
3890
- const data: any = parsedOutput.body;
3891
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3892
- contents.ErrorCode = __expectString(data.ErrorCode);
3893
- }
3894
- if (data.Message !== undefined && data.Message !== null) {
3895
- contents.Message = __expectString(data.Message);
3896
- }
3897
- return contents;
3898
- };
3899
-
3900
- const deserializeAws_restJson1SubnetNotFoundResponse = async (
3901
- parsedOutput: any,
3902
- context: __SerdeContext
3903
- ): Promise<SubnetNotFound> => {
3904
- const contents: SubnetNotFound = {
3905
- name: "SubnetNotFound",
3906
- $fault: "client",
3907
- $metadata: deserializeMetadata(parsedOutput),
3908
- ErrorCode: undefined,
3909
- Message: undefined,
3910
- };
3911
- const data: any = parsedOutput.body;
3912
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3913
- contents.ErrorCode = __expectString(data.ErrorCode);
3914
- }
3915
- if (data.Message !== undefined && data.Message !== null) {
3916
- contents.Message = __expectString(data.Message);
3917
- }
3918
- return contents;
3919
- };
3920
-
3921
- const deserializeAws_restJson1ThroughputLimitExceededResponse = async (
3922
- parsedOutput: any,
3923
- context: __SerdeContext
3924
- ): Promise<ThroughputLimitExceeded> => {
3925
- const contents: ThroughputLimitExceeded = {
3926
- name: "ThroughputLimitExceeded",
3927
- $fault: "client",
3928
- $metadata: deserializeMetadata(parsedOutput),
3929
- ErrorCode: undefined,
3930
- Message: undefined,
3931
- };
3932
- const data: any = parsedOutput.body;
3933
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3934
- contents.ErrorCode = __expectString(data.ErrorCode);
3935
- }
3936
- if (data.Message !== undefined && data.Message !== null) {
3937
- contents.Message = __expectString(data.Message);
3938
- }
3939
- return contents;
3940
- };
3941
-
3942
- const deserializeAws_restJson1TooManyRequestsResponse = async (
3943
- parsedOutput: any,
3944
- context: __SerdeContext
3945
- ): Promise<TooManyRequests> => {
3946
- const contents: TooManyRequests = {
3947
- name: "TooManyRequests",
3948
- $fault: "client",
3949
- $metadata: deserializeMetadata(parsedOutput),
3950
- ErrorCode: undefined,
3951
- Message: undefined,
3952
- };
3953
- const data: any = parsedOutput.body;
3954
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3955
- contents.ErrorCode = __expectString(data.ErrorCode);
3956
- }
3957
- if (data.Message !== undefined && data.Message !== null) {
3958
- contents.Message = __expectString(data.Message);
3959
- }
3960
- return contents;
3961
- };
3962
-
3963
- const deserializeAws_restJson1UnsupportedAvailabilityZoneResponse = async (
3964
- parsedOutput: any,
3965
- context: __SerdeContext
3966
- ): Promise<UnsupportedAvailabilityZone> => {
3967
- const contents: UnsupportedAvailabilityZone = {
3968
- name: "UnsupportedAvailabilityZone",
3969
- $fault: "client",
3970
- $metadata: deserializeMetadata(parsedOutput),
3971
- ErrorCode: undefined,
3972
- Message: undefined,
3973
- };
3974
- const data: any = parsedOutput.body;
3975
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3976
- contents.ErrorCode = __expectString(data.ErrorCode);
3977
- }
3978
- if (data.Message !== undefined && data.Message !== null) {
3979
- contents.Message = __expectString(data.Message);
3980
- }
3981
- return contents;
3982
- };
3983
-
3984
- const deserializeAws_restJson1ValidationExceptionResponse = async (
3985
- parsedOutput: any,
3986
- context: __SerdeContext
3987
- ): Promise<ValidationException> => {
3988
- const contents: ValidationException = {
3989
- name: "ValidationException",
3990
- $fault: "client",
3991
- $metadata: deserializeMetadata(parsedOutput),
3992
- ErrorCode: undefined,
3993
- Message: undefined,
3994
- };
3995
- const data: any = parsedOutput.body;
3996
- if (data.ErrorCode !== undefined && data.ErrorCode !== null) {
3997
- contents.ErrorCode = __expectString(data.ErrorCode);
3998
- }
3999
- if (data.Message !== undefined && data.Message !== null) {
4000
- contents.Message = __expectString(data.Message);
4001
- }
4002
- return contents;
4003
- };
4004
-
4005
- const serializeAws_restJson1BackupPolicy = (input: BackupPolicy, context: __SerdeContext): any => {
4006
- return {
4007
- ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }),
4008
- };
4009
- };
4010
-
4011
- const serializeAws_restJson1CreationInfo = (input: CreationInfo, context: __SerdeContext): any => {
4012
- return {
4013
- ...(input.OwnerGid !== undefined && input.OwnerGid !== null && { OwnerGid: input.OwnerGid }),
4014
- ...(input.OwnerUid !== undefined && input.OwnerUid !== null && { OwnerUid: input.OwnerUid }),
4015
- ...(input.Permissions !== undefined && input.Permissions !== null && { Permissions: input.Permissions }),
4016
- };
4017
- };
4018
-
4019
- const serializeAws_restJson1LifecyclePolicies = (input: LifecyclePolicy[], context: __SerdeContext): any => {
4020
- return input
4021
- .filter((e: any) => e != null)
4022
- .map((entry) => {
4023
- if (entry === null) {
4024
- return null as any;
4025
- }
4026
- return serializeAws_restJson1LifecyclePolicy(entry, context);
4027
- });
4028
- };
4029
-
4030
- const serializeAws_restJson1LifecyclePolicy = (input: LifecyclePolicy, context: __SerdeContext): any => {
4031
- return {
4032
- ...(input.TransitionToIA !== undefined &&
4033
- input.TransitionToIA !== null && { TransitionToIA: input.TransitionToIA }),
4034
- ...(input.TransitionToPrimaryStorageClass !== undefined &&
4035
- input.TransitionToPrimaryStorageClass !== null && {
4036
- TransitionToPrimaryStorageClass: input.TransitionToPrimaryStorageClass,
4037
- }),
4038
- };
4039
- };
4040
-
4041
- const serializeAws_restJson1PosixUser = (input: PosixUser, context: __SerdeContext): any => {
4042
- return {
4043
- ...(input.Gid !== undefined && input.Gid !== null && { Gid: input.Gid }),
4044
- ...(input.SecondaryGids !== undefined &&
4045
- input.SecondaryGids !== null && {
4046
- SecondaryGids: serializeAws_restJson1SecondaryGids(input.SecondaryGids, context),
4047
- }),
4048
- ...(input.Uid !== undefined && input.Uid !== null && { Uid: input.Uid }),
4049
- };
4050
- };
4051
-
4052
- const serializeAws_restJson1RootDirectory = (input: RootDirectory, context: __SerdeContext): any => {
4053
- return {
4054
- ...(input.CreationInfo !== undefined &&
4055
- input.CreationInfo !== null && { CreationInfo: serializeAws_restJson1CreationInfo(input.CreationInfo, context) }),
4056
- ...(input.Path !== undefined && input.Path !== null && { Path: input.Path }),
4057
- };
4058
- };
4059
-
4060
- const serializeAws_restJson1SecondaryGids = (input: number[], context: __SerdeContext): any => {
4061
- return input
4062
- .filter((e: any) => e != null)
4063
- .map((entry) => {
4064
- if (entry === null) {
4065
- return null as any;
4066
- }
4067
- return entry;
4068
- });
4069
- };
4070
-
4071
- const serializeAws_restJson1SecurityGroups = (input: string[], context: __SerdeContext): any => {
4072
- return input
4073
- .filter((e: any) => e != null)
4074
- .map((entry) => {
4075
- if (entry === null) {
4076
- return null as any;
4077
- }
4078
- return entry;
4079
- });
4080
- };
4081
-
4082
- const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => {
4083
- return {
4084
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
4085
- ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
4086
- };
4087
- };
4088
-
4089
- const serializeAws_restJson1TagKeys = (input: string[], context: __SerdeContext): any => {
4090
- return input
4091
- .filter((e: any) => e != null)
4092
- .map((entry) => {
4093
- if (entry === null) {
4094
- return null as any;
4095
- }
4096
- return entry;
4097
- });
4098
- };
4099
-
4100
- const serializeAws_restJson1Tags = (input: Tag[], context: __SerdeContext): any => {
4101
- return input
4102
- .filter((e: any) => e != null)
4103
- .map((entry) => {
4104
- if (entry === null) {
4105
- return null as any;
4106
- }
4107
- return serializeAws_restJson1Tag(entry, context);
4108
- });
4109
- };
4110
-
4111
- const deserializeAws_restJson1AccessPointDescription = (
4112
- output: any,
4113
- context: __SerdeContext
4114
- ): AccessPointDescription => {
4115
- return {
4116
- AccessPointArn: __expectString(output.AccessPointArn),
4117
- AccessPointId: __expectString(output.AccessPointId),
4118
- ClientToken: __expectString(output.ClientToken),
4119
- FileSystemId: __expectString(output.FileSystemId),
4120
- LifeCycleState: __expectString(output.LifeCycleState),
4121
- Name: __expectString(output.Name),
4122
- OwnerId: __expectString(output.OwnerId),
4123
- PosixUser:
4124
- output.PosixUser !== undefined && output.PosixUser !== null
4125
- ? deserializeAws_restJson1PosixUser(output.PosixUser, context)
4126
- : undefined,
4127
- RootDirectory:
4128
- output.RootDirectory !== undefined && output.RootDirectory !== null
4129
- ? deserializeAws_restJson1RootDirectory(output.RootDirectory, context)
4130
- : undefined,
4131
- Tags:
4132
- output.Tags !== undefined && output.Tags !== null
4133
- ? deserializeAws_restJson1Tags(output.Tags, context)
4134
- : undefined,
4135
- } as any;
4136
- };
4137
-
4138
- const deserializeAws_restJson1AccessPointDescriptions = (
4139
- output: any,
4140
- context: __SerdeContext
4141
- ): AccessPointDescription[] => {
4142
- return (output || [])
4143
- .filter((e: any) => e != null)
4144
- .map((entry: any) => {
4145
- if (entry === null) {
4146
- return null as any;
4147
- }
4148
- return deserializeAws_restJson1AccessPointDescription(entry, context);
4149
- });
4150
- };
4151
-
4152
- const deserializeAws_restJson1BackupPolicy = (output: any, context: __SerdeContext): BackupPolicy => {
4153
- return {
4154
- Status: __expectString(output.Status),
4155
- } as any;
4156
- };
4157
-
4158
- const deserializeAws_restJson1CreationInfo = (output: any, context: __SerdeContext): CreationInfo => {
4159
- return {
4160
- OwnerGid: __expectLong(output.OwnerGid),
4161
- OwnerUid: __expectLong(output.OwnerUid),
4162
- Permissions: __expectString(output.Permissions),
4163
- } as any;
4164
- };
4165
-
4166
- const deserializeAws_restJson1FileSystemDescription = (output: any, context: __SerdeContext): FileSystemDescription => {
4167
- return {
4168
- AvailabilityZoneId: __expectString(output.AvailabilityZoneId),
4169
- AvailabilityZoneName: __expectString(output.AvailabilityZoneName),
4170
- CreationTime:
4171
- output.CreationTime !== undefined && output.CreationTime !== null
4172
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
4173
- : undefined,
4174
- CreationToken: __expectString(output.CreationToken),
4175
- Encrypted: __expectBoolean(output.Encrypted),
4176
- FileSystemArn: __expectString(output.FileSystemArn),
4177
- FileSystemId: __expectString(output.FileSystemId),
4178
- KmsKeyId: __expectString(output.KmsKeyId),
4179
- LifeCycleState: __expectString(output.LifeCycleState),
4180
- Name: __expectString(output.Name),
4181
- NumberOfMountTargets: __expectInt32(output.NumberOfMountTargets),
4182
- OwnerId: __expectString(output.OwnerId),
4183
- PerformanceMode: __expectString(output.PerformanceMode),
4184
- ProvisionedThroughputInMibps: __limitedParseDouble(output.ProvisionedThroughputInMibps),
4185
- SizeInBytes:
4186
- output.SizeInBytes !== undefined && output.SizeInBytes !== null
4187
- ? deserializeAws_restJson1FileSystemSize(output.SizeInBytes, context)
4188
- : undefined,
4189
- Tags:
4190
- output.Tags !== undefined && output.Tags !== null
4191
- ? deserializeAws_restJson1Tags(output.Tags, context)
4192
- : undefined,
4193
- ThroughputMode: __expectString(output.ThroughputMode),
4194
- } as any;
4195
- };
4196
-
4197
- const deserializeAws_restJson1FileSystemDescriptions = (
4198
- output: any,
4199
- context: __SerdeContext
4200
- ): FileSystemDescription[] => {
4201
- return (output || [])
4202
- .filter((e: any) => e != null)
4203
- .map((entry: any) => {
4204
- if (entry === null) {
4205
- return null as any;
4206
- }
4207
- return deserializeAws_restJson1FileSystemDescription(entry, context);
4208
- });
4209
- };
4210
-
4211
- const deserializeAws_restJson1FileSystemSize = (output: any, context: __SerdeContext): FileSystemSize => {
4212
- return {
4213
- Timestamp:
4214
- output.Timestamp !== undefined && output.Timestamp !== null
4215
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Timestamp)))
4216
- : undefined,
4217
- Value: __expectLong(output.Value),
4218
- ValueInIA: __expectLong(output.ValueInIA),
4219
- ValueInStandard: __expectLong(output.ValueInStandard),
4220
- } as any;
4221
- };
4222
-
4223
- const deserializeAws_restJson1LifecyclePolicies = (output: any, context: __SerdeContext): LifecyclePolicy[] => {
4224
- return (output || [])
4225
- .filter((e: any) => e != null)
4226
- .map((entry: any) => {
4227
- if (entry === null) {
4228
- return null as any;
4229
- }
4230
- return deserializeAws_restJson1LifecyclePolicy(entry, context);
4231
- });
4232
- };
4233
-
4234
- const deserializeAws_restJson1LifecyclePolicy = (output: any, context: __SerdeContext): LifecyclePolicy => {
4235
- return {
4236
- TransitionToIA: __expectString(output.TransitionToIA),
4237
- TransitionToPrimaryStorageClass: __expectString(output.TransitionToPrimaryStorageClass),
4238
- } as any;
4239
- };
4240
-
4241
- const deserializeAws_restJson1MountTargetDescription = (
4242
- output: any,
4243
- context: __SerdeContext
4244
- ): MountTargetDescription => {
4245
- return {
4246
- AvailabilityZoneId: __expectString(output.AvailabilityZoneId),
4247
- AvailabilityZoneName: __expectString(output.AvailabilityZoneName),
4248
- FileSystemId: __expectString(output.FileSystemId),
4249
- IpAddress: __expectString(output.IpAddress),
4250
- LifeCycleState: __expectString(output.LifeCycleState),
4251
- MountTargetId: __expectString(output.MountTargetId),
4252
- NetworkInterfaceId: __expectString(output.NetworkInterfaceId),
4253
- OwnerId: __expectString(output.OwnerId),
4254
- SubnetId: __expectString(output.SubnetId),
4255
- VpcId: __expectString(output.VpcId),
4256
- } as any;
4257
- };
4258
-
4259
- const deserializeAws_restJson1MountTargetDescriptions = (
4260
- output: any,
4261
- context: __SerdeContext
4262
- ): MountTargetDescription[] => {
4263
- return (output || [])
4264
- .filter((e: any) => e != null)
4265
- .map((entry: any) => {
4266
- if (entry === null) {
4267
- return null as any;
4268
- }
4269
- return deserializeAws_restJson1MountTargetDescription(entry, context);
4270
- });
4271
- };
4272
-
4273
- const deserializeAws_restJson1PosixUser = (output: any, context: __SerdeContext): PosixUser => {
4274
- return {
4275
- Gid: __expectLong(output.Gid),
4276
- SecondaryGids:
4277
- output.SecondaryGids !== undefined && output.SecondaryGids !== null
4278
- ? deserializeAws_restJson1SecondaryGids(output.SecondaryGids, context)
4279
- : undefined,
4280
- Uid: __expectLong(output.Uid),
4281
- } as any;
4282
- };
4283
-
4284
- const deserializeAws_restJson1ResourceIdPreference = (output: any, context: __SerdeContext): ResourceIdPreference => {
4285
- return {
4286
- ResourceIdType: __expectString(output.ResourceIdType),
4287
- Resources:
4288
- output.Resources !== undefined && output.Resources !== null
4289
- ? deserializeAws_restJson1Resources(output.Resources, context)
4290
- : undefined,
4291
- } as any;
4292
- };
4293
-
4294
- const deserializeAws_restJson1Resources = (output: any, context: __SerdeContext): (Resource | string)[] => {
4295
- return (output || [])
4296
- .filter((e: any) => e != null)
4297
- .map((entry: any) => {
4298
- if (entry === null) {
4299
- return null as any;
4300
- }
4301
- return __expectString(entry) as any;
4302
- });
4303
- };
4304
-
4305
- const deserializeAws_restJson1RootDirectory = (output: any, context: __SerdeContext): RootDirectory => {
4306
- return {
4307
- CreationInfo:
4308
- output.CreationInfo !== undefined && output.CreationInfo !== null
4309
- ? deserializeAws_restJson1CreationInfo(output.CreationInfo, context)
4310
- : undefined,
4311
- Path: __expectString(output.Path),
4312
- } as any;
4313
- };
4314
-
4315
- const deserializeAws_restJson1SecondaryGids = (output: any, context: __SerdeContext): number[] => {
4316
- return (output || [])
4317
- .filter((e: any) => e != null)
4318
- .map((entry: any) => {
4319
- if (entry === null) {
4320
- return null as any;
4321
- }
4322
- return __expectLong(entry) as any;
4323
- });
4324
- };
4325
-
4326
- const deserializeAws_restJson1SecurityGroups = (output: any, context: __SerdeContext): string[] => {
4327
- return (output || [])
4328
- .filter((e: any) => e != null)
4329
- .map((entry: any) => {
4330
- if (entry === null) {
4331
- return null as any;
4332
- }
4333
- return __expectString(entry) as any;
4334
- });
4335
- };
4336
-
4337
- const deserializeAws_restJson1Tag = (output: any, context: __SerdeContext): Tag => {
4338
- return {
4339
- Key: __expectString(output.Key),
4340
- Value: __expectString(output.Value),
4341
- } as any;
4342
- };
4343
-
4344
- const deserializeAws_restJson1Tags = (output: any, context: __SerdeContext): Tag[] => {
4345
- return (output || [])
4346
- .filter((e: any) => e != null)
4347
- .map((entry: any) => {
4348
- if (entry === null) {
4349
- return null as any;
4350
- }
4351
- return deserializeAws_restJson1Tag(entry, context);
4352
- });
4353
- };
4354
-
4355
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
4356
- httpStatusCode: output.statusCode,
4357
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
4358
- extendedRequestId: output.headers["x-amz-id-2"],
4359
- cfId: output.headers["x-amz-cf-id"],
4360
- });
4361
-
4362
- // Collect low-level response body stream to Uint8Array.
4363
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
4364
- if (streamBody instanceof Uint8Array) {
4365
- return Promise.resolve(streamBody);
4366
- }
4367
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4368
- };
4369
-
4370
- // Encode Uint8Array data into string with utf-8.
4371
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
4372
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4373
-
4374
- const isSerializableHeaderValue = (value: any): boolean =>
4375
- value !== undefined &&
4376
- value !== null &&
4377
- value !== "" &&
4378
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
4379
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
4380
-
4381
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
4382
- collectBodyString(streamBody, context).then((encoded) => {
4383
- if (encoded.length) {
4384
- return JSON.parse(encoded);
4385
- }
4386
- return {};
4387
- });
4388
-
4389
- /**
4390
- * Load an error code for the aws.rest-json-1.1 protocol.
4391
- */
4392
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
4393
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
4394
-
4395
- const sanitizeErrorCode = (rawValue: string): string => {
4396
- let cleanValue = rawValue;
4397
- if (cleanValue.indexOf(":") >= 0) {
4398
- cleanValue = cleanValue.split(":")[0];
4399
- }
4400
- if (cleanValue.indexOf("#") >= 0) {
4401
- cleanValue = cleanValue.split("#")[1];
4402
- }
4403
- return cleanValue;
4404
- };
4405
-
4406
- const headerKey = findKey(output.headers, "x-amzn-errortype");
4407
- if (headerKey !== undefined) {
4408
- return sanitizeErrorCode(output.headers[headerKey]);
4409
- }
4410
-
4411
- if (data.code !== undefined) {
4412
- return sanitizeErrorCode(data.code);
4413
- }
4414
-
4415
- if (data["__type"] !== undefined) {
4416
- return sanitizeErrorCode(data["__type"]);
4417
- }
4418
-
4419
- return "";
4420
- };