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