@aws-sdk/client-vpc-lattice 3.303.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 (315) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +628 -0
  3. package/dist-cjs/VPCLattice.js +787 -0
  4. package/dist-cjs/VPCLatticeClient.js +40 -0
  5. package/dist-cjs/commands/BatchUpdateRuleCommand.js +45 -0
  6. package/dist-cjs/commands/CreateAccessLogSubscriptionCommand.js +45 -0
  7. package/dist-cjs/commands/CreateListenerCommand.js +45 -0
  8. package/dist-cjs/commands/CreateRuleCommand.js +45 -0
  9. package/dist-cjs/commands/CreateServiceCommand.js +45 -0
  10. package/dist-cjs/commands/CreateServiceNetworkCommand.js +45 -0
  11. package/dist-cjs/commands/CreateServiceNetworkServiceAssociationCommand.js +45 -0
  12. package/dist-cjs/commands/CreateServiceNetworkVpcAssociationCommand.js +45 -0
  13. package/dist-cjs/commands/CreateTargetGroupCommand.js +45 -0
  14. package/dist-cjs/commands/DeleteAccessLogSubscriptionCommand.js +45 -0
  15. package/dist-cjs/commands/DeleteAuthPolicyCommand.js +45 -0
  16. package/dist-cjs/commands/DeleteListenerCommand.js +45 -0
  17. package/dist-cjs/commands/DeleteResourcePolicyCommand.js +45 -0
  18. package/dist-cjs/commands/DeleteRuleCommand.js +45 -0
  19. package/dist-cjs/commands/DeleteServiceCommand.js +45 -0
  20. package/dist-cjs/commands/DeleteServiceNetworkCommand.js +45 -0
  21. package/dist-cjs/commands/DeleteServiceNetworkServiceAssociationCommand.js +45 -0
  22. package/dist-cjs/commands/DeleteServiceNetworkVpcAssociationCommand.js +45 -0
  23. package/dist-cjs/commands/DeleteTargetGroupCommand.js +45 -0
  24. package/dist-cjs/commands/DeregisterTargetsCommand.js +45 -0
  25. package/dist-cjs/commands/GetAccessLogSubscriptionCommand.js +45 -0
  26. package/dist-cjs/commands/GetAuthPolicyCommand.js +45 -0
  27. package/dist-cjs/commands/GetListenerCommand.js +45 -0
  28. package/dist-cjs/commands/GetResourcePolicyCommand.js +45 -0
  29. package/dist-cjs/commands/GetRuleCommand.js +45 -0
  30. package/dist-cjs/commands/GetServiceCommand.js +45 -0
  31. package/dist-cjs/commands/GetServiceNetworkCommand.js +45 -0
  32. package/dist-cjs/commands/GetServiceNetworkServiceAssociationCommand.js +45 -0
  33. package/dist-cjs/commands/GetServiceNetworkVpcAssociationCommand.js +45 -0
  34. package/dist-cjs/commands/GetTargetGroupCommand.js +45 -0
  35. package/dist-cjs/commands/ListAccessLogSubscriptionsCommand.js +45 -0
  36. package/dist-cjs/commands/ListListenersCommand.js +45 -0
  37. package/dist-cjs/commands/ListRulesCommand.js +45 -0
  38. package/dist-cjs/commands/ListServiceNetworkServiceAssociationsCommand.js +45 -0
  39. package/dist-cjs/commands/ListServiceNetworkVpcAssociationsCommand.js +45 -0
  40. package/dist-cjs/commands/ListServiceNetworksCommand.js +45 -0
  41. package/dist-cjs/commands/ListServicesCommand.js +45 -0
  42. package/dist-cjs/commands/ListTagsForResourceCommand.js +45 -0
  43. package/dist-cjs/commands/ListTargetGroupsCommand.js +45 -0
  44. package/dist-cjs/commands/ListTargetsCommand.js +45 -0
  45. package/dist-cjs/commands/PutAuthPolicyCommand.js +45 -0
  46. package/dist-cjs/commands/PutResourcePolicyCommand.js +45 -0
  47. package/dist-cjs/commands/RegisterTargetsCommand.js +45 -0
  48. package/dist-cjs/commands/TagResourceCommand.js +45 -0
  49. package/dist-cjs/commands/UntagResourceCommand.js +45 -0
  50. package/dist-cjs/commands/UpdateAccessLogSubscriptionCommand.js +45 -0
  51. package/dist-cjs/commands/UpdateListenerCommand.js +45 -0
  52. package/dist-cjs/commands/UpdateRuleCommand.js +45 -0
  53. package/dist-cjs/commands/UpdateServiceCommand.js +45 -0
  54. package/dist-cjs/commands/UpdateServiceNetworkCommand.js +45 -0
  55. package/dist-cjs/commands/UpdateServiceNetworkVpcAssociationCommand.js +45 -0
  56. package/dist-cjs/commands/UpdateTargetGroupCommand.js +45 -0
  57. package/dist-cjs/commands/index.js +55 -0
  58. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  59. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  60. package/dist-cjs/endpoint/ruleset.js +7 -0
  61. package/dist-cjs/index.js +11 -0
  62. package/dist-cjs/models/VPCLatticeServiceException.js +11 -0
  63. package/dist-cjs/models/index.js +4 -0
  64. package/dist-cjs/models/models_0.js +240 -0
  65. package/dist-cjs/pagination/Interfaces.js +2 -0
  66. package/dist-cjs/pagination/ListAccessLogSubscriptionsPaginator.js +29 -0
  67. package/dist-cjs/pagination/ListListenersPaginator.js +29 -0
  68. package/dist-cjs/pagination/ListRulesPaginator.js +29 -0
  69. package/dist-cjs/pagination/ListServiceNetworkServiceAssociationsPaginator.js +29 -0
  70. package/dist-cjs/pagination/ListServiceNetworkVpcAssociationsPaginator.js +29 -0
  71. package/dist-cjs/pagination/ListServiceNetworksPaginator.js +29 -0
  72. package/dist-cjs/pagination/ListServicesPaginator.js +29 -0
  73. package/dist-cjs/pagination/ListTargetGroupsPaginator.js +29 -0
  74. package/dist-cjs/pagination/ListTargetsPaginator.js +29 -0
  75. package/dist-cjs/pagination/index.js +13 -0
  76. package/dist-cjs/protocols/Aws_restJson1.js +4911 -0
  77. package/dist-cjs/runtimeConfig.browser.js +39 -0
  78. package/dist-cjs/runtimeConfig.js +48 -0
  79. package/dist-cjs/runtimeConfig.native.js +15 -0
  80. package/dist-cjs/runtimeConfig.shared.js +21 -0
  81. package/dist-es/VPCLattice.js +783 -0
  82. package/dist-es/VPCLatticeClient.js +36 -0
  83. package/dist-es/commands/BatchUpdateRuleCommand.js +41 -0
  84. package/dist-es/commands/CreateAccessLogSubscriptionCommand.js +41 -0
  85. package/dist-es/commands/CreateListenerCommand.js +41 -0
  86. package/dist-es/commands/CreateRuleCommand.js +41 -0
  87. package/dist-es/commands/CreateServiceCommand.js +41 -0
  88. package/dist-es/commands/CreateServiceNetworkCommand.js +41 -0
  89. package/dist-es/commands/CreateServiceNetworkServiceAssociationCommand.js +41 -0
  90. package/dist-es/commands/CreateServiceNetworkVpcAssociationCommand.js +41 -0
  91. package/dist-es/commands/CreateTargetGroupCommand.js +41 -0
  92. package/dist-es/commands/DeleteAccessLogSubscriptionCommand.js +41 -0
  93. package/dist-es/commands/DeleteAuthPolicyCommand.js +41 -0
  94. package/dist-es/commands/DeleteListenerCommand.js +41 -0
  95. package/dist-es/commands/DeleteResourcePolicyCommand.js +41 -0
  96. package/dist-es/commands/DeleteRuleCommand.js +41 -0
  97. package/dist-es/commands/DeleteServiceCommand.js +41 -0
  98. package/dist-es/commands/DeleteServiceNetworkCommand.js +41 -0
  99. package/dist-es/commands/DeleteServiceNetworkServiceAssociationCommand.js +41 -0
  100. package/dist-es/commands/DeleteServiceNetworkVpcAssociationCommand.js +41 -0
  101. package/dist-es/commands/DeleteTargetGroupCommand.js +41 -0
  102. package/dist-es/commands/DeregisterTargetsCommand.js +41 -0
  103. package/dist-es/commands/GetAccessLogSubscriptionCommand.js +41 -0
  104. package/dist-es/commands/GetAuthPolicyCommand.js +41 -0
  105. package/dist-es/commands/GetListenerCommand.js +41 -0
  106. package/dist-es/commands/GetResourcePolicyCommand.js +41 -0
  107. package/dist-es/commands/GetRuleCommand.js +41 -0
  108. package/dist-es/commands/GetServiceCommand.js +41 -0
  109. package/dist-es/commands/GetServiceNetworkCommand.js +41 -0
  110. package/dist-es/commands/GetServiceNetworkServiceAssociationCommand.js +41 -0
  111. package/dist-es/commands/GetServiceNetworkVpcAssociationCommand.js +41 -0
  112. package/dist-es/commands/GetTargetGroupCommand.js +41 -0
  113. package/dist-es/commands/ListAccessLogSubscriptionsCommand.js +41 -0
  114. package/dist-es/commands/ListListenersCommand.js +41 -0
  115. package/dist-es/commands/ListRulesCommand.js +41 -0
  116. package/dist-es/commands/ListServiceNetworkServiceAssociationsCommand.js +41 -0
  117. package/dist-es/commands/ListServiceNetworkVpcAssociationsCommand.js +41 -0
  118. package/dist-es/commands/ListServiceNetworksCommand.js +41 -0
  119. package/dist-es/commands/ListServicesCommand.js +41 -0
  120. package/dist-es/commands/ListTagsForResourceCommand.js +41 -0
  121. package/dist-es/commands/ListTargetGroupsCommand.js +41 -0
  122. package/dist-es/commands/ListTargetsCommand.js +41 -0
  123. package/dist-es/commands/PutAuthPolicyCommand.js +41 -0
  124. package/dist-es/commands/PutResourcePolicyCommand.js +41 -0
  125. package/dist-es/commands/RegisterTargetsCommand.js +41 -0
  126. package/dist-es/commands/TagResourceCommand.js +41 -0
  127. package/dist-es/commands/UntagResourceCommand.js +41 -0
  128. package/dist-es/commands/UpdateAccessLogSubscriptionCommand.js +41 -0
  129. package/dist-es/commands/UpdateListenerCommand.js +41 -0
  130. package/dist-es/commands/UpdateRuleCommand.js +41 -0
  131. package/dist-es/commands/UpdateServiceCommand.js +41 -0
  132. package/dist-es/commands/UpdateServiceNetworkCommand.js +41 -0
  133. package/dist-es/commands/UpdateServiceNetworkVpcAssociationCommand.js +41 -0
  134. package/dist-es/commands/UpdateTargetGroupCommand.js +41 -0
  135. package/dist-es/commands/index.js +52 -0
  136. package/dist-es/endpoint/EndpointParameters.js +8 -0
  137. package/dist-es/endpoint/endpointResolver.js +8 -0
  138. package/dist-es/endpoint/ruleset.js +4 -0
  139. package/dist-es/index.js +6 -0
  140. package/dist-es/models/VPCLatticeServiceException.js +7 -0
  141. package/dist-es/models/index.js +1 -0
  142. package/dist-es/models/models_0.js +230 -0
  143. package/dist-es/pagination/Interfaces.js +1 -0
  144. package/dist-es/pagination/ListAccessLogSubscriptionsPaginator.js +25 -0
  145. package/dist-es/pagination/ListListenersPaginator.js +25 -0
  146. package/dist-es/pagination/ListRulesPaginator.js +25 -0
  147. package/dist-es/pagination/ListServiceNetworkServiceAssociationsPaginator.js +25 -0
  148. package/dist-es/pagination/ListServiceNetworkVpcAssociationsPaginator.js +25 -0
  149. package/dist-es/pagination/ListServiceNetworksPaginator.js +25 -0
  150. package/dist-es/pagination/ListServicesPaginator.js +25 -0
  151. package/dist-es/pagination/ListTargetGroupsPaginator.js +25 -0
  152. package/dist-es/pagination/ListTargetsPaginator.js +25 -0
  153. package/dist-es/pagination/index.js +10 -0
  154. package/dist-es/protocols/Aws_restJson1.js +4802 -0
  155. package/dist-es/runtimeConfig.browser.js +34 -0
  156. package/dist-es/runtimeConfig.js +43 -0
  157. package/dist-es/runtimeConfig.native.js +11 -0
  158. package/dist-es/runtimeConfig.shared.js +17 -0
  159. package/dist-types/VPCLattice.d.ts +506 -0
  160. package/dist-types/VPCLatticeClient.d.ts +217 -0
  161. package/dist-types/commands/BatchUpdateRuleCommand.d.ts +127 -0
  162. package/dist-types/commands/CreateAccessLogSubscriptionCommand.d.ts +93 -0
  163. package/dist-types/commands/CreateListenerCommand.d.ts +109 -0
  164. package/dist-types/commands/CreateRuleCommand.d.ts +132 -0
  165. package/dist-types/commands/CreateServiceCommand.d.ts +96 -0
  166. package/dist-types/commands/CreateServiceNetworkCommand.d.ts +94 -0
  167. package/dist-types/commands/CreateServiceNetworkServiceAssociationCommand.d.ts +95 -0
  168. package/dist-types/commands/CreateServiceNetworkVpcAssociationCommand.d.ts +103 -0
  169. package/dist-types/commands/CreateTargetGroupCommand.d.ts +115 -0
  170. package/dist-types/commands/DeleteAccessLogSubscriptionCommand.d.ts +79 -0
  171. package/dist-types/commands/DeleteAuthPolicyCommand.d.ts +82 -0
  172. package/dist-types/commands/DeleteListenerCommand.d.ts +84 -0
  173. package/dist-types/commands/DeleteResourcePolicyCommand.d.ts +79 -0
  174. package/dist-types/commands/DeleteRuleCommand.d.ts +90 -0
  175. package/dist-types/commands/DeleteServiceCommand.d.ts +87 -0
  176. package/dist-types/commands/DeleteServiceNetworkCommand.d.ts +87 -0
  177. package/dist-types/commands/DeleteServiceNetworkServiceAssociationCommand.d.ts +84 -0
  178. package/dist-types/commands/DeleteServiceNetworkVpcAssociationCommand.d.ts +84 -0
  179. package/dist-types/commands/DeleteTargetGroupCommand.d.ts +81 -0
  180. package/dist-types/commands/DeregisterTargetsCommand.d.ts +89 -0
  181. package/dist-types/commands/GetAccessLogSubscriptionCommand.d.ts +79 -0
  182. package/dist-types/commands/GetAuthPolicyCommand.d.ts +80 -0
  183. package/dist-types/commands/GetListenerCommand.d.ts +80 -0
  184. package/dist-types/commands/GetResourcePolicyCommand.d.ts +80 -0
  185. package/dist-types/commands/GetRuleCommand.d.ts +83 -0
  186. package/dist-types/commands/GetServiceCommand.d.ts +79 -0
  187. package/dist-types/commands/GetServiceNetworkCommand.d.ts +79 -0
  188. package/dist-types/commands/GetServiceNetworkServiceAssociationCommand.d.ts +80 -0
  189. package/dist-types/commands/GetServiceNetworkVpcAssociationCommand.d.ts +79 -0
  190. package/dist-types/commands/GetTargetGroupCommand.d.ts +76 -0
  191. package/dist-types/commands/ListAccessLogSubscriptionsCommand.d.ts +75 -0
  192. package/dist-types/commands/ListListenersCommand.d.ts +81 -0
  193. package/dist-types/commands/ListRulesCommand.d.ts +82 -0
  194. package/dist-types/commands/ListServiceNetworkServiceAssociationsCommand.d.ts +86 -0
  195. package/dist-types/commands/ListServiceNetworkVpcAssociationsCommand.d.ts +81 -0
  196. package/dist-types/commands/ListServiceNetworksCommand.d.ts +78 -0
  197. package/dist-types/commands/ListServicesCommand.d.ts +77 -0
  198. package/dist-types/commands/ListTagsForResourceCommand.d.ts +73 -0
  199. package/dist-types/commands/ListTargetGroupsCommand.d.ts +80 -0
  200. package/dist-types/commands/ListTargetsCommand.d.ts +88 -0
  201. package/dist-types/commands/PutAuthPolicyCommand.d.ts +80 -0
  202. package/dist-types/commands/PutResourcePolicyCommand.d.ts +82 -0
  203. package/dist-types/commands/RegisterTargetsCommand.d.ts +93 -0
  204. package/dist-types/commands/TagResourceCommand.d.ts +82 -0
  205. package/dist-types/commands/UntagResourceCommand.d.ts +76 -0
  206. package/dist-types/commands/UpdateAccessLogSubscriptionCommand.d.ts +84 -0
  207. package/dist-types/commands/UpdateListenerCommand.d.ts +97 -0
  208. package/dist-types/commands/UpdateRuleCommand.d.ts +123 -0
  209. package/dist-types/commands/UpdateServiceCommand.d.ts +85 -0
  210. package/dist-types/commands/UpdateServiceNetworkCommand.d.ts +84 -0
  211. package/dist-types/commands/UpdateServiceNetworkVpcAssociationCommand.d.ts +87 -0
  212. package/dist-types/commands/UpdateTargetGroupCommand.d.ts +94 -0
  213. package/dist-types/commands/index.d.ts +52 -0
  214. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  215. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  216. package/dist-types/endpoint/ruleset.d.ts +2 -0
  217. package/dist-types/index.d.ts +6 -0
  218. package/dist-types/models/VPCLatticeServiceException.d.ts +12 -0
  219. package/dist-types/models/index.d.ts +1 -0
  220. package/dist-types/models/models_0.d.ts +3439 -0
  221. package/dist-types/pagination/Interfaces.d.ts +8 -0
  222. package/dist-types/pagination/ListAccessLogSubscriptionsPaginator.d.ts +7 -0
  223. package/dist-types/pagination/ListListenersPaginator.d.ts +7 -0
  224. package/dist-types/pagination/ListRulesPaginator.d.ts +7 -0
  225. package/dist-types/pagination/ListServiceNetworkServiceAssociationsPaginator.d.ts +7 -0
  226. package/dist-types/pagination/ListServiceNetworkVpcAssociationsPaginator.d.ts +7 -0
  227. package/dist-types/pagination/ListServiceNetworksPaginator.d.ts +7 -0
  228. package/dist-types/pagination/ListServicesPaginator.d.ts +7 -0
  229. package/dist-types/pagination/ListTargetGroupsPaginator.d.ts +7 -0
  230. package/dist-types/pagination/ListTargetsPaginator.d.ts +7 -0
  231. package/dist-types/pagination/index.d.ts +10 -0
  232. package/dist-types/protocols/Aws_restJson1.d.ts +158 -0
  233. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  234. package/dist-types/runtimeConfig.d.ts +42 -0
  235. package/dist-types/runtimeConfig.native.d.ts +41 -0
  236. package/dist-types/runtimeConfig.shared.d.ts +18 -0
  237. package/dist-types/ts3.4/VPCLattice.d.ts +936 -0
  238. package/dist-types/ts3.4/VPCLatticeClient.d.ts +424 -0
  239. package/dist-types/ts3.4/commands/BatchUpdateRuleCommand.d.ts +37 -0
  240. package/dist-types/ts3.4/commands/CreateAccessLogSubscriptionCommand.d.ts +41 -0
  241. package/dist-types/ts3.4/commands/CreateListenerCommand.d.ts +37 -0
  242. package/dist-types/ts3.4/commands/CreateRuleCommand.d.ts +34 -0
  243. package/dist-types/ts3.4/commands/CreateServiceCommand.d.ts +37 -0
  244. package/dist-types/ts3.4/commands/CreateServiceNetworkCommand.d.ts +41 -0
  245. package/dist-types/ts3.4/commands/CreateServiceNetworkServiceAssociationCommand.d.ts +41 -0
  246. package/dist-types/ts3.4/commands/CreateServiceNetworkVpcAssociationCommand.d.ts +41 -0
  247. package/dist-types/ts3.4/commands/CreateTargetGroupCommand.d.ts +38 -0
  248. package/dist-types/ts3.4/commands/DeleteAccessLogSubscriptionCommand.d.ts +41 -0
  249. package/dist-types/ts3.4/commands/DeleteAuthPolicyCommand.d.ts +37 -0
  250. package/dist-types/ts3.4/commands/DeleteListenerCommand.d.ts +37 -0
  251. package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +41 -0
  252. package/dist-types/ts3.4/commands/DeleteRuleCommand.d.ts +34 -0
  253. package/dist-types/ts3.4/commands/DeleteServiceCommand.d.ts +37 -0
  254. package/dist-types/ts3.4/commands/DeleteServiceNetworkCommand.d.ts +41 -0
  255. package/dist-types/ts3.4/commands/DeleteServiceNetworkServiceAssociationCommand.d.ts +41 -0
  256. package/dist-types/ts3.4/commands/DeleteServiceNetworkVpcAssociationCommand.d.ts +41 -0
  257. package/dist-types/ts3.4/commands/DeleteTargetGroupCommand.d.ts +38 -0
  258. package/dist-types/ts3.4/commands/DeregisterTargetsCommand.d.ts +38 -0
  259. package/dist-types/ts3.4/commands/GetAccessLogSubscriptionCommand.d.ts +41 -0
  260. package/dist-types/ts3.4/commands/GetAuthPolicyCommand.d.ts +37 -0
  261. package/dist-types/ts3.4/commands/GetListenerCommand.d.ts +34 -0
  262. package/dist-types/ts3.4/commands/GetResourcePolicyCommand.d.ts +38 -0
  263. package/dist-types/ts3.4/commands/GetRuleCommand.d.ts +34 -0
  264. package/dist-types/ts3.4/commands/GetServiceCommand.d.ts +34 -0
  265. package/dist-types/ts3.4/commands/GetServiceNetworkCommand.d.ts +38 -0
  266. package/dist-types/ts3.4/commands/GetServiceNetworkServiceAssociationCommand.d.ts +41 -0
  267. package/dist-types/ts3.4/commands/GetServiceNetworkVpcAssociationCommand.d.ts +41 -0
  268. package/dist-types/ts3.4/commands/GetTargetGroupCommand.d.ts +37 -0
  269. package/dist-types/ts3.4/commands/ListAccessLogSubscriptionsCommand.d.ts +41 -0
  270. package/dist-types/ts3.4/commands/ListListenersCommand.d.ts +37 -0
  271. package/dist-types/ts3.4/commands/ListRulesCommand.d.ts +34 -0
  272. package/dist-types/ts3.4/commands/ListServiceNetworkServiceAssociationsCommand.d.ts +41 -0
  273. package/dist-types/ts3.4/commands/ListServiceNetworkVpcAssociationsCommand.d.ts +41 -0
  274. package/dist-types/ts3.4/commands/ListServiceNetworksCommand.d.ts +38 -0
  275. package/dist-types/ts3.4/commands/ListServicesCommand.d.ts +34 -0
  276. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  277. package/dist-types/ts3.4/commands/ListTargetGroupsCommand.d.ts +37 -0
  278. package/dist-types/ts3.4/commands/ListTargetsCommand.d.ts +34 -0
  279. package/dist-types/ts3.4/commands/PutAuthPolicyCommand.d.ts +37 -0
  280. package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +38 -0
  281. package/dist-types/ts3.4/commands/RegisterTargetsCommand.d.ts +37 -0
  282. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  283. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +37 -0
  284. package/dist-types/ts3.4/commands/UpdateAccessLogSubscriptionCommand.d.ts +41 -0
  285. package/dist-types/ts3.4/commands/UpdateListenerCommand.d.ts +37 -0
  286. package/dist-types/ts3.4/commands/UpdateRuleCommand.d.ts +34 -0
  287. package/dist-types/ts3.4/commands/UpdateServiceCommand.d.ts +37 -0
  288. package/dist-types/ts3.4/commands/UpdateServiceNetworkCommand.d.ts +41 -0
  289. package/dist-types/ts3.4/commands/UpdateServiceNetworkVpcAssociationCommand.d.ts +41 -0
  290. package/dist-types/ts3.4/commands/UpdateTargetGroupCommand.d.ts +38 -0
  291. package/dist-types/ts3.4/commands/index.d.ts +52 -0
  292. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  293. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  294. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  295. package/dist-types/ts3.4/index.d.ts +6 -0
  296. package/dist-types/ts3.4/models/VPCLatticeServiceException.d.ts +7 -0
  297. package/dist-types/ts3.4/models/index.d.ts +1 -0
  298. package/dist-types/ts3.4/models/models_0.d.ts +1022 -0
  299. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  300. package/dist-types/ts3.4/pagination/ListAccessLogSubscriptionsPaginator.d.ts +11 -0
  301. package/dist-types/ts3.4/pagination/ListListenersPaginator.d.ts +11 -0
  302. package/dist-types/ts3.4/pagination/ListRulesPaginator.d.ts +11 -0
  303. package/dist-types/ts3.4/pagination/ListServiceNetworkServiceAssociationsPaginator.d.ts +11 -0
  304. package/dist-types/ts3.4/pagination/ListServiceNetworkVpcAssociationsPaginator.d.ts +11 -0
  305. package/dist-types/ts3.4/pagination/ListServiceNetworksPaginator.d.ts +11 -0
  306. package/dist-types/ts3.4/pagination/ListServicesPaginator.d.ts +11 -0
  307. package/dist-types/ts3.4/pagination/ListTargetGroupsPaginator.d.ts +11 -0
  308. package/dist-types/ts3.4/pagination/ListTargetsPaginator.d.ts +11 -0
  309. package/dist-types/ts3.4/pagination/index.d.ts +10 -0
  310. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +629 -0
  311. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +91 -0
  312. package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
  313. package/dist-types/ts3.4/runtimeConfig.native.d.ts +80 -0
  314. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +18 -0
  315. package/package.json +100 -0
@@ -0,0 +1,4802 @@
1
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
+ import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, map as __map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
3
+ import { v4 as generateIdempotencyToken } from "uuid";
4
+ import { AccessDeniedException, ConflictException, HeaderMatchType, InternalServerException, Matcher, PathMatchType, ResourceNotFoundException, RuleAction, RuleMatch, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ import { VPCLatticeServiceException as __BaseException } from "../models/VPCLatticeServiceException";
6
+ export const serializeAws_restJson1BatchUpdateRuleCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
12
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules";
13
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
14
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
15
+ let body;
16
+ body = JSON.stringify({
17
+ ...(input.rules != null && { rules: serializeAws_restJson1RuleUpdateList(input.rules, context) }),
18
+ });
19
+ return new __HttpRequest({
20
+ protocol,
21
+ hostname,
22
+ port,
23
+ method: "PATCH",
24
+ headers,
25
+ path: resolvedPath,
26
+ body,
27
+ });
28
+ };
29
+ export const serializeAws_restJson1CreateAccessLogSubscriptionCommand = async (input, context) => {
30
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
+ const headers = {
32
+ "content-type": "application/json",
33
+ };
34
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/accesslogsubscriptions";
35
+ let body;
36
+ body = JSON.stringify({
37
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
38
+ ...(input.destinationArn != null && { destinationArn: input.destinationArn }),
39
+ ...(input.resourceIdentifier != null && { resourceIdentifier: input.resourceIdentifier }),
40
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
41
+ });
42
+ return new __HttpRequest({
43
+ protocol,
44
+ hostname,
45
+ port,
46
+ method: "POST",
47
+ headers,
48
+ path: resolvedPath,
49
+ body,
50
+ });
51
+ };
52
+ export const serializeAws_restJson1CreateListenerCommand = async (input, context) => {
53
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
54
+ const headers = {
55
+ "content-type": "application/json",
56
+ };
57
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}/listeners";
58
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
59
+ let body;
60
+ body = JSON.stringify({
61
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
62
+ ...(input.defaultAction != null && {
63
+ defaultAction: serializeAws_restJson1RuleAction(input.defaultAction, context),
64
+ }),
65
+ ...(input.name != null && { name: input.name }),
66
+ ...(input.port != null && { port: input.port }),
67
+ ...(input.protocol != null && { protocol: input.protocol }),
68
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
69
+ });
70
+ return new __HttpRequest({
71
+ protocol,
72
+ hostname,
73
+ port,
74
+ method: "POST",
75
+ headers,
76
+ path: resolvedPath,
77
+ body,
78
+ });
79
+ };
80
+ export const serializeAws_restJson1CreateRuleCommand = async (input, context) => {
81
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
82
+ const headers = {
83
+ "content-type": "application/json",
84
+ };
85
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
86
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules";
87
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
88
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
89
+ let body;
90
+ body = JSON.stringify({
91
+ ...(input.action != null && { action: serializeAws_restJson1RuleAction(input.action, context) }),
92
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
93
+ ...(input.match != null && { match: serializeAws_restJson1RuleMatch(input.match, context) }),
94
+ ...(input.name != null && { name: input.name }),
95
+ ...(input.priority != null && { priority: input.priority }),
96
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
97
+ });
98
+ return new __HttpRequest({
99
+ protocol,
100
+ hostname,
101
+ port,
102
+ method: "POST",
103
+ headers,
104
+ path: resolvedPath,
105
+ body,
106
+ });
107
+ };
108
+ export const serializeAws_restJson1CreateServiceCommand = async (input, context) => {
109
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
110
+ const headers = {
111
+ "content-type": "application/json",
112
+ };
113
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services";
114
+ let body;
115
+ body = JSON.stringify({
116
+ ...(input.authType != null && { authType: input.authType }),
117
+ ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
118
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
119
+ ...(input.customDomainName != null && { customDomainName: input.customDomainName }),
120
+ ...(input.name != null && { name: input.name }),
121
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
122
+ });
123
+ return new __HttpRequest({
124
+ protocol,
125
+ hostname,
126
+ port,
127
+ method: "POST",
128
+ headers,
129
+ path: resolvedPath,
130
+ body,
131
+ });
132
+ };
133
+ export const serializeAws_restJson1CreateServiceNetworkCommand = async (input, context) => {
134
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
+ const headers = {
136
+ "content-type": "application/json",
137
+ };
138
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworks";
139
+ let body;
140
+ body = JSON.stringify({
141
+ ...(input.authType != null && { authType: input.authType }),
142
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
143
+ ...(input.name != null && { name: input.name }),
144
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
145
+ });
146
+ return new __HttpRequest({
147
+ protocol,
148
+ hostname,
149
+ port,
150
+ method: "POST",
151
+ headers,
152
+ path: resolvedPath,
153
+ body,
154
+ });
155
+ };
156
+ export const serializeAws_restJson1CreateServiceNetworkServiceAssociationCommand = async (input, context) => {
157
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
+ const headers = {
159
+ "content-type": "application/json",
160
+ };
161
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkserviceassociations";
162
+ let body;
163
+ body = JSON.stringify({
164
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
165
+ ...(input.serviceIdentifier != null && { serviceIdentifier: input.serviceIdentifier }),
166
+ ...(input.serviceNetworkIdentifier != null && { serviceNetworkIdentifier: input.serviceNetworkIdentifier }),
167
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
168
+ });
169
+ return new __HttpRequest({
170
+ protocol,
171
+ hostname,
172
+ port,
173
+ method: "POST",
174
+ headers,
175
+ path: resolvedPath,
176
+ body,
177
+ });
178
+ };
179
+ export const serializeAws_restJson1CreateServiceNetworkVpcAssociationCommand = async (input, context) => {
180
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
+ const headers = {
182
+ "content-type": "application/json",
183
+ };
184
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkvpcassociations";
185
+ let body;
186
+ body = JSON.stringify({
187
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
188
+ ...(input.securityGroupIds != null && {
189
+ securityGroupIds: serializeAws_restJson1SecurityGroupList(input.securityGroupIds, context),
190
+ }),
191
+ ...(input.serviceNetworkIdentifier != null && { serviceNetworkIdentifier: input.serviceNetworkIdentifier }),
192
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
193
+ ...(input.vpcIdentifier != null && { vpcIdentifier: input.vpcIdentifier }),
194
+ });
195
+ return new __HttpRequest({
196
+ protocol,
197
+ hostname,
198
+ port,
199
+ method: "POST",
200
+ headers,
201
+ path: resolvedPath,
202
+ body,
203
+ });
204
+ };
205
+ export const serializeAws_restJson1CreateTargetGroupCommand = async (input, context) => {
206
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
207
+ const headers = {
208
+ "content-type": "application/json",
209
+ };
210
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups";
211
+ let body;
212
+ body = JSON.stringify({
213
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
214
+ ...(input.config != null && { config: serializeAws_restJson1TargetGroupConfig(input.config, context) }),
215
+ ...(input.name != null && { name: input.name }),
216
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
217
+ ...(input.type != null && { type: input.type }),
218
+ });
219
+ return new __HttpRequest({
220
+ protocol,
221
+ hostname,
222
+ port,
223
+ method: "POST",
224
+ headers,
225
+ path: resolvedPath,
226
+ body,
227
+ });
228
+ };
229
+ export const serializeAws_restJson1DeleteAccessLogSubscriptionCommand = async (input, context) => {
230
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
231
+ const headers = {};
232
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
233
+ "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}";
234
+ resolvedPath = __resolvedPath(resolvedPath, input, "accessLogSubscriptionIdentifier", () => input.accessLogSubscriptionIdentifier, "{accessLogSubscriptionIdentifier}", false);
235
+ let body;
236
+ return new __HttpRequest({
237
+ protocol,
238
+ hostname,
239
+ port,
240
+ method: "DELETE",
241
+ headers,
242
+ path: resolvedPath,
243
+ body,
244
+ });
245
+ };
246
+ export const serializeAws_restJson1DeleteAuthPolicyCommand = async (input, context) => {
247
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
248
+ const headers = {};
249
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/authpolicy/{resourceIdentifier}";
250
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceIdentifier", () => input.resourceIdentifier, "{resourceIdentifier}", false);
251
+ let body;
252
+ return new __HttpRequest({
253
+ protocol,
254
+ hostname,
255
+ port,
256
+ method: "DELETE",
257
+ headers,
258
+ path: resolvedPath,
259
+ body,
260
+ });
261
+ };
262
+ export const serializeAws_restJson1DeleteListenerCommand = async (input, context) => {
263
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
264
+ const headers = {};
265
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
266
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}";
267
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
268
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
269
+ let body;
270
+ return new __HttpRequest({
271
+ protocol,
272
+ hostname,
273
+ port,
274
+ method: "DELETE",
275
+ headers,
276
+ path: resolvedPath,
277
+ body,
278
+ });
279
+ };
280
+ export const serializeAws_restJson1DeleteResourcePolicyCommand = async (input, context) => {
281
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
282
+ const headers = {};
283
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{resourceArn}";
284
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
285
+ let body;
286
+ return new __HttpRequest({
287
+ protocol,
288
+ hostname,
289
+ port,
290
+ method: "DELETE",
291
+ headers,
292
+ path: resolvedPath,
293
+ body,
294
+ });
295
+ };
296
+ export const serializeAws_restJson1DeleteRuleCommand = async (input, context) => {
297
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
298
+ const headers = {};
299
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
300
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}";
301
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
302
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
303
+ resolvedPath = __resolvedPath(resolvedPath, input, "ruleIdentifier", () => input.ruleIdentifier, "{ruleIdentifier}", false);
304
+ let body;
305
+ return new __HttpRequest({
306
+ protocol,
307
+ hostname,
308
+ port,
309
+ method: "DELETE",
310
+ headers,
311
+ path: resolvedPath,
312
+ body,
313
+ });
314
+ };
315
+ export const serializeAws_restJson1DeleteServiceCommand = async (input, context) => {
316
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
317
+ const headers = {};
318
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}";
319
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
320
+ let body;
321
+ return new __HttpRequest({
322
+ protocol,
323
+ hostname,
324
+ port,
325
+ method: "DELETE",
326
+ headers,
327
+ path: resolvedPath,
328
+ body,
329
+ });
330
+ };
331
+ export const serializeAws_restJson1DeleteServiceNetworkCommand = async (input, context) => {
332
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
333
+ const headers = {};
334
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
335
+ "/servicenetworks/{serviceNetworkIdentifier}";
336
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkIdentifier", () => input.serviceNetworkIdentifier, "{serviceNetworkIdentifier}", false);
337
+ let body;
338
+ return new __HttpRequest({
339
+ protocol,
340
+ hostname,
341
+ port,
342
+ method: "DELETE",
343
+ headers,
344
+ path: resolvedPath,
345
+ body,
346
+ });
347
+ };
348
+ export const serializeAws_restJson1DeleteServiceNetworkServiceAssociationCommand = async (input, context) => {
349
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
350
+ const headers = {};
351
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
352
+ "/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}";
353
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkServiceAssociationIdentifier", () => input.serviceNetworkServiceAssociationIdentifier, "{serviceNetworkServiceAssociationIdentifier}", false);
354
+ let body;
355
+ return new __HttpRequest({
356
+ protocol,
357
+ hostname,
358
+ port,
359
+ method: "DELETE",
360
+ headers,
361
+ path: resolvedPath,
362
+ body,
363
+ });
364
+ };
365
+ export const serializeAws_restJson1DeleteServiceNetworkVpcAssociationCommand = async (input, context) => {
366
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
367
+ const headers = {};
368
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
369
+ "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}";
370
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkVpcAssociationIdentifier", () => input.serviceNetworkVpcAssociationIdentifier, "{serviceNetworkVpcAssociationIdentifier}", false);
371
+ let body;
372
+ return new __HttpRequest({
373
+ protocol,
374
+ hostname,
375
+ port,
376
+ method: "DELETE",
377
+ headers,
378
+ path: resolvedPath,
379
+ body,
380
+ });
381
+ };
382
+ export const serializeAws_restJson1DeleteTargetGroupCommand = async (input, context) => {
383
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
384
+ const headers = {};
385
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups/{targetGroupIdentifier}";
386
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
387
+ let body;
388
+ return new __HttpRequest({
389
+ protocol,
390
+ hostname,
391
+ port,
392
+ method: "DELETE",
393
+ headers,
394
+ path: resolvedPath,
395
+ body,
396
+ });
397
+ };
398
+ export const serializeAws_restJson1DeregisterTargetsCommand = async (input, context) => {
399
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
400
+ const headers = {
401
+ "content-type": "application/json",
402
+ };
403
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
404
+ "/targetgroups/{targetGroupIdentifier}/deregistertargets";
405
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
406
+ let body;
407
+ body = JSON.stringify({
408
+ ...(input.targets != null && { targets: serializeAws_restJson1TargetList(input.targets, context) }),
409
+ });
410
+ return new __HttpRequest({
411
+ protocol,
412
+ hostname,
413
+ port,
414
+ method: "POST",
415
+ headers,
416
+ path: resolvedPath,
417
+ body,
418
+ });
419
+ };
420
+ export const serializeAws_restJson1GetAccessLogSubscriptionCommand = async (input, context) => {
421
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
422
+ const headers = {};
423
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
424
+ "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}";
425
+ resolvedPath = __resolvedPath(resolvedPath, input, "accessLogSubscriptionIdentifier", () => input.accessLogSubscriptionIdentifier, "{accessLogSubscriptionIdentifier}", false);
426
+ let body;
427
+ return new __HttpRequest({
428
+ protocol,
429
+ hostname,
430
+ port,
431
+ method: "GET",
432
+ headers,
433
+ path: resolvedPath,
434
+ body,
435
+ });
436
+ };
437
+ export const serializeAws_restJson1GetAuthPolicyCommand = async (input, context) => {
438
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
439
+ const headers = {};
440
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/authpolicy/{resourceIdentifier}";
441
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceIdentifier", () => input.resourceIdentifier, "{resourceIdentifier}", false);
442
+ let body;
443
+ return new __HttpRequest({
444
+ protocol,
445
+ hostname,
446
+ port,
447
+ method: "GET",
448
+ headers,
449
+ path: resolvedPath,
450
+ body,
451
+ });
452
+ };
453
+ export const serializeAws_restJson1GetListenerCommand = async (input, context) => {
454
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
455
+ const headers = {};
456
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
457
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}";
458
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
459
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
460
+ let body;
461
+ return new __HttpRequest({
462
+ protocol,
463
+ hostname,
464
+ port,
465
+ method: "GET",
466
+ headers,
467
+ path: resolvedPath,
468
+ body,
469
+ });
470
+ };
471
+ export const serializeAws_restJson1GetResourcePolicyCommand = async (input, context) => {
472
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
473
+ const headers = {};
474
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{resourceArn}";
475
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
476
+ let body;
477
+ return new __HttpRequest({
478
+ protocol,
479
+ hostname,
480
+ port,
481
+ method: "GET",
482
+ headers,
483
+ path: resolvedPath,
484
+ body,
485
+ });
486
+ };
487
+ export const serializeAws_restJson1GetRuleCommand = async (input, context) => {
488
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
489
+ const headers = {};
490
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
491
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}";
492
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
493
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
494
+ resolvedPath = __resolvedPath(resolvedPath, input, "ruleIdentifier", () => input.ruleIdentifier, "{ruleIdentifier}", false);
495
+ let body;
496
+ return new __HttpRequest({
497
+ protocol,
498
+ hostname,
499
+ port,
500
+ method: "GET",
501
+ headers,
502
+ path: resolvedPath,
503
+ body,
504
+ });
505
+ };
506
+ export const serializeAws_restJson1GetServiceCommand = async (input, context) => {
507
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
508
+ const headers = {};
509
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}";
510
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
511
+ let body;
512
+ return new __HttpRequest({
513
+ protocol,
514
+ hostname,
515
+ port,
516
+ method: "GET",
517
+ headers,
518
+ path: resolvedPath,
519
+ body,
520
+ });
521
+ };
522
+ export const serializeAws_restJson1GetServiceNetworkCommand = async (input, context) => {
523
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
524
+ const headers = {};
525
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
526
+ "/servicenetworks/{serviceNetworkIdentifier}";
527
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkIdentifier", () => input.serviceNetworkIdentifier, "{serviceNetworkIdentifier}", false);
528
+ let body;
529
+ return new __HttpRequest({
530
+ protocol,
531
+ hostname,
532
+ port,
533
+ method: "GET",
534
+ headers,
535
+ path: resolvedPath,
536
+ body,
537
+ });
538
+ };
539
+ export const serializeAws_restJson1GetServiceNetworkServiceAssociationCommand = async (input, context) => {
540
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
541
+ const headers = {};
542
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
543
+ "/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}";
544
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkServiceAssociationIdentifier", () => input.serviceNetworkServiceAssociationIdentifier, "{serviceNetworkServiceAssociationIdentifier}", false);
545
+ let body;
546
+ return new __HttpRequest({
547
+ protocol,
548
+ hostname,
549
+ port,
550
+ method: "GET",
551
+ headers,
552
+ path: resolvedPath,
553
+ body,
554
+ });
555
+ };
556
+ export const serializeAws_restJson1GetServiceNetworkVpcAssociationCommand = async (input, context) => {
557
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
558
+ const headers = {};
559
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
560
+ "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}";
561
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkVpcAssociationIdentifier", () => input.serviceNetworkVpcAssociationIdentifier, "{serviceNetworkVpcAssociationIdentifier}", false);
562
+ let body;
563
+ return new __HttpRequest({
564
+ protocol,
565
+ hostname,
566
+ port,
567
+ method: "GET",
568
+ headers,
569
+ path: resolvedPath,
570
+ body,
571
+ });
572
+ };
573
+ export const serializeAws_restJson1GetTargetGroupCommand = async (input, context) => {
574
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
575
+ const headers = {};
576
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups/{targetGroupIdentifier}";
577
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
578
+ let body;
579
+ return new __HttpRequest({
580
+ protocol,
581
+ hostname,
582
+ port,
583
+ method: "GET",
584
+ headers,
585
+ path: resolvedPath,
586
+ body,
587
+ });
588
+ };
589
+ export const serializeAws_restJson1ListAccessLogSubscriptionsCommand = async (input, context) => {
590
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
591
+ const headers = {};
592
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/accesslogsubscriptions";
593
+ const query = map({
594
+ resourceIdentifier: [, __expectNonNull(input.resourceIdentifier, `resourceIdentifier`)],
595
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
596
+ nextToken: [, input.nextToken],
597
+ });
598
+ let body;
599
+ return new __HttpRequest({
600
+ protocol,
601
+ hostname,
602
+ port,
603
+ method: "GET",
604
+ headers,
605
+ path: resolvedPath,
606
+ query,
607
+ body,
608
+ });
609
+ };
610
+ export const serializeAws_restJson1ListListenersCommand = async (input, context) => {
611
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
612
+ const headers = {};
613
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}/listeners";
614
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
615
+ const query = map({
616
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
617
+ nextToken: [, input.nextToken],
618
+ });
619
+ let body;
620
+ return new __HttpRequest({
621
+ protocol,
622
+ hostname,
623
+ port,
624
+ method: "GET",
625
+ headers,
626
+ path: resolvedPath,
627
+ query,
628
+ body,
629
+ });
630
+ };
631
+ export const serializeAws_restJson1ListRulesCommand = async (input, context) => {
632
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
633
+ const headers = {};
634
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
635
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules";
636
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
637
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
638
+ const query = map({
639
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
640
+ nextToken: [, input.nextToken],
641
+ });
642
+ let body;
643
+ return new __HttpRequest({
644
+ protocol,
645
+ hostname,
646
+ port,
647
+ method: "GET",
648
+ headers,
649
+ path: resolvedPath,
650
+ query,
651
+ body,
652
+ });
653
+ };
654
+ export const serializeAws_restJson1ListServiceNetworksCommand = async (input, context) => {
655
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
656
+ const headers = {};
657
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworks";
658
+ const query = map({
659
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
660
+ nextToken: [, input.nextToken],
661
+ });
662
+ let body;
663
+ return new __HttpRequest({
664
+ protocol,
665
+ hostname,
666
+ port,
667
+ method: "GET",
668
+ headers,
669
+ path: resolvedPath,
670
+ query,
671
+ body,
672
+ });
673
+ };
674
+ export const serializeAws_restJson1ListServiceNetworkServiceAssociationsCommand = async (input, context) => {
675
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
676
+ const headers = {};
677
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkserviceassociations";
678
+ const query = map({
679
+ serviceNetworkIdentifier: [, input.serviceNetworkIdentifier],
680
+ serviceIdentifier: [, input.serviceIdentifier],
681
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
682
+ nextToken: [, input.nextToken],
683
+ });
684
+ let body;
685
+ return new __HttpRequest({
686
+ protocol,
687
+ hostname,
688
+ port,
689
+ method: "GET",
690
+ headers,
691
+ path: resolvedPath,
692
+ query,
693
+ body,
694
+ });
695
+ };
696
+ export const serializeAws_restJson1ListServiceNetworkVpcAssociationsCommand = async (input, context) => {
697
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
698
+ const headers = {};
699
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/servicenetworkvpcassociations";
700
+ const query = map({
701
+ serviceNetworkIdentifier: [, input.serviceNetworkIdentifier],
702
+ vpcIdentifier: [, input.vpcIdentifier],
703
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
704
+ nextToken: [, input.nextToken],
705
+ });
706
+ let body;
707
+ return new __HttpRequest({
708
+ protocol,
709
+ hostname,
710
+ port,
711
+ method: "GET",
712
+ headers,
713
+ path: resolvedPath,
714
+ query,
715
+ body,
716
+ });
717
+ };
718
+ export const serializeAws_restJson1ListServicesCommand = async (input, context) => {
719
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
720
+ const headers = {};
721
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services";
722
+ const query = map({
723
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
724
+ nextToken: [, input.nextToken],
725
+ });
726
+ let body;
727
+ return new __HttpRequest({
728
+ protocol,
729
+ hostname,
730
+ port,
731
+ method: "GET",
732
+ headers,
733
+ path: resolvedPath,
734
+ query,
735
+ body,
736
+ });
737
+ };
738
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
739
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
740
+ const headers = {};
741
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
742
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
743
+ let body;
744
+ return new __HttpRequest({
745
+ protocol,
746
+ hostname,
747
+ port,
748
+ method: "GET",
749
+ headers,
750
+ path: resolvedPath,
751
+ body,
752
+ });
753
+ };
754
+ export const serializeAws_restJson1ListTargetGroupsCommand = async (input, context) => {
755
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
756
+ const headers = {};
757
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups";
758
+ const query = map({
759
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
760
+ nextToken: [, input.nextToken],
761
+ vpcIdentifier: [, input.vpcIdentifier],
762
+ targetGroupType: [, input.targetGroupType],
763
+ });
764
+ let body;
765
+ return new __HttpRequest({
766
+ protocol,
767
+ hostname,
768
+ port,
769
+ method: "GET",
770
+ headers,
771
+ path: resolvedPath,
772
+ query,
773
+ body,
774
+ });
775
+ };
776
+ export const serializeAws_restJson1ListTargetsCommand = async (input, context) => {
777
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
778
+ const headers = {
779
+ "content-type": "application/json",
780
+ };
781
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
782
+ "/targetgroups/{targetGroupIdentifier}/listtargets";
783
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
784
+ const query = map({
785
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
786
+ nextToken: [, input.nextToken],
787
+ });
788
+ let body;
789
+ body = JSON.stringify({
790
+ ...(input.targets != null && { targets: serializeAws_restJson1TargetList(input.targets, context) }),
791
+ });
792
+ return new __HttpRequest({
793
+ protocol,
794
+ hostname,
795
+ port,
796
+ method: "POST",
797
+ headers,
798
+ path: resolvedPath,
799
+ query,
800
+ body,
801
+ });
802
+ };
803
+ export const serializeAws_restJson1PutAuthPolicyCommand = async (input, context) => {
804
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
805
+ const headers = {
806
+ "content-type": "application/json",
807
+ };
808
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/authpolicy/{resourceIdentifier}";
809
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceIdentifier", () => input.resourceIdentifier, "{resourceIdentifier}", false);
810
+ let body;
811
+ body = JSON.stringify({
812
+ ...(input.policy != null && { policy: input.policy }),
813
+ });
814
+ return new __HttpRequest({
815
+ protocol,
816
+ hostname,
817
+ port,
818
+ method: "PUT",
819
+ headers,
820
+ path: resolvedPath,
821
+ body,
822
+ });
823
+ };
824
+ export const serializeAws_restJson1PutResourcePolicyCommand = async (input, context) => {
825
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
826
+ const headers = {
827
+ "content-type": "application/json",
828
+ };
829
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/resourcepolicy/{resourceArn}";
830
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
831
+ let body;
832
+ body = JSON.stringify({
833
+ ...(input.policy != null && { policy: input.policy }),
834
+ });
835
+ return new __HttpRequest({
836
+ protocol,
837
+ hostname,
838
+ port,
839
+ method: "PUT",
840
+ headers,
841
+ path: resolvedPath,
842
+ body,
843
+ });
844
+ };
845
+ export const serializeAws_restJson1RegisterTargetsCommand = async (input, context) => {
846
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
847
+ const headers = {
848
+ "content-type": "application/json",
849
+ };
850
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
851
+ "/targetgroups/{targetGroupIdentifier}/registertargets";
852
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
853
+ let body;
854
+ body = JSON.stringify({
855
+ ...(input.targets != null && { targets: serializeAws_restJson1TargetList(input.targets, context) }),
856
+ });
857
+ return new __HttpRequest({
858
+ protocol,
859
+ hostname,
860
+ port,
861
+ method: "POST",
862
+ headers,
863
+ path: resolvedPath,
864
+ body,
865
+ });
866
+ };
867
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
868
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
869
+ const headers = {
870
+ "content-type": "application/json",
871
+ };
872
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
873
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
874
+ let body;
875
+ body = JSON.stringify({
876
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
877
+ });
878
+ return new __HttpRequest({
879
+ protocol,
880
+ hostname,
881
+ port,
882
+ method: "POST",
883
+ headers,
884
+ path: resolvedPath,
885
+ body,
886
+ });
887
+ };
888
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
889
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
890
+ const headers = {};
891
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
892
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
893
+ const query = map({
894
+ tagKeys: [
895
+ __expectNonNull(input.tagKeys, `tagKeys`) != null,
896
+ () => (input.tagKeys || []).map((_entry) => _entry),
897
+ ],
898
+ });
899
+ let body;
900
+ return new __HttpRequest({
901
+ protocol,
902
+ hostname,
903
+ port,
904
+ method: "DELETE",
905
+ headers,
906
+ path: resolvedPath,
907
+ query,
908
+ body,
909
+ });
910
+ };
911
+ export const serializeAws_restJson1UpdateAccessLogSubscriptionCommand = async (input, context) => {
912
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
913
+ const headers = {
914
+ "content-type": "application/json",
915
+ };
916
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
917
+ "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}";
918
+ resolvedPath = __resolvedPath(resolvedPath, input, "accessLogSubscriptionIdentifier", () => input.accessLogSubscriptionIdentifier, "{accessLogSubscriptionIdentifier}", false);
919
+ let body;
920
+ body = JSON.stringify({
921
+ ...(input.destinationArn != null && { destinationArn: input.destinationArn }),
922
+ });
923
+ return new __HttpRequest({
924
+ protocol,
925
+ hostname,
926
+ port,
927
+ method: "PATCH",
928
+ headers,
929
+ path: resolvedPath,
930
+ body,
931
+ });
932
+ };
933
+ export const serializeAws_restJson1UpdateListenerCommand = async (input, context) => {
934
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
935
+ const headers = {
936
+ "content-type": "application/json",
937
+ };
938
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
939
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}";
940
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
941
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
942
+ let body;
943
+ body = JSON.stringify({
944
+ ...(input.defaultAction != null && {
945
+ defaultAction: serializeAws_restJson1RuleAction(input.defaultAction, context),
946
+ }),
947
+ });
948
+ return new __HttpRequest({
949
+ protocol,
950
+ hostname,
951
+ port,
952
+ method: "PATCH",
953
+ headers,
954
+ path: resolvedPath,
955
+ body,
956
+ });
957
+ };
958
+ export const serializeAws_restJson1UpdateRuleCommand = async (input, context) => {
959
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
960
+ const headers = {
961
+ "content-type": "application/json",
962
+ };
963
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
964
+ "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}";
965
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
966
+ resolvedPath = __resolvedPath(resolvedPath, input, "listenerIdentifier", () => input.listenerIdentifier, "{listenerIdentifier}", false);
967
+ resolvedPath = __resolvedPath(resolvedPath, input, "ruleIdentifier", () => input.ruleIdentifier, "{ruleIdentifier}", false);
968
+ let body;
969
+ body = JSON.stringify({
970
+ ...(input.action != null && { action: serializeAws_restJson1RuleAction(input.action, context) }),
971
+ ...(input.match != null && { match: serializeAws_restJson1RuleMatch(input.match, context) }),
972
+ ...(input.priority != null && { priority: input.priority }),
973
+ });
974
+ return new __HttpRequest({
975
+ protocol,
976
+ hostname,
977
+ port,
978
+ method: "PATCH",
979
+ headers,
980
+ path: resolvedPath,
981
+ body,
982
+ });
983
+ };
984
+ export const serializeAws_restJson1UpdateServiceCommand = async (input, context) => {
985
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
986
+ const headers = {
987
+ "content-type": "application/json",
988
+ };
989
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/services/{serviceIdentifier}";
990
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceIdentifier", () => input.serviceIdentifier, "{serviceIdentifier}", false);
991
+ let body;
992
+ body = JSON.stringify({
993
+ ...(input.authType != null && { authType: input.authType }),
994
+ ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
995
+ });
996
+ return new __HttpRequest({
997
+ protocol,
998
+ hostname,
999
+ port,
1000
+ method: "PATCH",
1001
+ headers,
1002
+ path: resolvedPath,
1003
+ body,
1004
+ });
1005
+ };
1006
+ export const serializeAws_restJson1UpdateServiceNetworkCommand = async (input, context) => {
1007
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1008
+ const headers = {
1009
+ "content-type": "application/json",
1010
+ };
1011
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
1012
+ "/servicenetworks/{serviceNetworkIdentifier}";
1013
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkIdentifier", () => input.serviceNetworkIdentifier, "{serviceNetworkIdentifier}", false);
1014
+ let body;
1015
+ body = JSON.stringify({
1016
+ ...(input.authType != null && { authType: input.authType }),
1017
+ });
1018
+ return new __HttpRequest({
1019
+ protocol,
1020
+ hostname,
1021
+ port,
1022
+ method: "PATCH",
1023
+ headers,
1024
+ path: resolvedPath,
1025
+ body,
1026
+ });
1027
+ };
1028
+ export const serializeAws_restJson1UpdateServiceNetworkVpcAssociationCommand = async (input, context) => {
1029
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1030
+ const headers = {
1031
+ "content-type": "application/json",
1032
+ };
1033
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
1034
+ "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}";
1035
+ resolvedPath = __resolvedPath(resolvedPath, input, "serviceNetworkVpcAssociationIdentifier", () => input.serviceNetworkVpcAssociationIdentifier, "{serviceNetworkVpcAssociationIdentifier}", false);
1036
+ let body;
1037
+ body = JSON.stringify({
1038
+ ...(input.securityGroupIds != null && {
1039
+ securityGroupIds: serializeAws_restJson1SecurityGroupList(input.securityGroupIds, context),
1040
+ }),
1041
+ });
1042
+ return new __HttpRequest({
1043
+ protocol,
1044
+ hostname,
1045
+ port,
1046
+ method: "PATCH",
1047
+ headers,
1048
+ path: resolvedPath,
1049
+ body,
1050
+ });
1051
+ };
1052
+ export const serializeAws_restJson1UpdateTargetGroupCommand = async (input, context) => {
1053
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1054
+ const headers = {
1055
+ "content-type": "application/json",
1056
+ };
1057
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetgroups/{targetGroupIdentifier}";
1058
+ resolvedPath = __resolvedPath(resolvedPath, input, "targetGroupIdentifier", () => input.targetGroupIdentifier, "{targetGroupIdentifier}", false);
1059
+ let body;
1060
+ body = JSON.stringify({
1061
+ ...(input.healthCheck != null && {
1062
+ healthCheck: serializeAws_restJson1HealthCheckConfig(input.healthCheck, context),
1063
+ }),
1064
+ });
1065
+ return new __HttpRequest({
1066
+ protocol,
1067
+ hostname,
1068
+ port,
1069
+ method: "PATCH",
1070
+ headers,
1071
+ path: resolvedPath,
1072
+ body,
1073
+ });
1074
+ };
1075
+ export const deserializeAws_restJson1BatchUpdateRuleCommand = async (output, context) => {
1076
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1077
+ return deserializeAws_restJson1BatchUpdateRuleCommandError(output, context);
1078
+ }
1079
+ const contents = map({
1080
+ $metadata: deserializeMetadata(output),
1081
+ });
1082
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1083
+ if (data.successful != null) {
1084
+ contents.successful = deserializeAws_restJson1RuleUpdateSuccessList(data.successful, context);
1085
+ }
1086
+ if (data.unsuccessful != null) {
1087
+ contents.unsuccessful = deserializeAws_restJson1RuleUpdateFailureList(data.unsuccessful, context);
1088
+ }
1089
+ return contents;
1090
+ };
1091
+ const deserializeAws_restJson1BatchUpdateRuleCommandError = async (output, context) => {
1092
+ const parsedOutput = {
1093
+ ...output,
1094
+ body: await parseErrorBody(output.body, context),
1095
+ };
1096
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1097
+ switch (errorCode) {
1098
+ case "AccessDeniedException":
1099
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1100
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1101
+ case "ConflictException":
1102
+ case "com.amazonaws.vpclattice#ConflictException":
1103
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1104
+ case "InternalServerException":
1105
+ case "com.amazonaws.vpclattice#InternalServerException":
1106
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1107
+ case "ResourceNotFoundException":
1108
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1109
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1110
+ case "ThrottlingException":
1111
+ case "com.amazonaws.vpclattice#ThrottlingException":
1112
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1113
+ case "ValidationException":
1114
+ case "com.amazonaws.vpclattice#ValidationException":
1115
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1116
+ default:
1117
+ const parsedBody = parsedOutput.body;
1118
+ throwDefaultError({
1119
+ output,
1120
+ parsedBody,
1121
+ exceptionCtor: __BaseException,
1122
+ errorCode,
1123
+ });
1124
+ }
1125
+ };
1126
+ export const deserializeAws_restJson1CreateAccessLogSubscriptionCommand = async (output, context) => {
1127
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1128
+ return deserializeAws_restJson1CreateAccessLogSubscriptionCommandError(output, context);
1129
+ }
1130
+ const contents = map({
1131
+ $metadata: deserializeMetadata(output),
1132
+ });
1133
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1134
+ if (data.arn != null) {
1135
+ contents.arn = __expectString(data.arn);
1136
+ }
1137
+ if (data.destinationArn != null) {
1138
+ contents.destinationArn = __expectString(data.destinationArn);
1139
+ }
1140
+ if (data.id != null) {
1141
+ contents.id = __expectString(data.id);
1142
+ }
1143
+ if (data.resourceArn != null) {
1144
+ contents.resourceArn = __expectString(data.resourceArn);
1145
+ }
1146
+ if (data.resourceId != null) {
1147
+ contents.resourceId = __expectString(data.resourceId);
1148
+ }
1149
+ return contents;
1150
+ };
1151
+ const deserializeAws_restJson1CreateAccessLogSubscriptionCommandError = async (output, context) => {
1152
+ const parsedOutput = {
1153
+ ...output,
1154
+ body: await parseErrorBody(output.body, context),
1155
+ };
1156
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1157
+ switch (errorCode) {
1158
+ case "AccessDeniedException":
1159
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1160
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1161
+ case "ConflictException":
1162
+ case "com.amazonaws.vpclattice#ConflictException":
1163
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1164
+ case "InternalServerException":
1165
+ case "com.amazonaws.vpclattice#InternalServerException":
1166
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1167
+ case "ResourceNotFoundException":
1168
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1169
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1170
+ case "ThrottlingException":
1171
+ case "com.amazonaws.vpclattice#ThrottlingException":
1172
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1173
+ case "ValidationException":
1174
+ case "com.amazonaws.vpclattice#ValidationException":
1175
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1176
+ default:
1177
+ const parsedBody = parsedOutput.body;
1178
+ throwDefaultError({
1179
+ output,
1180
+ parsedBody,
1181
+ exceptionCtor: __BaseException,
1182
+ errorCode,
1183
+ });
1184
+ }
1185
+ };
1186
+ export const deserializeAws_restJson1CreateListenerCommand = async (output, context) => {
1187
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1188
+ return deserializeAws_restJson1CreateListenerCommandError(output, context);
1189
+ }
1190
+ const contents = map({
1191
+ $metadata: deserializeMetadata(output),
1192
+ });
1193
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1194
+ if (data.arn != null) {
1195
+ contents.arn = __expectString(data.arn);
1196
+ }
1197
+ if (data.defaultAction != null) {
1198
+ contents.defaultAction = deserializeAws_restJson1RuleAction(__expectUnion(data.defaultAction), context);
1199
+ }
1200
+ if (data.id != null) {
1201
+ contents.id = __expectString(data.id);
1202
+ }
1203
+ if (data.name != null) {
1204
+ contents.name = __expectString(data.name);
1205
+ }
1206
+ if (data.port != null) {
1207
+ contents.port = __expectInt32(data.port);
1208
+ }
1209
+ if (data.protocol != null) {
1210
+ contents.protocol = __expectString(data.protocol);
1211
+ }
1212
+ if (data.serviceArn != null) {
1213
+ contents.serviceArn = __expectString(data.serviceArn);
1214
+ }
1215
+ if (data.serviceId != null) {
1216
+ contents.serviceId = __expectString(data.serviceId);
1217
+ }
1218
+ return contents;
1219
+ };
1220
+ const deserializeAws_restJson1CreateListenerCommandError = async (output, context) => {
1221
+ const parsedOutput = {
1222
+ ...output,
1223
+ body: await parseErrorBody(output.body, context),
1224
+ };
1225
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1226
+ switch (errorCode) {
1227
+ case "AccessDeniedException":
1228
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1229
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1230
+ case "ConflictException":
1231
+ case "com.amazonaws.vpclattice#ConflictException":
1232
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1233
+ case "InternalServerException":
1234
+ case "com.amazonaws.vpclattice#InternalServerException":
1235
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1236
+ case "ResourceNotFoundException":
1237
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1238
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1239
+ case "ServiceQuotaExceededException":
1240
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1241
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1242
+ case "ThrottlingException":
1243
+ case "com.amazonaws.vpclattice#ThrottlingException":
1244
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1245
+ case "ValidationException":
1246
+ case "com.amazonaws.vpclattice#ValidationException":
1247
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1248
+ default:
1249
+ const parsedBody = parsedOutput.body;
1250
+ throwDefaultError({
1251
+ output,
1252
+ parsedBody,
1253
+ exceptionCtor: __BaseException,
1254
+ errorCode,
1255
+ });
1256
+ }
1257
+ };
1258
+ export const deserializeAws_restJson1CreateRuleCommand = async (output, context) => {
1259
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1260
+ return deserializeAws_restJson1CreateRuleCommandError(output, context);
1261
+ }
1262
+ const contents = map({
1263
+ $metadata: deserializeMetadata(output),
1264
+ });
1265
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1266
+ if (data.action != null) {
1267
+ contents.action = deserializeAws_restJson1RuleAction(__expectUnion(data.action), context);
1268
+ }
1269
+ if (data.arn != null) {
1270
+ contents.arn = __expectString(data.arn);
1271
+ }
1272
+ if (data.id != null) {
1273
+ contents.id = __expectString(data.id);
1274
+ }
1275
+ if (data.match != null) {
1276
+ contents.match = deserializeAws_restJson1RuleMatch(__expectUnion(data.match), context);
1277
+ }
1278
+ if (data.name != null) {
1279
+ contents.name = __expectString(data.name);
1280
+ }
1281
+ if (data.priority != null) {
1282
+ contents.priority = __expectInt32(data.priority);
1283
+ }
1284
+ return contents;
1285
+ };
1286
+ const deserializeAws_restJson1CreateRuleCommandError = async (output, context) => {
1287
+ const parsedOutput = {
1288
+ ...output,
1289
+ body: await parseErrorBody(output.body, context),
1290
+ };
1291
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1292
+ switch (errorCode) {
1293
+ case "AccessDeniedException":
1294
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1295
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1296
+ case "ConflictException":
1297
+ case "com.amazonaws.vpclattice#ConflictException":
1298
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1299
+ case "InternalServerException":
1300
+ case "com.amazonaws.vpclattice#InternalServerException":
1301
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1302
+ case "ResourceNotFoundException":
1303
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1304
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1305
+ case "ServiceQuotaExceededException":
1306
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1307
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1308
+ case "ThrottlingException":
1309
+ case "com.amazonaws.vpclattice#ThrottlingException":
1310
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1311
+ case "ValidationException":
1312
+ case "com.amazonaws.vpclattice#ValidationException":
1313
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1314
+ default:
1315
+ const parsedBody = parsedOutput.body;
1316
+ throwDefaultError({
1317
+ output,
1318
+ parsedBody,
1319
+ exceptionCtor: __BaseException,
1320
+ errorCode,
1321
+ });
1322
+ }
1323
+ };
1324
+ export const deserializeAws_restJson1CreateServiceCommand = async (output, context) => {
1325
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1326
+ return deserializeAws_restJson1CreateServiceCommandError(output, context);
1327
+ }
1328
+ const contents = map({
1329
+ $metadata: deserializeMetadata(output),
1330
+ });
1331
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1332
+ if (data.arn != null) {
1333
+ contents.arn = __expectString(data.arn);
1334
+ }
1335
+ if (data.authType != null) {
1336
+ contents.authType = __expectString(data.authType);
1337
+ }
1338
+ if (data.certificateArn != null) {
1339
+ contents.certificateArn = __expectString(data.certificateArn);
1340
+ }
1341
+ if (data.customDomainName != null) {
1342
+ contents.customDomainName = __expectString(data.customDomainName);
1343
+ }
1344
+ if (data.dnsEntry != null) {
1345
+ contents.dnsEntry = deserializeAws_restJson1DnsEntry(data.dnsEntry, context);
1346
+ }
1347
+ if (data.id != null) {
1348
+ contents.id = __expectString(data.id);
1349
+ }
1350
+ if (data.name != null) {
1351
+ contents.name = __expectString(data.name);
1352
+ }
1353
+ if (data.status != null) {
1354
+ contents.status = __expectString(data.status);
1355
+ }
1356
+ return contents;
1357
+ };
1358
+ const deserializeAws_restJson1CreateServiceCommandError = async (output, context) => {
1359
+ const parsedOutput = {
1360
+ ...output,
1361
+ body: await parseErrorBody(output.body, context),
1362
+ };
1363
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1364
+ switch (errorCode) {
1365
+ case "AccessDeniedException":
1366
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1367
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1368
+ case "ConflictException":
1369
+ case "com.amazonaws.vpclattice#ConflictException":
1370
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1371
+ case "InternalServerException":
1372
+ case "com.amazonaws.vpclattice#InternalServerException":
1373
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1374
+ case "ResourceNotFoundException":
1375
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1376
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1377
+ case "ServiceQuotaExceededException":
1378
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1379
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1380
+ case "ThrottlingException":
1381
+ case "com.amazonaws.vpclattice#ThrottlingException":
1382
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1383
+ case "ValidationException":
1384
+ case "com.amazonaws.vpclattice#ValidationException":
1385
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1386
+ default:
1387
+ const parsedBody = parsedOutput.body;
1388
+ throwDefaultError({
1389
+ output,
1390
+ parsedBody,
1391
+ exceptionCtor: __BaseException,
1392
+ errorCode,
1393
+ });
1394
+ }
1395
+ };
1396
+ export const deserializeAws_restJson1CreateServiceNetworkCommand = async (output, context) => {
1397
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1398
+ return deserializeAws_restJson1CreateServiceNetworkCommandError(output, context);
1399
+ }
1400
+ const contents = map({
1401
+ $metadata: deserializeMetadata(output),
1402
+ });
1403
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1404
+ if (data.arn != null) {
1405
+ contents.arn = __expectString(data.arn);
1406
+ }
1407
+ if (data.authType != null) {
1408
+ contents.authType = __expectString(data.authType);
1409
+ }
1410
+ if (data.id != null) {
1411
+ contents.id = __expectString(data.id);
1412
+ }
1413
+ if (data.name != null) {
1414
+ contents.name = __expectString(data.name);
1415
+ }
1416
+ return contents;
1417
+ };
1418
+ const deserializeAws_restJson1CreateServiceNetworkCommandError = async (output, context) => {
1419
+ const parsedOutput = {
1420
+ ...output,
1421
+ body: await parseErrorBody(output.body, context),
1422
+ };
1423
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1424
+ switch (errorCode) {
1425
+ case "AccessDeniedException":
1426
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1427
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1428
+ case "ConflictException":
1429
+ case "com.amazonaws.vpclattice#ConflictException":
1430
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1431
+ case "InternalServerException":
1432
+ case "com.amazonaws.vpclattice#InternalServerException":
1433
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1434
+ case "ResourceNotFoundException":
1435
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1436
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1437
+ case "ServiceQuotaExceededException":
1438
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1439
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1440
+ case "ThrottlingException":
1441
+ case "com.amazonaws.vpclattice#ThrottlingException":
1442
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1443
+ case "ValidationException":
1444
+ case "com.amazonaws.vpclattice#ValidationException":
1445
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1446
+ default:
1447
+ const parsedBody = parsedOutput.body;
1448
+ throwDefaultError({
1449
+ output,
1450
+ parsedBody,
1451
+ exceptionCtor: __BaseException,
1452
+ errorCode,
1453
+ });
1454
+ }
1455
+ };
1456
+ export const deserializeAws_restJson1CreateServiceNetworkServiceAssociationCommand = async (output, context) => {
1457
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1458
+ return deserializeAws_restJson1CreateServiceNetworkServiceAssociationCommandError(output, context);
1459
+ }
1460
+ const contents = map({
1461
+ $metadata: deserializeMetadata(output),
1462
+ });
1463
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1464
+ if (data.arn != null) {
1465
+ contents.arn = __expectString(data.arn);
1466
+ }
1467
+ if (data.createdBy != null) {
1468
+ contents.createdBy = __expectString(data.createdBy);
1469
+ }
1470
+ if (data.customDomainName != null) {
1471
+ contents.customDomainName = __expectString(data.customDomainName);
1472
+ }
1473
+ if (data.dnsEntry != null) {
1474
+ contents.dnsEntry = deserializeAws_restJson1DnsEntry(data.dnsEntry, context);
1475
+ }
1476
+ if (data.id != null) {
1477
+ contents.id = __expectString(data.id);
1478
+ }
1479
+ if (data.status != null) {
1480
+ contents.status = __expectString(data.status);
1481
+ }
1482
+ return contents;
1483
+ };
1484
+ const deserializeAws_restJson1CreateServiceNetworkServiceAssociationCommandError = async (output, context) => {
1485
+ const parsedOutput = {
1486
+ ...output,
1487
+ body: await parseErrorBody(output.body, context),
1488
+ };
1489
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1490
+ switch (errorCode) {
1491
+ case "ConflictException":
1492
+ case "com.amazonaws.vpclattice#ConflictException":
1493
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1494
+ case "InternalServerException":
1495
+ case "com.amazonaws.vpclattice#InternalServerException":
1496
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1497
+ case "ResourceNotFoundException":
1498
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1499
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1500
+ case "ServiceQuotaExceededException":
1501
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1502
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1503
+ case "ThrottlingException":
1504
+ case "com.amazonaws.vpclattice#ThrottlingException":
1505
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1506
+ case "ValidationException":
1507
+ case "com.amazonaws.vpclattice#ValidationException":
1508
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1509
+ default:
1510
+ const parsedBody = parsedOutput.body;
1511
+ throwDefaultError({
1512
+ output,
1513
+ parsedBody,
1514
+ exceptionCtor: __BaseException,
1515
+ errorCode,
1516
+ });
1517
+ }
1518
+ };
1519
+ export const deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommand = async (output, context) => {
1520
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1521
+ return deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommandError(output, context);
1522
+ }
1523
+ const contents = map({
1524
+ $metadata: deserializeMetadata(output),
1525
+ });
1526
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1527
+ if (data.arn != null) {
1528
+ contents.arn = __expectString(data.arn);
1529
+ }
1530
+ if (data.createdBy != null) {
1531
+ contents.createdBy = __expectString(data.createdBy);
1532
+ }
1533
+ if (data.id != null) {
1534
+ contents.id = __expectString(data.id);
1535
+ }
1536
+ if (data.securityGroupIds != null) {
1537
+ contents.securityGroupIds = deserializeAws_restJson1SecurityGroupList(data.securityGroupIds, context);
1538
+ }
1539
+ if (data.status != null) {
1540
+ contents.status = __expectString(data.status);
1541
+ }
1542
+ return contents;
1543
+ };
1544
+ const deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommandError = async (output, context) => {
1545
+ const parsedOutput = {
1546
+ ...output,
1547
+ body: await parseErrorBody(output.body, context),
1548
+ };
1549
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1550
+ switch (errorCode) {
1551
+ case "AccessDeniedException":
1552
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1553
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1554
+ case "ConflictException":
1555
+ case "com.amazonaws.vpclattice#ConflictException":
1556
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1557
+ case "InternalServerException":
1558
+ case "com.amazonaws.vpclattice#InternalServerException":
1559
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1560
+ case "ResourceNotFoundException":
1561
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1562
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1563
+ case "ServiceQuotaExceededException":
1564
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1565
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1566
+ case "ThrottlingException":
1567
+ case "com.amazonaws.vpclattice#ThrottlingException":
1568
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1569
+ case "ValidationException":
1570
+ case "com.amazonaws.vpclattice#ValidationException":
1571
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1572
+ default:
1573
+ const parsedBody = parsedOutput.body;
1574
+ throwDefaultError({
1575
+ output,
1576
+ parsedBody,
1577
+ exceptionCtor: __BaseException,
1578
+ errorCode,
1579
+ });
1580
+ }
1581
+ };
1582
+ export const deserializeAws_restJson1CreateTargetGroupCommand = async (output, context) => {
1583
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1584
+ return deserializeAws_restJson1CreateTargetGroupCommandError(output, context);
1585
+ }
1586
+ const contents = map({
1587
+ $metadata: deserializeMetadata(output),
1588
+ });
1589
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1590
+ if (data.arn != null) {
1591
+ contents.arn = __expectString(data.arn);
1592
+ }
1593
+ if (data.config != null) {
1594
+ contents.config = deserializeAws_restJson1TargetGroupConfig(data.config, context);
1595
+ }
1596
+ if (data.id != null) {
1597
+ contents.id = __expectString(data.id);
1598
+ }
1599
+ if (data.name != null) {
1600
+ contents.name = __expectString(data.name);
1601
+ }
1602
+ if (data.status != null) {
1603
+ contents.status = __expectString(data.status);
1604
+ }
1605
+ if (data.type != null) {
1606
+ contents.type = __expectString(data.type);
1607
+ }
1608
+ return contents;
1609
+ };
1610
+ const deserializeAws_restJson1CreateTargetGroupCommandError = async (output, context) => {
1611
+ const parsedOutput = {
1612
+ ...output,
1613
+ body: await parseErrorBody(output.body, context),
1614
+ };
1615
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1616
+ switch (errorCode) {
1617
+ case "AccessDeniedException":
1618
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1619
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1620
+ case "ConflictException":
1621
+ case "com.amazonaws.vpclattice#ConflictException":
1622
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1623
+ case "InternalServerException":
1624
+ case "com.amazonaws.vpclattice#InternalServerException":
1625
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1626
+ case "ResourceNotFoundException":
1627
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1628
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1629
+ case "ServiceQuotaExceededException":
1630
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
1631
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1632
+ case "ThrottlingException":
1633
+ case "com.amazonaws.vpclattice#ThrottlingException":
1634
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1635
+ case "ValidationException":
1636
+ case "com.amazonaws.vpclattice#ValidationException":
1637
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1638
+ default:
1639
+ const parsedBody = parsedOutput.body;
1640
+ throwDefaultError({
1641
+ output,
1642
+ parsedBody,
1643
+ exceptionCtor: __BaseException,
1644
+ errorCode,
1645
+ });
1646
+ }
1647
+ };
1648
+ export const deserializeAws_restJson1DeleteAccessLogSubscriptionCommand = async (output, context) => {
1649
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1650
+ return deserializeAws_restJson1DeleteAccessLogSubscriptionCommandError(output, context);
1651
+ }
1652
+ const contents = map({
1653
+ $metadata: deserializeMetadata(output),
1654
+ });
1655
+ await collectBody(output.body, context);
1656
+ return contents;
1657
+ };
1658
+ const deserializeAws_restJson1DeleteAccessLogSubscriptionCommandError = async (output, context) => {
1659
+ const parsedOutput = {
1660
+ ...output,
1661
+ body: await parseErrorBody(output.body, context),
1662
+ };
1663
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1664
+ switch (errorCode) {
1665
+ case "AccessDeniedException":
1666
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1667
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1668
+ case "InternalServerException":
1669
+ case "com.amazonaws.vpclattice#InternalServerException":
1670
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1671
+ case "ResourceNotFoundException":
1672
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1673
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1674
+ case "ThrottlingException":
1675
+ case "com.amazonaws.vpclattice#ThrottlingException":
1676
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1677
+ case "ValidationException":
1678
+ case "com.amazonaws.vpclattice#ValidationException":
1679
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1680
+ default:
1681
+ const parsedBody = parsedOutput.body;
1682
+ throwDefaultError({
1683
+ output,
1684
+ parsedBody,
1685
+ exceptionCtor: __BaseException,
1686
+ errorCode,
1687
+ });
1688
+ }
1689
+ };
1690
+ export const deserializeAws_restJson1DeleteAuthPolicyCommand = async (output, context) => {
1691
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1692
+ return deserializeAws_restJson1DeleteAuthPolicyCommandError(output, context);
1693
+ }
1694
+ const contents = map({
1695
+ $metadata: deserializeMetadata(output),
1696
+ });
1697
+ await collectBody(output.body, context);
1698
+ return contents;
1699
+ };
1700
+ const deserializeAws_restJson1DeleteAuthPolicyCommandError = async (output, context) => {
1701
+ const parsedOutput = {
1702
+ ...output,
1703
+ body: await parseErrorBody(output.body, context),
1704
+ };
1705
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1706
+ switch (errorCode) {
1707
+ case "AccessDeniedException":
1708
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1709
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1710
+ case "InternalServerException":
1711
+ case "com.amazonaws.vpclattice#InternalServerException":
1712
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1713
+ case "ResourceNotFoundException":
1714
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1715
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1716
+ case "ThrottlingException":
1717
+ case "com.amazonaws.vpclattice#ThrottlingException":
1718
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1719
+ case "ValidationException":
1720
+ case "com.amazonaws.vpclattice#ValidationException":
1721
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1722
+ default:
1723
+ const parsedBody = parsedOutput.body;
1724
+ throwDefaultError({
1725
+ output,
1726
+ parsedBody,
1727
+ exceptionCtor: __BaseException,
1728
+ errorCode,
1729
+ });
1730
+ }
1731
+ };
1732
+ export const deserializeAws_restJson1DeleteListenerCommand = async (output, context) => {
1733
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1734
+ return deserializeAws_restJson1DeleteListenerCommandError(output, context);
1735
+ }
1736
+ const contents = map({
1737
+ $metadata: deserializeMetadata(output),
1738
+ });
1739
+ await collectBody(output.body, context);
1740
+ return contents;
1741
+ };
1742
+ const deserializeAws_restJson1DeleteListenerCommandError = async (output, context) => {
1743
+ const parsedOutput = {
1744
+ ...output,
1745
+ body: await parseErrorBody(output.body, context),
1746
+ };
1747
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1748
+ switch (errorCode) {
1749
+ case "AccessDeniedException":
1750
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1751
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1752
+ case "ConflictException":
1753
+ case "com.amazonaws.vpclattice#ConflictException":
1754
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1755
+ case "InternalServerException":
1756
+ case "com.amazonaws.vpclattice#InternalServerException":
1757
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1758
+ case "ResourceNotFoundException":
1759
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1760
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1761
+ case "ThrottlingException":
1762
+ case "com.amazonaws.vpclattice#ThrottlingException":
1763
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1764
+ case "ValidationException":
1765
+ case "com.amazonaws.vpclattice#ValidationException":
1766
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1767
+ default:
1768
+ const parsedBody = parsedOutput.body;
1769
+ throwDefaultError({
1770
+ output,
1771
+ parsedBody,
1772
+ exceptionCtor: __BaseException,
1773
+ errorCode,
1774
+ });
1775
+ }
1776
+ };
1777
+ export const deserializeAws_restJson1DeleteResourcePolicyCommand = async (output, context) => {
1778
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1779
+ return deserializeAws_restJson1DeleteResourcePolicyCommandError(output, context);
1780
+ }
1781
+ const contents = map({
1782
+ $metadata: deserializeMetadata(output),
1783
+ });
1784
+ await collectBody(output.body, context);
1785
+ return contents;
1786
+ };
1787
+ const deserializeAws_restJson1DeleteResourcePolicyCommandError = async (output, context) => {
1788
+ const parsedOutput = {
1789
+ ...output,
1790
+ body: await parseErrorBody(output.body, context),
1791
+ };
1792
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1793
+ switch (errorCode) {
1794
+ case "AccessDeniedException":
1795
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1796
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1797
+ case "InternalServerException":
1798
+ case "com.amazonaws.vpclattice#InternalServerException":
1799
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1800
+ case "ResourceNotFoundException":
1801
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1802
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1803
+ case "ThrottlingException":
1804
+ case "com.amazonaws.vpclattice#ThrottlingException":
1805
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1806
+ case "ValidationException":
1807
+ case "com.amazonaws.vpclattice#ValidationException":
1808
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1809
+ default:
1810
+ const parsedBody = parsedOutput.body;
1811
+ throwDefaultError({
1812
+ output,
1813
+ parsedBody,
1814
+ exceptionCtor: __BaseException,
1815
+ errorCode,
1816
+ });
1817
+ }
1818
+ };
1819
+ export const deserializeAws_restJson1DeleteRuleCommand = async (output, context) => {
1820
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1821
+ return deserializeAws_restJson1DeleteRuleCommandError(output, context);
1822
+ }
1823
+ const contents = map({
1824
+ $metadata: deserializeMetadata(output),
1825
+ });
1826
+ await collectBody(output.body, context);
1827
+ return contents;
1828
+ };
1829
+ const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) => {
1830
+ const parsedOutput = {
1831
+ ...output,
1832
+ body: await parseErrorBody(output.body, context),
1833
+ };
1834
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1835
+ switch (errorCode) {
1836
+ case "AccessDeniedException":
1837
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1838
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1839
+ case "ConflictException":
1840
+ case "com.amazonaws.vpclattice#ConflictException":
1841
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1842
+ case "InternalServerException":
1843
+ case "com.amazonaws.vpclattice#InternalServerException":
1844
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1845
+ case "ResourceNotFoundException":
1846
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1847
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1848
+ case "ThrottlingException":
1849
+ case "com.amazonaws.vpclattice#ThrottlingException":
1850
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1851
+ case "ValidationException":
1852
+ case "com.amazonaws.vpclattice#ValidationException":
1853
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1854
+ default:
1855
+ const parsedBody = parsedOutput.body;
1856
+ throwDefaultError({
1857
+ output,
1858
+ parsedBody,
1859
+ exceptionCtor: __BaseException,
1860
+ errorCode,
1861
+ });
1862
+ }
1863
+ };
1864
+ export const deserializeAws_restJson1DeleteServiceCommand = async (output, context) => {
1865
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1866
+ return deserializeAws_restJson1DeleteServiceCommandError(output, context);
1867
+ }
1868
+ const contents = map({
1869
+ $metadata: deserializeMetadata(output),
1870
+ });
1871
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1872
+ if (data.arn != null) {
1873
+ contents.arn = __expectString(data.arn);
1874
+ }
1875
+ if (data.id != null) {
1876
+ contents.id = __expectString(data.id);
1877
+ }
1878
+ if (data.name != null) {
1879
+ contents.name = __expectString(data.name);
1880
+ }
1881
+ if (data.status != null) {
1882
+ contents.status = __expectString(data.status);
1883
+ }
1884
+ return contents;
1885
+ };
1886
+ const deserializeAws_restJson1DeleteServiceCommandError = async (output, context) => {
1887
+ const parsedOutput = {
1888
+ ...output,
1889
+ body: await parseErrorBody(output.body, context),
1890
+ };
1891
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1892
+ switch (errorCode) {
1893
+ case "AccessDeniedException":
1894
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1895
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1896
+ case "ConflictException":
1897
+ case "com.amazonaws.vpclattice#ConflictException":
1898
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1899
+ case "InternalServerException":
1900
+ case "com.amazonaws.vpclattice#InternalServerException":
1901
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1902
+ case "ResourceNotFoundException":
1903
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1904
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1905
+ case "ThrottlingException":
1906
+ case "com.amazonaws.vpclattice#ThrottlingException":
1907
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1908
+ case "ValidationException":
1909
+ case "com.amazonaws.vpclattice#ValidationException":
1910
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1911
+ default:
1912
+ const parsedBody = parsedOutput.body;
1913
+ throwDefaultError({
1914
+ output,
1915
+ parsedBody,
1916
+ exceptionCtor: __BaseException,
1917
+ errorCode,
1918
+ });
1919
+ }
1920
+ };
1921
+ export const deserializeAws_restJson1DeleteServiceNetworkCommand = async (output, context) => {
1922
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1923
+ return deserializeAws_restJson1DeleteServiceNetworkCommandError(output, context);
1924
+ }
1925
+ const contents = map({
1926
+ $metadata: deserializeMetadata(output),
1927
+ });
1928
+ await collectBody(output.body, context);
1929
+ return contents;
1930
+ };
1931
+ const deserializeAws_restJson1DeleteServiceNetworkCommandError = async (output, context) => {
1932
+ const parsedOutput = {
1933
+ ...output,
1934
+ body: await parseErrorBody(output.body, context),
1935
+ };
1936
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1937
+ switch (errorCode) {
1938
+ case "AccessDeniedException":
1939
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1940
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1941
+ case "ConflictException":
1942
+ case "com.amazonaws.vpclattice#ConflictException":
1943
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1944
+ case "InternalServerException":
1945
+ case "com.amazonaws.vpclattice#InternalServerException":
1946
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1947
+ case "ResourceNotFoundException":
1948
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
1949
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1950
+ case "ThrottlingException":
1951
+ case "com.amazonaws.vpclattice#ThrottlingException":
1952
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1953
+ case "ValidationException":
1954
+ case "com.amazonaws.vpclattice#ValidationException":
1955
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1956
+ default:
1957
+ const parsedBody = parsedOutput.body;
1958
+ throwDefaultError({
1959
+ output,
1960
+ parsedBody,
1961
+ exceptionCtor: __BaseException,
1962
+ errorCode,
1963
+ });
1964
+ }
1965
+ };
1966
+ export const deserializeAws_restJson1DeleteServiceNetworkServiceAssociationCommand = async (output, context) => {
1967
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1968
+ return deserializeAws_restJson1DeleteServiceNetworkServiceAssociationCommandError(output, context);
1969
+ }
1970
+ const contents = map({
1971
+ $metadata: deserializeMetadata(output),
1972
+ });
1973
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1974
+ if (data.arn != null) {
1975
+ contents.arn = __expectString(data.arn);
1976
+ }
1977
+ if (data.id != null) {
1978
+ contents.id = __expectString(data.id);
1979
+ }
1980
+ if (data.status != null) {
1981
+ contents.status = __expectString(data.status);
1982
+ }
1983
+ return contents;
1984
+ };
1985
+ const deserializeAws_restJson1DeleteServiceNetworkServiceAssociationCommandError = async (output, context) => {
1986
+ const parsedOutput = {
1987
+ ...output,
1988
+ body: await parseErrorBody(output.body, context),
1989
+ };
1990
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1991
+ switch (errorCode) {
1992
+ case "AccessDeniedException":
1993
+ case "com.amazonaws.vpclattice#AccessDeniedException":
1994
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1995
+ case "ConflictException":
1996
+ case "com.amazonaws.vpclattice#ConflictException":
1997
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1998
+ case "InternalServerException":
1999
+ case "com.amazonaws.vpclattice#InternalServerException":
2000
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2001
+ case "ResourceNotFoundException":
2002
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2003
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2004
+ case "ThrottlingException":
2005
+ case "com.amazonaws.vpclattice#ThrottlingException":
2006
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2007
+ case "ValidationException":
2008
+ case "com.amazonaws.vpclattice#ValidationException":
2009
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2010
+ default:
2011
+ const parsedBody = parsedOutput.body;
2012
+ throwDefaultError({
2013
+ output,
2014
+ parsedBody,
2015
+ exceptionCtor: __BaseException,
2016
+ errorCode,
2017
+ });
2018
+ }
2019
+ };
2020
+ export const deserializeAws_restJson1DeleteServiceNetworkVpcAssociationCommand = async (output, context) => {
2021
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2022
+ return deserializeAws_restJson1DeleteServiceNetworkVpcAssociationCommandError(output, context);
2023
+ }
2024
+ const contents = map({
2025
+ $metadata: deserializeMetadata(output),
2026
+ });
2027
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2028
+ if (data.arn != null) {
2029
+ contents.arn = __expectString(data.arn);
2030
+ }
2031
+ if (data.id != null) {
2032
+ contents.id = __expectString(data.id);
2033
+ }
2034
+ if (data.status != null) {
2035
+ contents.status = __expectString(data.status);
2036
+ }
2037
+ return contents;
2038
+ };
2039
+ const deserializeAws_restJson1DeleteServiceNetworkVpcAssociationCommandError = async (output, context) => {
2040
+ const parsedOutput = {
2041
+ ...output,
2042
+ body: await parseErrorBody(output.body, context),
2043
+ };
2044
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2045
+ switch (errorCode) {
2046
+ case "AccessDeniedException":
2047
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2048
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2049
+ case "ConflictException":
2050
+ case "com.amazonaws.vpclattice#ConflictException":
2051
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2052
+ case "InternalServerException":
2053
+ case "com.amazonaws.vpclattice#InternalServerException":
2054
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2055
+ case "ResourceNotFoundException":
2056
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2057
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2058
+ case "ThrottlingException":
2059
+ case "com.amazonaws.vpclattice#ThrottlingException":
2060
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2061
+ case "ValidationException":
2062
+ case "com.amazonaws.vpclattice#ValidationException":
2063
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2064
+ default:
2065
+ const parsedBody = parsedOutput.body;
2066
+ throwDefaultError({
2067
+ output,
2068
+ parsedBody,
2069
+ exceptionCtor: __BaseException,
2070
+ errorCode,
2071
+ });
2072
+ }
2073
+ };
2074
+ export const deserializeAws_restJson1DeleteTargetGroupCommand = async (output, context) => {
2075
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2076
+ return deserializeAws_restJson1DeleteTargetGroupCommandError(output, context);
2077
+ }
2078
+ const contents = map({
2079
+ $metadata: deserializeMetadata(output),
2080
+ });
2081
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2082
+ if (data.arn != null) {
2083
+ contents.arn = __expectString(data.arn);
2084
+ }
2085
+ if (data.id != null) {
2086
+ contents.id = __expectString(data.id);
2087
+ }
2088
+ if (data.status != null) {
2089
+ contents.status = __expectString(data.status);
2090
+ }
2091
+ return contents;
2092
+ };
2093
+ const deserializeAws_restJson1DeleteTargetGroupCommandError = async (output, context) => {
2094
+ const parsedOutput = {
2095
+ ...output,
2096
+ body: await parseErrorBody(output.body, context),
2097
+ };
2098
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2099
+ switch (errorCode) {
2100
+ case "ConflictException":
2101
+ case "com.amazonaws.vpclattice#ConflictException":
2102
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2103
+ case "InternalServerException":
2104
+ case "com.amazonaws.vpclattice#InternalServerException":
2105
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2106
+ case "ResourceNotFoundException":
2107
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2108
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2109
+ case "ThrottlingException":
2110
+ case "com.amazonaws.vpclattice#ThrottlingException":
2111
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2112
+ case "ValidationException":
2113
+ case "com.amazonaws.vpclattice#ValidationException":
2114
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2115
+ default:
2116
+ const parsedBody = parsedOutput.body;
2117
+ throwDefaultError({
2118
+ output,
2119
+ parsedBody,
2120
+ exceptionCtor: __BaseException,
2121
+ errorCode,
2122
+ });
2123
+ }
2124
+ };
2125
+ export const deserializeAws_restJson1DeregisterTargetsCommand = async (output, context) => {
2126
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2127
+ return deserializeAws_restJson1DeregisterTargetsCommandError(output, context);
2128
+ }
2129
+ const contents = map({
2130
+ $metadata: deserializeMetadata(output),
2131
+ });
2132
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2133
+ if (data.successful != null) {
2134
+ contents.successful = deserializeAws_restJson1TargetList(data.successful, context);
2135
+ }
2136
+ if (data.unsuccessful != null) {
2137
+ contents.unsuccessful = deserializeAws_restJson1TargetFailureList(data.unsuccessful, context);
2138
+ }
2139
+ return contents;
2140
+ };
2141
+ const deserializeAws_restJson1DeregisterTargetsCommandError = async (output, context) => {
2142
+ const parsedOutput = {
2143
+ ...output,
2144
+ body: await parseErrorBody(output.body, context),
2145
+ };
2146
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2147
+ switch (errorCode) {
2148
+ case "AccessDeniedException":
2149
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2150
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2151
+ case "ConflictException":
2152
+ case "com.amazonaws.vpclattice#ConflictException":
2153
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
2154
+ case "InternalServerException":
2155
+ case "com.amazonaws.vpclattice#InternalServerException":
2156
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2157
+ case "ResourceNotFoundException":
2158
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2159
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2160
+ case "ThrottlingException":
2161
+ case "com.amazonaws.vpclattice#ThrottlingException":
2162
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2163
+ case "ValidationException":
2164
+ case "com.amazonaws.vpclattice#ValidationException":
2165
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2166
+ default:
2167
+ const parsedBody = parsedOutput.body;
2168
+ throwDefaultError({
2169
+ output,
2170
+ parsedBody,
2171
+ exceptionCtor: __BaseException,
2172
+ errorCode,
2173
+ });
2174
+ }
2175
+ };
2176
+ export const deserializeAws_restJson1GetAccessLogSubscriptionCommand = async (output, context) => {
2177
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2178
+ return deserializeAws_restJson1GetAccessLogSubscriptionCommandError(output, context);
2179
+ }
2180
+ const contents = map({
2181
+ $metadata: deserializeMetadata(output),
2182
+ });
2183
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2184
+ if (data.arn != null) {
2185
+ contents.arn = __expectString(data.arn);
2186
+ }
2187
+ if (data.createdAt != null) {
2188
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2189
+ }
2190
+ if (data.destinationArn != null) {
2191
+ contents.destinationArn = __expectString(data.destinationArn);
2192
+ }
2193
+ if (data.id != null) {
2194
+ contents.id = __expectString(data.id);
2195
+ }
2196
+ if (data.lastUpdatedAt != null) {
2197
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2198
+ }
2199
+ if (data.resourceArn != null) {
2200
+ contents.resourceArn = __expectString(data.resourceArn);
2201
+ }
2202
+ if (data.resourceId != null) {
2203
+ contents.resourceId = __expectString(data.resourceId);
2204
+ }
2205
+ return contents;
2206
+ };
2207
+ const deserializeAws_restJson1GetAccessLogSubscriptionCommandError = async (output, context) => {
2208
+ const parsedOutput = {
2209
+ ...output,
2210
+ body: await parseErrorBody(output.body, context),
2211
+ };
2212
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2213
+ switch (errorCode) {
2214
+ case "AccessDeniedException":
2215
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2216
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2217
+ case "InternalServerException":
2218
+ case "com.amazonaws.vpclattice#InternalServerException":
2219
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2220
+ case "ResourceNotFoundException":
2221
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2222
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2223
+ case "ThrottlingException":
2224
+ case "com.amazonaws.vpclattice#ThrottlingException":
2225
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2226
+ case "ValidationException":
2227
+ case "com.amazonaws.vpclattice#ValidationException":
2228
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2229
+ default:
2230
+ const parsedBody = parsedOutput.body;
2231
+ throwDefaultError({
2232
+ output,
2233
+ parsedBody,
2234
+ exceptionCtor: __BaseException,
2235
+ errorCode,
2236
+ });
2237
+ }
2238
+ };
2239
+ export const deserializeAws_restJson1GetAuthPolicyCommand = async (output, context) => {
2240
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2241
+ return deserializeAws_restJson1GetAuthPolicyCommandError(output, context);
2242
+ }
2243
+ const contents = map({
2244
+ $metadata: deserializeMetadata(output),
2245
+ });
2246
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2247
+ if (data.createdAt != null) {
2248
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2249
+ }
2250
+ if (data.lastUpdatedAt != null) {
2251
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2252
+ }
2253
+ if (data.policy != null) {
2254
+ contents.policy = __expectString(data.policy);
2255
+ }
2256
+ if (data.state != null) {
2257
+ contents.state = __expectString(data.state);
2258
+ }
2259
+ return contents;
2260
+ };
2261
+ const deserializeAws_restJson1GetAuthPolicyCommandError = async (output, context) => {
2262
+ const parsedOutput = {
2263
+ ...output,
2264
+ body: await parseErrorBody(output.body, context),
2265
+ };
2266
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2267
+ switch (errorCode) {
2268
+ case "AccessDeniedException":
2269
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2270
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2271
+ case "InternalServerException":
2272
+ case "com.amazonaws.vpclattice#InternalServerException":
2273
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2274
+ case "ResourceNotFoundException":
2275
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2276
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2277
+ case "ThrottlingException":
2278
+ case "com.amazonaws.vpclattice#ThrottlingException":
2279
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2280
+ case "ValidationException":
2281
+ case "com.amazonaws.vpclattice#ValidationException":
2282
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2283
+ default:
2284
+ const parsedBody = parsedOutput.body;
2285
+ throwDefaultError({
2286
+ output,
2287
+ parsedBody,
2288
+ exceptionCtor: __BaseException,
2289
+ errorCode,
2290
+ });
2291
+ }
2292
+ };
2293
+ export const deserializeAws_restJson1GetListenerCommand = async (output, context) => {
2294
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2295
+ return deserializeAws_restJson1GetListenerCommandError(output, context);
2296
+ }
2297
+ const contents = map({
2298
+ $metadata: deserializeMetadata(output),
2299
+ });
2300
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2301
+ if (data.arn != null) {
2302
+ contents.arn = __expectString(data.arn);
2303
+ }
2304
+ if (data.createdAt != null) {
2305
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2306
+ }
2307
+ if (data.defaultAction != null) {
2308
+ contents.defaultAction = deserializeAws_restJson1RuleAction(__expectUnion(data.defaultAction), context);
2309
+ }
2310
+ if (data.id != null) {
2311
+ contents.id = __expectString(data.id);
2312
+ }
2313
+ if (data.lastUpdatedAt != null) {
2314
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2315
+ }
2316
+ if (data.name != null) {
2317
+ contents.name = __expectString(data.name);
2318
+ }
2319
+ if (data.port != null) {
2320
+ contents.port = __expectInt32(data.port);
2321
+ }
2322
+ if (data.protocol != null) {
2323
+ contents.protocol = __expectString(data.protocol);
2324
+ }
2325
+ if (data.serviceArn != null) {
2326
+ contents.serviceArn = __expectString(data.serviceArn);
2327
+ }
2328
+ if (data.serviceId != null) {
2329
+ contents.serviceId = __expectString(data.serviceId);
2330
+ }
2331
+ return contents;
2332
+ };
2333
+ const deserializeAws_restJson1GetListenerCommandError = async (output, context) => {
2334
+ const parsedOutput = {
2335
+ ...output,
2336
+ body: await parseErrorBody(output.body, context),
2337
+ };
2338
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2339
+ switch (errorCode) {
2340
+ case "AccessDeniedException":
2341
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2342
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2343
+ case "InternalServerException":
2344
+ case "com.amazonaws.vpclattice#InternalServerException":
2345
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2346
+ case "ResourceNotFoundException":
2347
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2348
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2349
+ case "ThrottlingException":
2350
+ case "com.amazonaws.vpclattice#ThrottlingException":
2351
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2352
+ case "ValidationException":
2353
+ case "com.amazonaws.vpclattice#ValidationException":
2354
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2355
+ default:
2356
+ const parsedBody = parsedOutput.body;
2357
+ throwDefaultError({
2358
+ output,
2359
+ parsedBody,
2360
+ exceptionCtor: __BaseException,
2361
+ errorCode,
2362
+ });
2363
+ }
2364
+ };
2365
+ export const deserializeAws_restJson1GetResourcePolicyCommand = async (output, context) => {
2366
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2367
+ return deserializeAws_restJson1GetResourcePolicyCommandError(output, context);
2368
+ }
2369
+ const contents = map({
2370
+ $metadata: deserializeMetadata(output),
2371
+ });
2372
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2373
+ if (data.policy != null) {
2374
+ contents.policy = __expectString(data.policy);
2375
+ }
2376
+ return contents;
2377
+ };
2378
+ const deserializeAws_restJson1GetResourcePolicyCommandError = async (output, context) => {
2379
+ const parsedOutput = {
2380
+ ...output,
2381
+ body: await parseErrorBody(output.body, context),
2382
+ };
2383
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2384
+ switch (errorCode) {
2385
+ case "AccessDeniedException":
2386
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2387
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2388
+ case "InternalServerException":
2389
+ case "com.amazonaws.vpclattice#InternalServerException":
2390
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2391
+ case "ResourceNotFoundException":
2392
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2393
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2394
+ case "ThrottlingException":
2395
+ case "com.amazonaws.vpclattice#ThrottlingException":
2396
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2397
+ case "ValidationException":
2398
+ case "com.amazonaws.vpclattice#ValidationException":
2399
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2400
+ default:
2401
+ const parsedBody = parsedOutput.body;
2402
+ throwDefaultError({
2403
+ output,
2404
+ parsedBody,
2405
+ exceptionCtor: __BaseException,
2406
+ errorCode,
2407
+ });
2408
+ }
2409
+ };
2410
+ export const deserializeAws_restJson1GetRuleCommand = async (output, context) => {
2411
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2412
+ return deserializeAws_restJson1GetRuleCommandError(output, context);
2413
+ }
2414
+ const contents = map({
2415
+ $metadata: deserializeMetadata(output),
2416
+ });
2417
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2418
+ if (data.action != null) {
2419
+ contents.action = deserializeAws_restJson1RuleAction(__expectUnion(data.action), context);
2420
+ }
2421
+ if (data.arn != null) {
2422
+ contents.arn = __expectString(data.arn);
2423
+ }
2424
+ if (data.createdAt != null) {
2425
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2426
+ }
2427
+ if (data.id != null) {
2428
+ contents.id = __expectString(data.id);
2429
+ }
2430
+ if (data.isDefault != null) {
2431
+ contents.isDefault = __expectBoolean(data.isDefault);
2432
+ }
2433
+ if (data.lastUpdatedAt != null) {
2434
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2435
+ }
2436
+ if (data.match != null) {
2437
+ contents.match = deserializeAws_restJson1RuleMatch(__expectUnion(data.match), context);
2438
+ }
2439
+ if (data.name != null) {
2440
+ contents.name = __expectString(data.name);
2441
+ }
2442
+ if (data.priority != null) {
2443
+ contents.priority = __expectInt32(data.priority);
2444
+ }
2445
+ return contents;
2446
+ };
2447
+ const deserializeAws_restJson1GetRuleCommandError = async (output, context) => {
2448
+ const parsedOutput = {
2449
+ ...output,
2450
+ body: await parseErrorBody(output.body, context),
2451
+ };
2452
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2453
+ switch (errorCode) {
2454
+ case "AccessDeniedException":
2455
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2456
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2457
+ case "InternalServerException":
2458
+ case "com.amazonaws.vpclattice#InternalServerException":
2459
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2460
+ case "ResourceNotFoundException":
2461
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2462
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2463
+ case "ThrottlingException":
2464
+ case "com.amazonaws.vpclattice#ThrottlingException":
2465
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2466
+ case "ValidationException":
2467
+ case "com.amazonaws.vpclattice#ValidationException":
2468
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2469
+ default:
2470
+ const parsedBody = parsedOutput.body;
2471
+ throwDefaultError({
2472
+ output,
2473
+ parsedBody,
2474
+ exceptionCtor: __BaseException,
2475
+ errorCode,
2476
+ });
2477
+ }
2478
+ };
2479
+ export const deserializeAws_restJson1GetServiceCommand = async (output, context) => {
2480
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2481
+ return deserializeAws_restJson1GetServiceCommandError(output, context);
2482
+ }
2483
+ const contents = map({
2484
+ $metadata: deserializeMetadata(output),
2485
+ });
2486
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2487
+ if (data.arn != null) {
2488
+ contents.arn = __expectString(data.arn);
2489
+ }
2490
+ if (data.authType != null) {
2491
+ contents.authType = __expectString(data.authType);
2492
+ }
2493
+ if (data.certificateArn != null) {
2494
+ contents.certificateArn = __expectString(data.certificateArn);
2495
+ }
2496
+ if (data.createdAt != null) {
2497
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2498
+ }
2499
+ if (data.customDomainName != null) {
2500
+ contents.customDomainName = __expectString(data.customDomainName);
2501
+ }
2502
+ if (data.dnsEntry != null) {
2503
+ contents.dnsEntry = deserializeAws_restJson1DnsEntry(data.dnsEntry, context);
2504
+ }
2505
+ if (data.failureCode != null) {
2506
+ contents.failureCode = __expectString(data.failureCode);
2507
+ }
2508
+ if (data.failureMessage != null) {
2509
+ contents.failureMessage = __expectString(data.failureMessage);
2510
+ }
2511
+ if (data.id != null) {
2512
+ contents.id = __expectString(data.id);
2513
+ }
2514
+ if (data.lastUpdatedAt != null) {
2515
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2516
+ }
2517
+ if (data.name != null) {
2518
+ contents.name = __expectString(data.name);
2519
+ }
2520
+ if (data.status != null) {
2521
+ contents.status = __expectString(data.status);
2522
+ }
2523
+ return contents;
2524
+ };
2525
+ const deserializeAws_restJson1GetServiceCommandError = async (output, context) => {
2526
+ const parsedOutput = {
2527
+ ...output,
2528
+ body: await parseErrorBody(output.body, context),
2529
+ };
2530
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2531
+ switch (errorCode) {
2532
+ case "AccessDeniedException":
2533
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2534
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2535
+ case "InternalServerException":
2536
+ case "com.amazonaws.vpclattice#InternalServerException":
2537
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2538
+ case "ResourceNotFoundException":
2539
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2540
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2541
+ case "ThrottlingException":
2542
+ case "com.amazonaws.vpclattice#ThrottlingException":
2543
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2544
+ case "ValidationException":
2545
+ case "com.amazonaws.vpclattice#ValidationException":
2546
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2547
+ default:
2548
+ const parsedBody = parsedOutput.body;
2549
+ throwDefaultError({
2550
+ output,
2551
+ parsedBody,
2552
+ exceptionCtor: __BaseException,
2553
+ errorCode,
2554
+ });
2555
+ }
2556
+ };
2557
+ export const deserializeAws_restJson1GetServiceNetworkCommand = async (output, context) => {
2558
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2559
+ return deserializeAws_restJson1GetServiceNetworkCommandError(output, context);
2560
+ }
2561
+ const contents = map({
2562
+ $metadata: deserializeMetadata(output),
2563
+ });
2564
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2565
+ if (data.arn != null) {
2566
+ contents.arn = __expectString(data.arn);
2567
+ }
2568
+ if (data.authType != null) {
2569
+ contents.authType = __expectString(data.authType);
2570
+ }
2571
+ if (data.createdAt != null) {
2572
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2573
+ }
2574
+ if (data.id != null) {
2575
+ contents.id = __expectString(data.id);
2576
+ }
2577
+ if (data.lastUpdatedAt != null) {
2578
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2579
+ }
2580
+ if (data.name != null) {
2581
+ contents.name = __expectString(data.name);
2582
+ }
2583
+ if (data.numberOfAssociatedServices != null) {
2584
+ contents.numberOfAssociatedServices = __expectLong(data.numberOfAssociatedServices);
2585
+ }
2586
+ if (data.numberOfAssociatedVPCs != null) {
2587
+ contents.numberOfAssociatedVPCs = __expectLong(data.numberOfAssociatedVPCs);
2588
+ }
2589
+ return contents;
2590
+ };
2591
+ const deserializeAws_restJson1GetServiceNetworkCommandError = async (output, context) => {
2592
+ const parsedOutput = {
2593
+ ...output,
2594
+ body: await parseErrorBody(output.body, context),
2595
+ };
2596
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2597
+ switch (errorCode) {
2598
+ case "AccessDeniedException":
2599
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2600
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2601
+ case "InternalServerException":
2602
+ case "com.amazonaws.vpclattice#InternalServerException":
2603
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2604
+ case "ResourceNotFoundException":
2605
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2606
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2607
+ case "ThrottlingException":
2608
+ case "com.amazonaws.vpclattice#ThrottlingException":
2609
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2610
+ case "ValidationException":
2611
+ case "com.amazonaws.vpclattice#ValidationException":
2612
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2613
+ default:
2614
+ const parsedBody = parsedOutput.body;
2615
+ throwDefaultError({
2616
+ output,
2617
+ parsedBody,
2618
+ exceptionCtor: __BaseException,
2619
+ errorCode,
2620
+ });
2621
+ }
2622
+ };
2623
+ export const deserializeAws_restJson1GetServiceNetworkServiceAssociationCommand = async (output, context) => {
2624
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2625
+ return deserializeAws_restJson1GetServiceNetworkServiceAssociationCommandError(output, context);
2626
+ }
2627
+ const contents = map({
2628
+ $metadata: deserializeMetadata(output),
2629
+ });
2630
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2631
+ if (data.arn != null) {
2632
+ contents.arn = __expectString(data.arn);
2633
+ }
2634
+ if (data.createdAt != null) {
2635
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2636
+ }
2637
+ if (data.createdBy != null) {
2638
+ contents.createdBy = __expectString(data.createdBy);
2639
+ }
2640
+ if (data.customDomainName != null) {
2641
+ contents.customDomainName = __expectString(data.customDomainName);
2642
+ }
2643
+ if (data.dnsEntry != null) {
2644
+ contents.dnsEntry = deserializeAws_restJson1DnsEntry(data.dnsEntry, context);
2645
+ }
2646
+ if (data.failureCode != null) {
2647
+ contents.failureCode = __expectString(data.failureCode);
2648
+ }
2649
+ if (data.failureMessage != null) {
2650
+ contents.failureMessage = __expectString(data.failureMessage);
2651
+ }
2652
+ if (data.id != null) {
2653
+ contents.id = __expectString(data.id);
2654
+ }
2655
+ if (data.serviceArn != null) {
2656
+ contents.serviceArn = __expectString(data.serviceArn);
2657
+ }
2658
+ if (data.serviceId != null) {
2659
+ contents.serviceId = __expectString(data.serviceId);
2660
+ }
2661
+ if (data.serviceName != null) {
2662
+ contents.serviceName = __expectString(data.serviceName);
2663
+ }
2664
+ if (data.serviceNetworkArn != null) {
2665
+ contents.serviceNetworkArn = __expectString(data.serviceNetworkArn);
2666
+ }
2667
+ if (data.serviceNetworkId != null) {
2668
+ contents.serviceNetworkId = __expectString(data.serviceNetworkId);
2669
+ }
2670
+ if (data.serviceNetworkName != null) {
2671
+ contents.serviceNetworkName = __expectString(data.serviceNetworkName);
2672
+ }
2673
+ if (data.status != null) {
2674
+ contents.status = __expectString(data.status);
2675
+ }
2676
+ return contents;
2677
+ };
2678
+ const deserializeAws_restJson1GetServiceNetworkServiceAssociationCommandError = async (output, context) => {
2679
+ const parsedOutput = {
2680
+ ...output,
2681
+ body: await parseErrorBody(output.body, context),
2682
+ };
2683
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2684
+ switch (errorCode) {
2685
+ case "AccessDeniedException":
2686
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2687
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2688
+ case "InternalServerException":
2689
+ case "com.amazonaws.vpclattice#InternalServerException":
2690
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2691
+ case "ResourceNotFoundException":
2692
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2693
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2694
+ case "ThrottlingException":
2695
+ case "com.amazonaws.vpclattice#ThrottlingException":
2696
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2697
+ case "ValidationException":
2698
+ case "com.amazonaws.vpclattice#ValidationException":
2699
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2700
+ default:
2701
+ const parsedBody = parsedOutput.body;
2702
+ throwDefaultError({
2703
+ output,
2704
+ parsedBody,
2705
+ exceptionCtor: __BaseException,
2706
+ errorCode,
2707
+ });
2708
+ }
2709
+ };
2710
+ export const deserializeAws_restJson1GetServiceNetworkVpcAssociationCommand = async (output, context) => {
2711
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2712
+ return deserializeAws_restJson1GetServiceNetworkVpcAssociationCommandError(output, context);
2713
+ }
2714
+ const contents = map({
2715
+ $metadata: deserializeMetadata(output),
2716
+ });
2717
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2718
+ if (data.arn != null) {
2719
+ contents.arn = __expectString(data.arn);
2720
+ }
2721
+ if (data.createdAt != null) {
2722
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2723
+ }
2724
+ if (data.createdBy != null) {
2725
+ contents.createdBy = __expectString(data.createdBy);
2726
+ }
2727
+ if (data.failureCode != null) {
2728
+ contents.failureCode = __expectString(data.failureCode);
2729
+ }
2730
+ if (data.failureMessage != null) {
2731
+ contents.failureMessage = __expectString(data.failureMessage);
2732
+ }
2733
+ if (data.id != null) {
2734
+ contents.id = __expectString(data.id);
2735
+ }
2736
+ if (data.lastUpdatedAt != null) {
2737
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2738
+ }
2739
+ if (data.securityGroupIds != null) {
2740
+ contents.securityGroupIds = deserializeAws_restJson1SecurityGroupList(data.securityGroupIds, context);
2741
+ }
2742
+ if (data.serviceNetworkArn != null) {
2743
+ contents.serviceNetworkArn = __expectString(data.serviceNetworkArn);
2744
+ }
2745
+ if (data.serviceNetworkId != null) {
2746
+ contents.serviceNetworkId = __expectString(data.serviceNetworkId);
2747
+ }
2748
+ if (data.serviceNetworkName != null) {
2749
+ contents.serviceNetworkName = __expectString(data.serviceNetworkName);
2750
+ }
2751
+ if (data.status != null) {
2752
+ contents.status = __expectString(data.status);
2753
+ }
2754
+ if (data.vpcId != null) {
2755
+ contents.vpcId = __expectString(data.vpcId);
2756
+ }
2757
+ return contents;
2758
+ };
2759
+ const deserializeAws_restJson1GetServiceNetworkVpcAssociationCommandError = async (output, context) => {
2760
+ const parsedOutput = {
2761
+ ...output,
2762
+ body: await parseErrorBody(output.body, context),
2763
+ };
2764
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2765
+ switch (errorCode) {
2766
+ case "AccessDeniedException":
2767
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2768
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2769
+ case "InternalServerException":
2770
+ case "com.amazonaws.vpclattice#InternalServerException":
2771
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2772
+ case "ResourceNotFoundException":
2773
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2774
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2775
+ case "ThrottlingException":
2776
+ case "com.amazonaws.vpclattice#ThrottlingException":
2777
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2778
+ case "ValidationException":
2779
+ case "com.amazonaws.vpclattice#ValidationException":
2780
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2781
+ default:
2782
+ const parsedBody = parsedOutput.body;
2783
+ throwDefaultError({
2784
+ output,
2785
+ parsedBody,
2786
+ exceptionCtor: __BaseException,
2787
+ errorCode,
2788
+ });
2789
+ }
2790
+ };
2791
+ export const deserializeAws_restJson1GetTargetGroupCommand = async (output, context) => {
2792
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2793
+ return deserializeAws_restJson1GetTargetGroupCommandError(output, context);
2794
+ }
2795
+ const contents = map({
2796
+ $metadata: deserializeMetadata(output),
2797
+ });
2798
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2799
+ if (data.arn != null) {
2800
+ contents.arn = __expectString(data.arn);
2801
+ }
2802
+ if (data.config != null) {
2803
+ contents.config = deserializeAws_restJson1TargetGroupConfig(data.config, context);
2804
+ }
2805
+ if (data.createdAt != null) {
2806
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.createdAt));
2807
+ }
2808
+ if (data.failureCode != null) {
2809
+ contents.failureCode = __expectString(data.failureCode);
2810
+ }
2811
+ if (data.failureMessage != null) {
2812
+ contents.failureMessage = __expectString(data.failureMessage);
2813
+ }
2814
+ if (data.id != null) {
2815
+ contents.id = __expectString(data.id);
2816
+ }
2817
+ if (data.lastUpdatedAt != null) {
2818
+ contents.lastUpdatedAt = __expectNonNull(__parseRfc3339DateTimeWithOffset(data.lastUpdatedAt));
2819
+ }
2820
+ if (data.name != null) {
2821
+ contents.name = __expectString(data.name);
2822
+ }
2823
+ if (data.serviceArns != null) {
2824
+ contents.serviceArns = deserializeAws_restJson1ServiceArnList(data.serviceArns, context);
2825
+ }
2826
+ if (data.status != null) {
2827
+ contents.status = __expectString(data.status);
2828
+ }
2829
+ if (data.type != null) {
2830
+ contents.type = __expectString(data.type);
2831
+ }
2832
+ return contents;
2833
+ };
2834
+ const deserializeAws_restJson1GetTargetGroupCommandError = async (output, context) => {
2835
+ const parsedOutput = {
2836
+ ...output,
2837
+ body: await parseErrorBody(output.body, context),
2838
+ };
2839
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2840
+ switch (errorCode) {
2841
+ case "InternalServerException":
2842
+ case "com.amazonaws.vpclattice#InternalServerException":
2843
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2844
+ case "ResourceNotFoundException":
2845
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2846
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2847
+ case "ThrottlingException":
2848
+ case "com.amazonaws.vpclattice#ThrottlingException":
2849
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2850
+ case "ValidationException":
2851
+ case "com.amazonaws.vpclattice#ValidationException":
2852
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2853
+ default:
2854
+ const parsedBody = parsedOutput.body;
2855
+ throwDefaultError({
2856
+ output,
2857
+ parsedBody,
2858
+ exceptionCtor: __BaseException,
2859
+ errorCode,
2860
+ });
2861
+ }
2862
+ };
2863
+ export const deserializeAws_restJson1ListAccessLogSubscriptionsCommand = async (output, context) => {
2864
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2865
+ return deserializeAws_restJson1ListAccessLogSubscriptionsCommandError(output, context);
2866
+ }
2867
+ const contents = map({
2868
+ $metadata: deserializeMetadata(output),
2869
+ });
2870
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2871
+ if (data.items != null) {
2872
+ contents.items = deserializeAws_restJson1AccessLogSubscriptionList(data.items, context);
2873
+ }
2874
+ if (data.nextToken != null) {
2875
+ contents.nextToken = __expectString(data.nextToken);
2876
+ }
2877
+ return contents;
2878
+ };
2879
+ const deserializeAws_restJson1ListAccessLogSubscriptionsCommandError = async (output, context) => {
2880
+ const parsedOutput = {
2881
+ ...output,
2882
+ body: await parseErrorBody(output.body, context),
2883
+ };
2884
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2885
+ switch (errorCode) {
2886
+ case "InternalServerException":
2887
+ case "com.amazonaws.vpclattice#InternalServerException":
2888
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2889
+ case "ThrottlingException":
2890
+ case "com.amazonaws.vpclattice#ThrottlingException":
2891
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2892
+ case "ValidationException":
2893
+ case "com.amazonaws.vpclattice#ValidationException":
2894
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2895
+ default:
2896
+ const parsedBody = parsedOutput.body;
2897
+ throwDefaultError({
2898
+ output,
2899
+ parsedBody,
2900
+ exceptionCtor: __BaseException,
2901
+ errorCode,
2902
+ });
2903
+ }
2904
+ };
2905
+ export const deserializeAws_restJson1ListListenersCommand = async (output, context) => {
2906
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2907
+ return deserializeAws_restJson1ListListenersCommandError(output, context);
2908
+ }
2909
+ const contents = map({
2910
+ $metadata: deserializeMetadata(output),
2911
+ });
2912
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2913
+ if (data.items != null) {
2914
+ contents.items = deserializeAws_restJson1ListenerSummaryList(data.items, context);
2915
+ }
2916
+ if (data.nextToken != null) {
2917
+ contents.nextToken = __expectString(data.nextToken);
2918
+ }
2919
+ return contents;
2920
+ };
2921
+ const deserializeAws_restJson1ListListenersCommandError = async (output, context) => {
2922
+ const parsedOutput = {
2923
+ ...output,
2924
+ body: await parseErrorBody(output.body, context),
2925
+ };
2926
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2927
+ switch (errorCode) {
2928
+ case "AccessDeniedException":
2929
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2930
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2931
+ case "InternalServerException":
2932
+ case "com.amazonaws.vpclattice#InternalServerException":
2933
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2934
+ case "ResourceNotFoundException":
2935
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2936
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2937
+ case "ThrottlingException":
2938
+ case "com.amazonaws.vpclattice#ThrottlingException":
2939
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2940
+ case "ValidationException":
2941
+ case "com.amazonaws.vpclattice#ValidationException":
2942
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2943
+ default:
2944
+ const parsedBody = parsedOutput.body;
2945
+ throwDefaultError({
2946
+ output,
2947
+ parsedBody,
2948
+ exceptionCtor: __BaseException,
2949
+ errorCode,
2950
+ });
2951
+ }
2952
+ };
2953
+ export const deserializeAws_restJson1ListRulesCommand = async (output, context) => {
2954
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2955
+ return deserializeAws_restJson1ListRulesCommandError(output, context);
2956
+ }
2957
+ const contents = map({
2958
+ $metadata: deserializeMetadata(output),
2959
+ });
2960
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2961
+ if (data.items != null) {
2962
+ contents.items = deserializeAws_restJson1RuleSummaryList(data.items, context);
2963
+ }
2964
+ if (data.nextToken != null) {
2965
+ contents.nextToken = __expectString(data.nextToken);
2966
+ }
2967
+ return contents;
2968
+ };
2969
+ const deserializeAws_restJson1ListRulesCommandError = async (output, context) => {
2970
+ const parsedOutput = {
2971
+ ...output,
2972
+ body: await parseErrorBody(output.body, context),
2973
+ };
2974
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2975
+ switch (errorCode) {
2976
+ case "AccessDeniedException":
2977
+ case "com.amazonaws.vpclattice#AccessDeniedException":
2978
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2979
+ case "InternalServerException":
2980
+ case "com.amazonaws.vpclattice#InternalServerException":
2981
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2982
+ case "ResourceNotFoundException":
2983
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
2984
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2985
+ case "ThrottlingException":
2986
+ case "com.amazonaws.vpclattice#ThrottlingException":
2987
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
2988
+ case "ValidationException":
2989
+ case "com.amazonaws.vpclattice#ValidationException":
2990
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2991
+ default:
2992
+ const parsedBody = parsedOutput.body;
2993
+ throwDefaultError({
2994
+ output,
2995
+ parsedBody,
2996
+ exceptionCtor: __BaseException,
2997
+ errorCode,
2998
+ });
2999
+ }
3000
+ };
3001
+ export const deserializeAws_restJson1ListServiceNetworksCommand = async (output, context) => {
3002
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3003
+ return deserializeAws_restJson1ListServiceNetworksCommandError(output, context);
3004
+ }
3005
+ const contents = map({
3006
+ $metadata: deserializeMetadata(output),
3007
+ });
3008
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3009
+ if (data.items != null) {
3010
+ contents.items = deserializeAws_restJson1ServiceNetworkList(data.items, context);
3011
+ }
3012
+ if (data.nextToken != null) {
3013
+ contents.nextToken = __expectString(data.nextToken);
3014
+ }
3015
+ return contents;
3016
+ };
3017
+ const deserializeAws_restJson1ListServiceNetworksCommandError = async (output, context) => {
3018
+ const parsedOutput = {
3019
+ ...output,
3020
+ body: await parseErrorBody(output.body, context),
3021
+ };
3022
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3023
+ switch (errorCode) {
3024
+ case "AccessDeniedException":
3025
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3026
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3027
+ case "InternalServerException":
3028
+ case "com.amazonaws.vpclattice#InternalServerException":
3029
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3030
+ case "ThrottlingException":
3031
+ case "com.amazonaws.vpclattice#ThrottlingException":
3032
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3033
+ case "ValidationException":
3034
+ case "com.amazonaws.vpclattice#ValidationException":
3035
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3036
+ default:
3037
+ const parsedBody = parsedOutput.body;
3038
+ throwDefaultError({
3039
+ output,
3040
+ parsedBody,
3041
+ exceptionCtor: __BaseException,
3042
+ errorCode,
3043
+ });
3044
+ }
3045
+ };
3046
+ export const deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommand = async (output, context) => {
3047
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3048
+ return deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommandError(output, context);
3049
+ }
3050
+ const contents = map({
3051
+ $metadata: deserializeMetadata(output),
3052
+ });
3053
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3054
+ if (data.items != null) {
3055
+ contents.items = deserializeAws_restJson1ServiceNetworkServiceAssociationList(data.items, context);
3056
+ }
3057
+ if (data.nextToken != null) {
3058
+ contents.nextToken = __expectString(data.nextToken);
3059
+ }
3060
+ return contents;
3061
+ };
3062
+ const deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommandError = async (output, context) => {
3063
+ const parsedOutput = {
3064
+ ...output,
3065
+ body: await parseErrorBody(output.body, context),
3066
+ };
3067
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3068
+ switch (errorCode) {
3069
+ case "AccessDeniedException":
3070
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3071
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3072
+ case "InternalServerException":
3073
+ case "com.amazonaws.vpclattice#InternalServerException":
3074
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3075
+ case "ThrottlingException":
3076
+ case "com.amazonaws.vpclattice#ThrottlingException":
3077
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3078
+ case "ValidationException":
3079
+ case "com.amazonaws.vpclattice#ValidationException":
3080
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3081
+ default:
3082
+ const parsedBody = parsedOutput.body;
3083
+ throwDefaultError({
3084
+ output,
3085
+ parsedBody,
3086
+ exceptionCtor: __BaseException,
3087
+ errorCode,
3088
+ });
3089
+ }
3090
+ };
3091
+ export const deserializeAws_restJson1ListServiceNetworkVpcAssociationsCommand = async (output, context) => {
3092
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3093
+ return deserializeAws_restJson1ListServiceNetworkVpcAssociationsCommandError(output, context);
3094
+ }
3095
+ const contents = map({
3096
+ $metadata: deserializeMetadata(output),
3097
+ });
3098
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3099
+ if (data.items != null) {
3100
+ contents.items = deserializeAws_restJson1ServiceNetworkVpcAssociationList(data.items, context);
3101
+ }
3102
+ if (data.nextToken != null) {
3103
+ contents.nextToken = __expectString(data.nextToken);
3104
+ }
3105
+ return contents;
3106
+ };
3107
+ const deserializeAws_restJson1ListServiceNetworkVpcAssociationsCommandError = async (output, context) => {
3108
+ const parsedOutput = {
3109
+ ...output,
3110
+ body: await parseErrorBody(output.body, context),
3111
+ };
3112
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3113
+ switch (errorCode) {
3114
+ case "AccessDeniedException":
3115
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3116
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3117
+ case "InternalServerException":
3118
+ case "com.amazonaws.vpclattice#InternalServerException":
3119
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3120
+ case "ThrottlingException":
3121
+ case "com.amazonaws.vpclattice#ThrottlingException":
3122
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3123
+ case "ValidationException":
3124
+ case "com.amazonaws.vpclattice#ValidationException":
3125
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3126
+ default:
3127
+ const parsedBody = parsedOutput.body;
3128
+ throwDefaultError({
3129
+ output,
3130
+ parsedBody,
3131
+ exceptionCtor: __BaseException,
3132
+ errorCode,
3133
+ });
3134
+ }
3135
+ };
3136
+ export const deserializeAws_restJson1ListServicesCommand = async (output, context) => {
3137
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3138
+ return deserializeAws_restJson1ListServicesCommandError(output, context);
3139
+ }
3140
+ const contents = map({
3141
+ $metadata: deserializeMetadata(output),
3142
+ });
3143
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3144
+ if (data.items != null) {
3145
+ contents.items = deserializeAws_restJson1ServiceList(data.items, context);
3146
+ }
3147
+ if (data.nextToken != null) {
3148
+ contents.nextToken = __expectString(data.nextToken);
3149
+ }
3150
+ return contents;
3151
+ };
3152
+ const deserializeAws_restJson1ListServicesCommandError = async (output, context) => {
3153
+ const parsedOutput = {
3154
+ ...output,
3155
+ body: await parseErrorBody(output.body, context),
3156
+ };
3157
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3158
+ switch (errorCode) {
3159
+ case "AccessDeniedException":
3160
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3161
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3162
+ case "InternalServerException":
3163
+ case "com.amazonaws.vpclattice#InternalServerException":
3164
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3165
+ case "ThrottlingException":
3166
+ case "com.amazonaws.vpclattice#ThrottlingException":
3167
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3168
+ case "ValidationException":
3169
+ case "com.amazonaws.vpclattice#ValidationException":
3170
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3171
+ default:
3172
+ const parsedBody = parsedOutput.body;
3173
+ throwDefaultError({
3174
+ output,
3175
+ parsedBody,
3176
+ exceptionCtor: __BaseException,
3177
+ errorCode,
3178
+ });
3179
+ }
3180
+ };
3181
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
3182
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3183
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
3184
+ }
3185
+ const contents = map({
3186
+ $metadata: deserializeMetadata(output),
3187
+ });
3188
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3189
+ if (data.tags != null) {
3190
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
3191
+ }
3192
+ return contents;
3193
+ };
3194
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
3195
+ const parsedOutput = {
3196
+ ...output,
3197
+ body: await parseErrorBody(output.body, context),
3198
+ };
3199
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3200
+ switch (errorCode) {
3201
+ case "InternalServerException":
3202
+ case "com.amazonaws.vpclattice#InternalServerException":
3203
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3204
+ case "ResourceNotFoundException":
3205
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3206
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3207
+ case "ValidationException":
3208
+ case "com.amazonaws.vpclattice#ValidationException":
3209
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3210
+ default:
3211
+ const parsedBody = parsedOutput.body;
3212
+ throwDefaultError({
3213
+ output,
3214
+ parsedBody,
3215
+ exceptionCtor: __BaseException,
3216
+ errorCode,
3217
+ });
3218
+ }
3219
+ };
3220
+ export const deserializeAws_restJson1ListTargetGroupsCommand = async (output, context) => {
3221
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3222
+ return deserializeAws_restJson1ListTargetGroupsCommandError(output, context);
3223
+ }
3224
+ const contents = map({
3225
+ $metadata: deserializeMetadata(output),
3226
+ });
3227
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3228
+ if (data.items != null) {
3229
+ contents.items = deserializeAws_restJson1TargetGroupList(data.items, context);
3230
+ }
3231
+ if (data.nextToken != null) {
3232
+ contents.nextToken = __expectString(data.nextToken);
3233
+ }
3234
+ return contents;
3235
+ };
3236
+ const deserializeAws_restJson1ListTargetGroupsCommandError = async (output, context) => {
3237
+ const parsedOutput = {
3238
+ ...output,
3239
+ body: await parseErrorBody(output.body, context),
3240
+ };
3241
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3242
+ switch (errorCode) {
3243
+ case "AccessDeniedException":
3244
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3245
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3246
+ case "InternalServerException":
3247
+ case "com.amazonaws.vpclattice#InternalServerException":
3248
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3249
+ case "ThrottlingException":
3250
+ case "com.amazonaws.vpclattice#ThrottlingException":
3251
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3252
+ case "ValidationException":
3253
+ case "com.amazonaws.vpclattice#ValidationException":
3254
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3255
+ default:
3256
+ const parsedBody = parsedOutput.body;
3257
+ throwDefaultError({
3258
+ output,
3259
+ parsedBody,
3260
+ exceptionCtor: __BaseException,
3261
+ errorCode,
3262
+ });
3263
+ }
3264
+ };
3265
+ export const deserializeAws_restJson1ListTargetsCommand = async (output, context) => {
3266
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3267
+ return deserializeAws_restJson1ListTargetsCommandError(output, context);
3268
+ }
3269
+ const contents = map({
3270
+ $metadata: deserializeMetadata(output),
3271
+ });
3272
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3273
+ if (data.items != null) {
3274
+ contents.items = deserializeAws_restJson1TargetSummaryList(data.items, context);
3275
+ }
3276
+ if (data.nextToken != null) {
3277
+ contents.nextToken = __expectString(data.nextToken);
3278
+ }
3279
+ return contents;
3280
+ };
3281
+ const deserializeAws_restJson1ListTargetsCommandError = async (output, context) => {
3282
+ const parsedOutput = {
3283
+ ...output,
3284
+ body: await parseErrorBody(output.body, context),
3285
+ };
3286
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3287
+ switch (errorCode) {
3288
+ case "AccessDeniedException":
3289
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3290
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3291
+ case "InternalServerException":
3292
+ case "com.amazonaws.vpclattice#InternalServerException":
3293
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3294
+ case "ResourceNotFoundException":
3295
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3296
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3297
+ case "ThrottlingException":
3298
+ case "com.amazonaws.vpclattice#ThrottlingException":
3299
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3300
+ case "ValidationException":
3301
+ case "com.amazonaws.vpclattice#ValidationException":
3302
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3303
+ default:
3304
+ const parsedBody = parsedOutput.body;
3305
+ throwDefaultError({
3306
+ output,
3307
+ parsedBody,
3308
+ exceptionCtor: __BaseException,
3309
+ errorCode,
3310
+ });
3311
+ }
3312
+ };
3313
+ export const deserializeAws_restJson1PutAuthPolicyCommand = async (output, context) => {
3314
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3315
+ return deserializeAws_restJson1PutAuthPolicyCommandError(output, context);
3316
+ }
3317
+ const contents = map({
3318
+ $metadata: deserializeMetadata(output),
3319
+ });
3320
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3321
+ if (data.policy != null) {
3322
+ contents.policy = __expectString(data.policy);
3323
+ }
3324
+ if (data.state != null) {
3325
+ contents.state = __expectString(data.state);
3326
+ }
3327
+ return contents;
3328
+ };
3329
+ const deserializeAws_restJson1PutAuthPolicyCommandError = async (output, context) => {
3330
+ const parsedOutput = {
3331
+ ...output,
3332
+ body: await parseErrorBody(output.body, context),
3333
+ };
3334
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3335
+ switch (errorCode) {
3336
+ case "AccessDeniedException":
3337
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3338
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3339
+ case "InternalServerException":
3340
+ case "com.amazonaws.vpclattice#InternalServerException":
3341
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3342
+ case "ResourceNotFoundException":
3343
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3344
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3345
+ case "ThrottlingException":
3346
+ case "com.amazonaws.vpclattice#ThrottlingException":
3347
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3348
+ case "ValidationException":
3349
+ case "com.amazonaws.vpclattice#ValidationException":
3350
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3351
+ default:
3352
+ const parsedBody = parsedOutput.body;
3353
+ throwDefaultError({
3354
+ output,
3355
+ parsedBody,
3356
+ exceptionCtor: __BaseException,
3357
+ errorCode,
3358
+ });
3359
+ }
3360
+ };
3361
+ export const deserializeAws_restJson1PutResourcePolicyCommand = async (output, context) => {
3362
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3363
+ return deserializeAws_restJson1PutResourcePolicyCommandError(output, context);
3364
+ }
3365
+ const contents = map({
3366
+ $metadata: deserializeMetadata(output),
3367
+ });
3368
+ await collectBody(output.body, context);
3369
+ return contents;
3370
+ };
3371
+ const deserializeAws_restJson1PutResourcePolicyCommandError = async (output, context) => {
3372
+ const parsedOutput = {
3373
+ ...output,
3374
+ body: await parseErrorBody(output.body, context),
3375
+ };
3376
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3377
+ switch (errorCode) {
3378
+ case "AccessDeniedException":
3379
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3380
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3381
+ case "InternalServerException":
3382
+ case "com.amazonaws.vpclattice#InternalServerException":
3383
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3384
+ case "ResourceNotFoundException":
3385
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3386
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3387
+ case "ThrottlingException":
3388
+ case "com.amazonaws.vpclattice#ThrottlingException":
3389
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3390
+ case "ValidationException":
3391
+ case "com.amazonaws.vpclattice#ValidationException":
3392
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3393
+ default:
3394
+ const parsedBody = parsedOutput.body;
3395
+ throwDefaultError({
3396
+ output,
3397
+ parsedBody,
3398
+ exceptionCtor: __BaseException,
3399
+ errorCode,
3400
+ });
3401
+ }
3402
+ };
3403
+ export const deserializeAws_restJson1RegisterTargetsCommand = async (output, context) => {
3404
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3405
+ return deserializeAws_restJson1RegisterTargetsCommandError(output, context);
3406
+ }
3407
+ const contents = map({
3408
+ $metadata: deserializeMetadata(output),
3409
+ });
3410
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3411
+ if (data.successful != null) {
3412
+ contents.successful = deserializeAws_restJson1TargetList(data.successful, context);
3413
+ }
3414
+ if (data.unsuccessful != null) {
3415
+ contents.unsuccessful = deserializeAws_restJson1TargetFailureList(data.unsuccessful, context);
3416
+ }
3417
+ return contents;
3418
+ };
3419
+ const deserializeAws_restJson1RegisterTargetsCommandError = async (output, context) => {
3420
+ const parsedOutput = {
3421
+ ...output,
3422
+ body: await parseErrorBody(output.body, context),
3423
+ };
3424
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3425
+ switch (errorCode) {
3426
+ case "AccessDeniedException":
3427
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3428
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3429
+ case "ConflictException":
3430
+ case "com.amazonaws.vpclattice#ConflictException":
3431
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3432
+ case "InternalServerException":
3433
+ case "com.amazonaws.vpclattice#InternalServerException":
3434
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3435
+ case "ResourceNotFoundException":
3436
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3437
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3438
+ case "ServiceQuotaExceededException":
3439
+ case "com.amazonaws.vpclattice#ServiceQuotaExceededException":
3440
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
3441
+ case "ThrottlingException":
3442
+ case "com.amazonaws.vpclattice#ThrottlingException":
3443
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3444
+ case "ValidationException":
3445
+ case "com.amazonaws.vpclattice#ValidationException":
3446
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3447
+ default:
3448
+ const parsedBody = parsedOutput.body;
3449
+ throwDefaultError({
3450
+ output,
3451
+ parsedBody,
3452
+ exceptionCtor: __BaseException,
3453
+ errorCode,
3454
+ });
3455
+ }
3456
+ };
3457
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
3458
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3459
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
3460
+ }
3461
+ const contents = map({
3462
+ $metadata: deserializeMetadata(output),
3463
+ });
3464
+ await collectBody(output.body, context);
3465
+ return contents;
3466
+ };
3467
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
3468
+ const parsedOutput = {
3469
+ ...output,
3470
+ body: await parseErrorBody(output.body, context),
3471
+ };
3472
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3473
+ switch (errorCode) {
3474
+ case "AccessDeniedException":
3475
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3476
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3477
+ case "InternalServerException":
3478
+ case "com.amazonaws.vpclattice#InternalServerException":
3479
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3480
+ case "ResourceNotFoundException":
3481
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3482
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3483
+ case "ThrottlingException":
3484
+ case "com.amazonaws.vpclattice#ThrottlingException":
3485
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3486
+ case "ValidationException":
3487
+ case "com.amazonaws.vpclattice#ValidationException":
3488
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3489
+ default:
3490
+ const parsedBody = parsedOutput.body;
3491
+ throwDefaultError({
3492
+ output,
3493
+ parsedBody,
3494
+ exceptionCtor: __BaseException,
3495
+ errorCode,
3496
+ });
3497
+ }
3498
+ };
3499
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
3500
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3501
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
3502
+ }
3503
+ const contents = map({
3504
+ $metadata: deserializeMetadata(output),
3505
+ });
3506
+ await collectBody(output.body, context);
3507
+ return contents;
3508
+ };
3509
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
3510
+ const parsedOutput = {
3511
+ ...output,
3512
+ body: await parseErrorBody(output.body, context),
3513
+ };
3514
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3515
+ switch (errorCode) {
3516
+ case "InternalServerException":
3517
+ case "com.amazonaws.vpclattice#InternalServerException":
3518
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3519
+ case "ResourceNotFoundException":
3520
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3521
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3522
+ case "ValidationException":
3523
+ case "com.amazonaws.vpclattice#ValidationException":
3524
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3525
+ default:
3526
+ const parsedBody = parsedOutput.body;
3527
+ throwDefaultError({
3528
+ output,
3529
+ parsedBody,
3530
+ exceptionCtor: __BaseException,
3531
+ errorCode,
3532
+ });
3533
+ }
3534
+ };
3535
+ export const deserializeAws_restJson1UpdateAccessLogSubscriptionCommand = async (output, context) => {
3536
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3537
+ return deserializeAws_restJson1UpdateAccessLogSubscriptionCommandError(output, context);
3538
+ }
3539
+ const contents = map({
3540
+ $metadata: deserializeMetadata(output),
3541
+ });
3542
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3543
+ if (data.arn != null) {
3544
+ contents.arn = __expectString(data.arn);
3545
+ }
3546
+ if (data.destinationArn != null) {
3547
+ contents.destinationArn = __expectString(data.destinationArn);
3548
+ }
3549
+ if (data.id != null) {
3550
+ contents.id = __expectString(data.id);
3551
+ }
3552
+ if (data.resourceArn != null) {
3553
+ contents.resourceArn = __expectString(data.resourceArn);
3554
+ }
3555
+ if (data.resourceId != null) {
3556
+ contents.resourceId = __expectString(data.resourceId);
3557
+ }
3558
+ return contents;
3559
+ };
3560
+ const deserializeAws_restJson1UpdateAccessLogSubscriptionCommandError = async (output, context) => {
3561
+ const parsedOutput = {
3562
+ ...output,
3563
+ body: await parseErrorBody(output.body, context),
3564
+ };
3565
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3566
+ switch (errorCode) {
3567
+ case "AccessDeniedException":
3568
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3569
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3570
+ case "ConflictException":
3571
+ case "com.amazonaws.vpclattice#ConflictException":
3572
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3573
+ case "InternalServerException":
3574
+ case "com.amazonaws.vpclattice#InternalServerException":
3575
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3576
+ case "ResourceNotFoundException":
3577
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3578
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3579
+ case "ThrottlingException":
3580
+ case "com.amazonaws.vpclattice#ThrottlingException":
3581
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3582
+ case "ValidationException":
3583
+ case "com.amazonaws.vpclattice#ValidationException":
3584
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3585
+ default:
3586
+ const parsedBody = parsedOutput.body;
3587
+ throwDefaultError({
3588
+ output,
3589
+ parsedBody,
3590
+ exceptionCtor: __BaseException,
3591
+ errorCode,
3592
+ });
3593
+ }
3594
+ };
3595
+ export const deserializeAws_restJson1UpdateListenerCommand = async (output, context) => {
3596
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3597
+ return deserializeAws_restJson1UpdateListenerCommandError(output, context);
3598
+ }
3599
+ const contents = map({
3600
+ $metadata: deserializeMetadata(output),
3601
+ });
3602
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3603
+ if (data.arn != null) {
3604
+ contents.arn = __expectString(data.arn);
3605
+ }
3606
+ if (data.defaultAction != null) {
3607
+ contents.defaultAction = deserializeAws_restJson1RuleAction(__expectUnion(data.defaultAction), context);
3608
+ }
3609
+ if (data.id != null) {
3610
+ contents.id = __expectString(data.id);
3611
+ }
3612
+ if (data.name != null) {
3613
+ contents.name = __expectString(data.name);
3614
+ }
3615
+ if (data.port != null) {
3616
+ contents.port = __expectInt32(data.port);
3617
+ }
3618
+ if (data.protocol != null) {
3619
+ contents.protocol = __expectString(data.protocol);
3620
+ }
3621
+ if (data.serviceArn != null) {
3622
+ contents.serviceArn = __expectString(data.serviceArn);
3623
+ }
3624
+ if (data.serviceId != null) {
3625
+ contents.serviceId = __expectString(data.serviceId);
3626
+ }
3627
+ return contents;
3628
+ };
3629
+ const deserializeAws_restJson1UpdateListenerCommandError = async (output, context) => {
3630
+ const parsedOutput = {
3631
+ ...output,
3632
+ body: await parseErrorBody(output.body, context),
3633
+ };
3634
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3635
+ switch (errorCode) {
3636
+ case "AccessDeniedException":
3637
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3638
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3639
+ case "ConflictException":
3640
+ case "com.amazonaws.vpclattice#ConflictException":
3641
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3642
+ case "InternalServerException":
3643
+ case "com.amazonaws.vpclattice#InternalServerException":
3644
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3645
+ case "ResourceNotFoundException":
3646
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3647
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3648
+ case "ThrottlingException":
3649
+ case "com.amazonaws.vpclattice#ThrottlingException":
3650
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3651
+ case "ValidationException":
3652
+ case "com.amazonaws.vpclattice#ValidationException":
3653
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3654
+ default:
3655
+ const parsedBody = parsedOutput.body;
3656
+ throwDefaultError({
3657
+ output,
3658
+ parsedBody,
3659
+ exceptionCtor: __BaseException,
3660
+ errorCode,
3661
+ });
3662
+ }
3663
+ };
3664
+ export const deserializeAws_restJson1UpdateRuleCommand = async (output, context) => {
3665
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3666
+ return deserializeAws_restJson1UpdateRuleCommandError(output, context);
3667
+ }
3668
+ const contents = map({
3669
+ $metadata: deserializeMetadata(output),
3670
+ });
3671
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3672
+ if (data.action != null) {
3673
+ contents.action = deserializeAws_restJson1RuleAction(__expectUnion(data.action), context);
3674
+ }
3675
+ if (data.arn != null) {
3676
+ contents.arn = __expectString(data.arn);
3677
+ }
3678
+ if (data.id != null) {
3679
+ contents.id = __expectString(data.id);
3680
+ }
3681
+ if (data.isDefault != null) {
3682
+ contents.isDefault = __expectBoolean(data.isDefault);
3683
+ }
3684
+ if (data.match != null) {
3685
+ contents.match = deserializeAws_restJson1RuleMatch(__expectUnion(data.match), context);
3686
+ }
3687
+ if (data.name != null) {
3688
+ contents.name = __expectString(data.name);
3689
+ }
3690
+ if (data.priority != null) {
3691
+ contents.priority = __expectInt32(data.priority);
3692
+ }
3693
+ return contents;
3694
+ };
3695
+ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) => {
3696
+ const parsedOutput = {
3697
+ ...output,
3698
+ body: await parseErrorBody(output.body, context),
3699
+ };
3700
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3701
+ switch (errorCode) {
3702
+ case "AccessDeniedException":
3703
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3704
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3705
+ case "ConflictException":
3706
+ case "com.amazonaws.vpclattice#ConflictException":
3707
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3708
+ case "InternalServerException":
3709
+ case "com.amazonaws.vpclattice#InternalServerException":
3710
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3711
+ case "ResourceNotFoundException":
3712
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3713
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3714
+ case "ThrottlingException":
3715
+ case "com.amazonaws.vpclattice#ThrottlingException":
3716
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3717
+ case "ValidationException":
3718
+ case "com.amazonaws.vpclattice#ValidationException":
3719
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3720
+ default:
3721
+ const parsedBody = parsedOutput.body;
3722
+ throwDefaultError({
3723
+ output,
3724
+ parsedBody,
3725
+ exceptionCtor: __BaseException,
3726
+ errorCode,
3727
+ });
3728
+ }
3729
+ };
3730
+ export const deserializeAws_restJson1UpdateServiceCommand = async (output, context) => {
3731
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3732
+ return deserializeAws_restJson1UpdateServiceCommandError(output, context);
3733
+ }
3734
+ const contents = map({
3735
+ $metadata: deserializeMetadata(output),
3736
+ });
3737
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3738
+ if (data.arn != null) {
3739
+ contents.arn = __expectString(data.arn);
3740
+ }
3741
+ if (data.authType != null) {
3742
+ contents.authType = __expectString(data.authType);
3743
+ }
3744
+ if (data.certificateArn != null) {
3745
+ contents.certificateArn = __expectString(data.certificateArn);
3746
+ }
3747
+ if (data.customDomainName != null) {
3748
+ contents.customDomainName = __expectString(data.customDomainName);
3749
+ }
3750
+ if (data.id != null) {
3751
+ contents.id = __expectString(data.id);
3752
+ }
3753
+ if (data.name != null) {
3754
+ contents.name = __expectString(data.name);
3755
+ }
3756
+ return contents;
3757
+ };
3758
+ const deserializeAws_restJson1UpdateServiceCommandError = async (output, context) => {
3759
+ const parsedOutput = {
3760
+ ...output,
3761
+ body: await parseErrorBody(output.body, context),
3762
+ };
3763
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3764
+ switch (errorCode) {
3765
+ case "AccessDeniedException":
3766
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3767
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3768
+ case "ConflictException":
3769
+ case "com.amazonaws.vpclattice#ConflictException":
3770
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3771
+ case "InternalServerException":
3772
+ case "com.amazonaws.vpclattice#InternalServerException":
3773
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3774
+ case "ResourceNotFoundException":
3775
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3776
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3777
+ case "ThrottlingException":
3778
+ case "com.amazonaws.vpclattice#ThrottlingException":
3779
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3780
+ case "ValidationException":
3781
+ case "com.amazonaws.vpclattice#ValidationException":
3782
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3783
+ default:
3784
+ const parsedBody = parsedOutput.body;
3785
+ throwDefaultError({
3786
+ output,
3787
+ parsedBody,
3788
+ exceptionCtor: __BaseException,
3789
+ errorCode,
3790
+ });
3791
+ }
3792
+ };
3793
+ export const deserializeAws_restJson1UpdateServiceNetworkCommand = async (output, context) => {
3794
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3795
+ return deserializeAws_restJson1UpdateServiceNetworkCommandError(output, context);
3796
+ }
3797
+ const contents = map({
3798
+ $metadata: deserializeMetadata(output),
3799
+ });
3800
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3801
+ if (data.arn != null) {
3802
+ contents.arn = __expectString(data.arn);
3803
+ }
3804
+ if (data.authType != null) {
3805
+ contents.authType = __expectString(data.authType);
3806
+ }
3807
+ if (data.id != null) {
3808
+ contents.id = __expectString(data.id);
3809
+ }
3810
+ if (data.name != null) {
3811
+ contents.name = __expectString(data.name);
3812
+ }
3813
+ return contents;
3814
+ };
3815
+ const deserializeAws_restJson1UpdateServiceNetworkCommandError = async (output, context) => {
3816
+ const parsedOutput = {
3817
+ ...output,
3818
+ body: await parseErrorBody(output.body, context),
3819
+ };
3820
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3821
+ switch (errorCode) {
3822
+ case "AccessDeniedException":
3823
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3824
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3825
+ case "ConflictException":
3826
+ case "com.amazonaws.vpclattice#ConflictException":
3827
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3828
+ case "InternalServerException":
3829
+ case "com.amazonaws.vpclattice#InternalServerException":
3830
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3831
+ case "ResourceNotFoundException":
3832
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3833
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3834
+ case "ThrottlingException":
3835
+ case "com.amazonaws.vpclattice#ThrottlingException":
3836
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3837
+ case "ValidationException":
3838
+ case "com.amazonaws.vpclattice#ValidationException":
3839
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3840
+ default:
3841
+ const parsedBody = parsedOutput.body;
3842
+ throwDefaultError({
3843
+ output,
3844
+ parsedBody,
3845
+ exceptionCtor: __BaseException,
3846
+ errorCode,
3847
+ });
3848
+ }
3849
+ };
3850
+ export const deserializeAws_restJson1UpdateServiceNetworkVpcAssociationCommand = async (output, context) => {
3851
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3852
+ return deserializeAws_restJson1UpdateServiceNetworkVpcAssociationCommandError(output, context);
3853
+ }
3854
+ const contents = map({
3855
+ $metadata: deserializeMetadata(output),
3856
+ });
3857
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3858
+ if (data.arn != null) {
3859
+ contents.arn = __expectString(data.arn);
3860
+ }
3861
+ if (data.createdBy != null) {
3862
+ contents.createdBy = __expectString(data.createdBy);
3863
+ }
3864
+ if (data.id != null) {
3865
+ contents.id = __expectString(data.id);
3866
+ }
3867
+ if (data.securityGroupIds != null) {
3868
+ contents.securityGroupIds = deserializeAws_restJson1SecurityGroupList(data.securityGroupIds, context);
3869
+ }
3870
+ if (data.status != null) {
3871
+ contents.status = __expectString(data.status);
3872
+ }
3873
+ return contents;
3874
+ };
3875
+ const deserializeAws_restJson1UpdateServiceNetworkVpcAssociationCommandError = async (output, context) => {
3876
+ const parsedOutput = {
3877
+ ...output,
3878
+ body: await parseErrorBody(output.body, context),
3879
+ };
3880
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3881
+ switch (errorCode) {
3882
+ case "AccessDeniedException":
3883
+ case "com.amazonaws.vpclattice#AccessDeniedException":
3884
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3885
+ case "ConflictException":
3886
+ case "com.amazonaws.vpclattice#ConflictException":
3887
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3888
+ case "InternalServerException":
3889
+ case "com.amazonaws.vpclattice#InternalServerException":
3890
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3891
+ case "ResourceNotFoundException":
3892
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3893
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3894
+ case "ThrottlingException":
3895
+ case "com.amazonaws.vpclattice#ThrottlingException":
3896
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3897
+ case "ValidationException":
3898
+ case "com.amazonaws.vpclattice#ValidationException":
3899
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3900
+ default:
3901
+ const parsedBody = parsedOutput.body;
3902
+ throwDefaultError({
3903
+ output,
3904
+ parsedBody,
3905
+ exceptionCtor: __BaseException,
3906
+ errorCode,
3907
+ });
3908
+ }
3909
+ };
3910
+ export const deserializeAws_restJson1UpdateTargetGroupCommand = async (output, context) => {
3911
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
3912
+ return deserializeAws_restJson1UpdateTargetGroupCommandError(output, context);
3913
+ }
3914
+ const contents = map({
3915
+ $metadata: deserializeMetadata(output),
3916
+ });
3917
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3918
+ if (data.arn != null) {
3919
+ contents.arn = __expectString(data.arn);
3920
+ }
3921
+ if (data.config != null) {
3922
+ contents.config = deserializeAws_restJson1TargetGroupConfig(data.config, context);
3923
+ }
3924
+ if (data.id != null) {
3925
+ contents.id = __expectString(data.id);
3926
+ }
3927
+ if (data.name != null) {
3928
+ contents.name = __expectString(data.name);
3929
+ }
3930
+ if (data.status != null) {
3931
+ contents.status = __expectString(data.status);
3932
+ }
3933
+ if (data.type != null) {
3934
+ contents.type = __expectString(data.type);
3935
+ }
3936
+ return contents;
3937
+ };
3938
+ const deserializeAws_restJson1UpdateTargetGroupCommandError = async (output, context) => {
3939
+ const parsedOutput = {
3940
+ ...output,
3941
+ body: await parseErrorBody(output.body, context),
3942
+ };
3943
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3944
+ switch (errorCode) {
3945
+ case "ConflictException":
3946
+ case "com.amazonaws.vpclattice#ConflictException":
3947
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
3948
+ case "InternalServerException":
3949
+ case "com.amazonaws.vpclattice#InternalServerException":
3950
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3951
+ case "ResourceNotFoundException":
3952
+ case "com.amazonaws.vpclattice#ResourceNotFoundException":
3953
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3954
+ case "ThrottlingException":
3955
+ case "com.amazonaws.vpclattice#ThrottlingException":
3956
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
3957
+ case "ValidationException":
3958
+ case "com.amazonaws.vpclattice#ValidationException":
3959
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3960
+ default:
3961
+ const parsedBody = parsedOutput.body;
3962
+ throwDefaultError({
3963
+ output,
3964
+ parsedBody,
3965
+ exceptionCtor: __BaseException,
3966
+ errorCode,
3967
+ });
3968
+ }
3969
+ };
3970
+ const map = __map;
3971
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
3972
+ const contents = map({});
3973
+ const data = parsedOutput.body;
3974
+ if (data.message != null) {
3975
+ contents.message = __expectString(data.message);
3976
+ }
3977
+ const exception = new AccessDeniedException({
3978
+ $metadata: deserializeMetadata(parsedOutput),
3979
+ ...contents,
3980
+ });
3981
+ return __decorateServiceException(exception, parsedOutput.body);
3982
+ };
3983
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
3984
+ const contents = map({});
3985
+ const data = parsedOutput.body;
3986
+ if (data.message != null) {
3987
+ contents.message = __expectString(data.message);
3988
+ }
3989
+ if (data.resourceId != null) {
3990
+ contents.resourceId = __expectString(data.resourceId);
3991
+ }
3992
+ if (data.resourceType != null) {
3993
+ contents.resourceType = __expectString(data.resourceType);
3994
+ }
3995
+ const exception = new ConflictException({
3996
+ $metadata: deserializeMetadata(parsedOutput),
3997
+ ...contents,
3998
+ });
3999
+ return __decorateServiceException(exception, parsedOutput.body);
4000
+ };
4001
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
4002
+ const contents = map({
4003
+ retryAfterSeconds: [
4004
+ () => void 0 !== parsedOutput.headers["retry-after"],
4005
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
4006
+ ],
4007
+ });
4008
+ const data = parsedOutput.body;
4009
+ if (data.message != null) {
4010
+ contents.message = __expectString(data.message);
4011
+ }
4012
+ const exception = new InternalServerException({
4013
+ $metadata: deserializeMetadata(parsedOutput),
4014
+ ...contents,
4015
+ });
4016
+ return __decorateServiceException(exception, parsedOutput.body);
4017
+ };
4018
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
4019
+ const contents = map({});
4020
+ const data = parsedOutput.body;
4021
+ if (data.message != null) {
4022
+ contents.message = __expectString(data.message);
4023
+ }
4024
+ if (data.resourceId != null) {
4025
+ contents.resourceId = __expectString(data.resourceId);
4026
+ }
4027
+ if (data.resourceType != null) {
4028
+ contents.resourceType = __expectString(data.resourceType);
4029
+ }
4030
+ const exception = new ResourceNotFoundException({
4031
+ $metadata: deserializeMetadata(parsedOutput),
4032
+ ...contents,
4033
+ });
4034
+ return __decorateServiceException(exception, parsedOutput.body);
4035
+ };
4036
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
4037
+ const contents = map({});
4038
+ const data = parsedOutput.body;
4039
+ if (data.message != null) {
4040
+ contents.message = __expectString(data.message);
4041
+ }
4042
+ if (data.quotaCode != null) {
4043
+ contents.quotaCode = __expectString(data.quotaCode);
4044
+ }
4045
+ if (data.resourceId != null) {
4046
+ contents.resourceId = __expectString(data.resourceId);
4047
+ }
4048
+ if (data.resourceType != null) {
4049
+ contents.resourceType = __expectString(data.resourceType);
4050
+ }
4051
+ if (data.serviceCode != null) {
4052
+ contents.serviceCode = __expectString(data.serviceCode);
4053
+ }
4054
+ const exception = new ServiceQuotaExceededException({
4055
+ $metadata: deserializeMetadata(parsedOutput),
4056
+ ...contents,
4057
+ });
4058
+ return __decorateServiceException(exception, parsedOutput.body);
4059
+ };
4060
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
4061
+ const contents = map({
4062
+ retryAfterSeconds: [
4063
+ () => void 0 !== parsedOutput.headers["retry-after"],
4064
+ () => __strictParseInt32(parsedOutput.headers["retry-after"]),
4065
+ ],
4066
+ });
4067
+ const data = parsedOutput.body;
4068
+ if (data.message != null) {
4069
+ contents.message = __expectString(data.message);
4070
+ }
4071
+ if (data.quotaCode != null) {
4072
+ contents.quotaCode = __expectString(data.quotaCode);
4073
+ }
4074
+ if (data.serviceCode != null) {
4075
+ contents.serviceCode = __expectString(data.serviceCode);
4076
+ }
4077
+ const exception = new ThrottlingException({
4078
+ $metadata: deserializeMetadata(parsedOutput),
4079
+ ...contents,
4080
+ });
4081
+ return __decorateServiceException(exception, parsedOutput.body);
4082
+ };
4083
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
4084
+ const contents = map({});
4085
+ const data = parsedOutput.body;
4086
+ if (data.fieldList != null) {
4087
+ contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
4088
+ }
4089
+ if (data.message != null) {
4090
+ contents.message = __expectString(data.message);
4091
+ }
4092
+ if (data.reason != null) {
4093
+ contents.reason = __expectString(data.reason);
4094
+ }
4095
+ const exception = new ValidationException({
4096
+ $metadata: deserializeMetadata(parsedOutput),
4097
+ ...contents,
4098
+ });
4099
+ return __decorateServiceException(exception, parsedOutput.body);
4100
+ };
4101
+ const serializeAws_restJson1FixedResponseAction = (input, context) => {
4102
+ return {
4103
+ ...(input.statusCode != null && { statusCode: input.statusCode }),
4104
+ };
4105
+ };
4106
+ const serializeAws_restJson1ForwardAction = (input, context) => {
4107
+ return {
4108
+ ...(input.targetGroups != null && {
4109
+ targetGroups: serializeAws_restJson1WeightedTargetGroupList(input.targetGroups, context),
4110
+ }),
4111
+ };
4112
+ };
4113
+ const serializeAws_restJson1HeaderMatch = (input, context) => {
4114
+ return {
4115
+ ...(input.caseSensitive != null && { caseSensitive: input.caseSensitive }),
4116
+ ...(input.match != null && { match: serializeAws_restJson1HeaderMatchType(input.match, context) }),
4117
+ ...(input.name != null && { name: input.name }),
4118
+ };
4119
+ };
4120
+ const serializeAws_restJson1HeaderMatchList = (input, context) => {
4121
+ return input
4122
+ .filter((e) => e != null)
4123
+ .map((entry) => {
4124
+ return serializeAws_restJson1HeaderMatch(entry, context);
4125
+ });
4126
+ };
4127
+ const serializeAws_restJson1HeaderMatchType = (input, context) => {
4128
+ return HeaderMatchType.visit(input, {
4129
+ contains: (value) => ({ contains: value }),
4130
+ exact: (value) => ({ exact: value }),
4131
+ prefix: (value) => ({ prefix: value }),
4132
+ _: (name, value) => ({ name: value }),
4133
+ });
4134
+ };
4135
+ const serializeAws_restJson1HealthCheckConfig = (input, context) => {
4136
+ return {
4137
+ ...(input.enabled != null && { enabled: input.enabled }),
4138
+ ...(input.healthCheckIntervalSeconds != null && { healthCheckIntervalSeconds: input.healthCheckIntervalSeconds }),
4139
+ ...(input.healthCheckTimeoutSeconds != null && { healthCheckTimeoutSeconds: input.healthCheckTimeoutSeconds }),
4140
+ ...(input.healthyThresholdCount != null && { healthyThresholdCount: input.healthyThresholdCount }),
4141
+ ...(input.matcher != null && { matcher: serializeAws_restJson1Matcher(input.matcher, context) }),
4142
+ ...(input.path != null && { path: input.path }),
4143
+ ...(input.port != null && { port: input.port }),
4144
+ ...(input.protocol != null && { protocol: input.protocol }),
4145
+ ...(input.protocolVersion != null && { protocolVersion: input.protocolVersion }),
4146
+ ...(input.unhealthyThresholdCount != null && { unhealthyThresholdCount: input.unhealthyThresholdCount }),
4147
+ };
4148
+ };
4149
+ const serializeAws_restJson1HttpMatch = (input, context) => {
4150
+ return {
4151
+ ...(input.headerMatches != null && {
4152
+ headerMatches: serializeAws_restJson1HeaderMatchList(input.headerMatches, context),
4153
+ }),
4154
+ ...(input.method != null && { method: input.method }),
4155
+ ...(input.pathMatch != null && { pathMatch: serializeAws_restJson1PathMatch(input.pathMatch, context) }),
4156
+ };
4157
+ };
4158
+ const serializeAws_restJson1Matcher = (input, context) => {
4159
+ return Matcher.visit(input, {
4160
+ httpCode: (value) => ({ httpCode: value }),
4161
+ _: (name, value) => ({ name: value }),
4162
+ });
4163
+ };
4164
+ const serializeAws_restJson1PathMatch = (input, context) => {
4165
+ return {
4166
+ ...(input.caseSensitive != null && { caseSensitive: input.caseSensitive }),
4167
+ ...(input.match != null && { match: serializeAws_restJson1PathMatchType(input.match, context) }),
4168
+ };
4169
+ };
4170
+ const serializeAws_restJson1PathMatchType = (input, context) => {
4171
+ return PathMatchType.visit(input, {
4172
+ exact: (value) => ({ exact: value }),
4173
+ prefix: (value) => ({ prefix: value }),
4174
+ _: (name, value) => ({ name: value }),
4175
+ });
4176
+ };
4177
+ const serializeAws_restJson1RuleAction = (input, context) => {
4178
+ return RuleAction.visit(input, {
4179
+ fixedResponse: (value) => ({ fixedResponse: serializeAws_restJson1FixedResponseAction(value, context) }),
4180
+ forward: (value) => ({ forward: serializeAws_restJson1ForwardAction(value, context) }),
4181
+ _: (name, value) => ({ name: value }),
4182
+ });
4183
+ };
4184
+ const serializeAws_restJson1RuleMatch = (input, context) => {
4185
+ return RuleMatch.visit(input, {
4186
+ httpMatch: (value) => ({ httpMatch: serializeAws_restJson1HttpMatch(value, context) }),
4187
+ _: (name, value) => ({ name: value }),
4188
+ });
4189
+ };
4190
+ const serializeAws_restJson1RuleUpdate = (input, context) => {
4191
+ return {
4192
+ ...(input.action != null && { action: serializeAws_restJson1RuleAction(input.action, context) }),
4193
+ ...(input.match != null && { match: serializeAws_restJson1RuleMatch(input.match, context) }),
4194
+ ...(input.priority != null && { priority: input.priority }),
4195
+ ...(input.ruleIdentifier != null && { ruleIdentifier: input.ruleIdentifier }),
4196
+ };
4197
+ };
4198
+ const serializeAws_restJson1RuleUpdateList = (input, context) => {
4199
+ return input
4200
+ .filter((e) => e != null)
4201
+ .map((entry) => {
4202
+ return serializeAws_restJson1RuleUpdate(entry, context);
4203
+ });
4204
+ };
4205
+ const serializeAws_restJson1SecurityGroupList = (input, context) => {
4206
+ return input
4207
+ .filter((e) => e != null)
4208
+ .map((entry) => {
4209
+ return entry;
4210
+ });
4211
+ };
4212
+ const serializeAws_restJson1TagMap = (input, context) => {
4213
+ return Object.entries(input).reduce((acc, [key, value]) => {
4214
+ if (value === null) {
4215
+ return acc;
4216
+ }
4217
+ acc[key] = value;
4218
+ return acc;
4219
+ }, {});
4220
+ };
4221
+ const serializeAws_restJson1Target = (input, context) => {
4222
+ return {
4223
+ ...(input.id != null && { id: input.id }),
4224
+ ...(input.port != null && { port: input.port }),
4225
+ };
4226
+ };
4227
+ const serializeAws_restJson1TargetGroupConfig = (input, context) => {
4228
+ return {
4229
+ ...(input.healthCheck != null && {
4230
+ healthCheck: serializeAws_restJson1HealthCheckConfig(input.healthCheck, context),
4231
+ }),
4232
+ ...(input.ipAddressType != null && { ipAddressType: input.ipAddressType }),
4233
+ ...(input.port != null && { port: input.port }),
4234
+ ...(input.protocol != null && { protocol: input.protocol }),
4235
+ ...(input.protocolVersion != null && { protocolVersion: input.protocolVersion }),
4236
+ ...(input.vpcIdentifier != null && { vpcIdentifier: input.vpcIdentifier }),
4237
+ };
4238
+ };
4239
+ const serializeAws_restJson1TargetList = (input, context) => {
4240
+ return input
4241
+ .filter((e) => e != null)
4242
+ .map((entry) => {
4243
+ return serializeAws_restJson1Target(entry, context);
4244
+ });
4245
+ };
4246
+ const serializeAws_restJson1WeightedTargetGroup = (input, context) => {
4247
+ return {
4248
+ ...(input.targetGroupIdentifier != null && { targetGroupIdentifier: input.targetGroupIdentifier }),
4249
+ ...(input.weight != null && { weight: input.weight }),
4250
+ };
4251
+ };
4252
+ const serializeAws_restJson1WeightedTargetGroupList = (input, context) => {
4253
+ return input
4254
+ .filter((e) => e != null)
4255
+ .map((entry) => {
4256
+ return serializeAws_restJson1WeightedTargetGroup(entry, context);
4257
+ });
4258
+ };
4259
+ const deserializeAws_restJson1AccessLogSubscriptionList = (output, context) => {
4260
+ const retVal = (output || [])
4261
+ .filter((e) => e != null)
4262
+ .map((entry) => {
4263
+ if (entry === null) {
4264
+ return null;
4265
+ }
4266
+ return deserializeAws_restJson1AccessLogSubscriptionSummary(entry, context);
4267
+ });
4268
+ return retVal;
4269
+ };
4270
+ const deserializeAws_restJson1AccessLogSubscriptionSummary = (output, context) => {
4271
+ return {
4272
+ arn: __expectString(output.arn),
4273
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4274
+ destinationArn: __expectString(output.destinationArn),
4275
+ id: __expectString(output.id),
4276
+ lastUpdatedAt: output.lastUpdatedAt != null
4277
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4278
+ : undefined,
4279
+ resourceArn: __expectString(output.resourceArn),
4280
+ resourceId: __expectString(output.resourceId),
4281
+ };
4282
+ };
4283
+ const deserializeAws_restJson1DnsEntry = (output, context) => {
4284
+ return {
4285
+ domainName: __expectString(output.domainName),
4286
+ hostedZoneId: __expectString(output.hostedZoneId),
4287
+ };
4288
+ };
4289
+ const deserializeAws_restJson1FixedResponseAction = (output, context) => {
4290
+ return {
4291
+ statusCode: __expectInt32(output.statusCode),
4292
+ };
4293
+ };
4294
+ const deserializeAws_restJson1ForwardAction = (output, context) => {
4295
+ return {
4296
+ targetGroups: output.targetGroups != null
4297
+ ? deserializeAws_restJson1WeightedTargetGroupList(output.targetGroups, context)
4298
+ : undefined,
4299
+ };
4300
+ };
4301
+ const deserializeAws_restJson1HeaderMatch = (output, context) => {
4302
+ return {
4303
+ caseSensitive: __expectBoolean(output.caseSensitive),
4304
+ match: output.match != null ? deserializeAws_restJson1HeaderMatchType(__expectUnion(output.match), context) : undefined,
4305
+ name: __expectString(output.name),
4306
+ };
4307
+ };
4308
+ const deserializeAws_restJson1HeaderMatchList = (output, context) => {
4309
+ const retVal = (output || [])
4310
+ .filter((e) => e != null)
4311
+ .map((entry) => {
4312
+ if (entry === null) {
4313
+ return null;
4314
+ }
4315
+ return deserializeAws_restJson1HeaderMatch(entry, context);
4316
+ });
4317
+ return retVal;
4318
+ };
4319
+ const deserializeAws_restJson1HeaderMatchType = (output, context) => {
4320
+ if (__expectString(output.contains) !== undefined) {
4321
+ return { contains: __expectString(output.contains) };
4322
+ }
4323
+ if (__expectString(output.exact) !== undefined) {
4324
+ return { exact: __expectString(output.exact) };
4325
+ }
4326
+ if (__expectString(output.prefix) !== undefined) {
4327
+ return { prefix: __expectString(output.prefix) };
4328
+ }
4329
+ return { $unknown: Object.entries(output)[0] };
4330
+ };
4331
+ const deserializeAws_restJson1HealthCheckConfig = (output, context) => {
4332
+ return {
4333
+ enabled: __expectBoolean(output.enabled),
4334
+ healthCheckIntervalSeconds: __expectInt32(output.healthCheckIntervalSeconds),
4335
+ healthCheckTimeoutSeconds: __expectInt32(output.healthCheckTimeoutSeconds),
4336
+ healthyThresholdCount: __expectInt32(output.healthyThresholdCount),
4337
+ matcher: output.matcher != null ? deserializeAws_restJson1Matcher(__expectUnion(output.matcher), context) : undefined,
4338
+ path: __expectString(output.path),
4339
+ port: __expectInt32(output.port),
4340
+ protocol: __expectString(output.protocol),
4341
+ protocolVersion: __expectString(output.protocolVersion),
4342
+ unhealthyThresholdCount: __expectInt32(output.unhealthyThresholdCount),
4343
+ };
4344
+ };
4345
+ const deserializeAws_restJson1HttpMatch = (output, context) => {
4346
+ return {
4347
+ headerMatches: output.headerMatches != null ? deserializeAws_restJson1HeaderMatchList(output.headerMatches, context) : undefined,
4348
+ method: __expectString(output.method),
4349
+ pathMatch: output.pathMatch != null ? deserializeAws_restJson1PathMatch(output.pathMatch, context) : undefined,
4350
+ };
4351
+ };
4352
+ const deserializeAws_restJson1ListenerSummary = (output, context) => {
4353
+ return {
4354
+ arn: __expectString(output.arn),
4355
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4356
+ id: __expectString(output.id),
4357
+ lastUpdatedAt: output.lastUpdatedAt != null
4358
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4359
+ : undefined,
4360
+ name: __expectString(output.name),
4361
+ port: __expectInt32(output.port),
4362
+ protocol: __expectString(output.protocol),
4363
+ };
4364
+ };
4365
+ const deserializeAws_restJson1ListenerSummaryList = (output, context) => {
4366
+ const retVal = (output || [])
4367
+ .filter((e) => e != null)
4368
+ .map((entry) => {
4369
+ if (entry === null) {
4370
+ return null;
4371
+ }
4372
+ return deserializeAws_restJson1ListenerSummary(entry, context);
4373
+ });
4374
+ return retVal;
4375
+ };
4376
+ const deserializeAws_restJson1Matcher = (output, context) => {
4377
+ if (__expectString(output.httpCode) !== undefined) {
4378
+ return { httpCode: __expectString(output.httpCode) };
4379
+ }
4380
+ return { $unknown: Object.entries(output)[0] };
4381
+ };
4382
+ const deserializeAws_restJson1PathMatch = (output, context) => {
4383
+ return {
4384
+ caseSensitive: __expectBoolean(output.caseSensitive),
4385
+ match: output.match != null ? deserializeAws_restJson1PathMatchType(__expectUnion(output.match), context) : undefined,
4386
+ };
4387
+ };
4388
+ const deserializeAws_restJson1PathMatchType = (output, context) => {
4389
+ if (__expectString(output.exact) !== undefined) {
4390
+ return { exact: __expectString(output.exact) };
4391
+ }
4392
+ if (__expectString(output.prefix) !== undefined) {
4393
+ return { prefix: __expectString(output.prefix) };
4394
+ }
4395
+ return { $unknown: Object.entries(output)[0] };
4396
+ };
4397
+ const deserializeAws_restJson1RuleAction = (output, context) => {
4398
+ if (output.fixedResponse != null) {
4399
+ return {
4400
+ fixedResponse: deserializeAws_restJson1FixedResponseAction(output.fixedResponse, context),
4401
+ };
4402
+ }
4403
+ if (output.forward != null) {
4404
+ return {
4405
+ forward: deserializeAws_restJson1ForwardAction(output.forward, context),
4406
+ };
4407
+ }
4408
+ return { $unknown: Object.entries(output)[0] };
4409
+ };
4410
+ const deserializeAws_restJson1RuleMatch = (output, context) => {
4411
+ if (output.httpMatch != null) {
4412
+ return {
4413
+ httpMatch: deserializeAws_restJson1HttpMatch(output.httpMatch, context),
4414
+ };
4415
+ }
4416
+ return { $unknown: Object.entries(output)[0] };
4417
+ };
4418
+ const deserializeAws_restJson1RuleSummary = (output, context) => {
4419
+ return {
4420
+ arn: __expectString(output.arn),
4421
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4422
+ id: __expectString(output.id),
4423
+ isDefault: __expectBoolean(output.isDefault),
4424
+ lastUpdatedAt: output.lastUpdatedAt != null
4425
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4426
+ : undefined,
4427
+ name: __expectString(output.name),
4428
+ priority: __expectInt32(output.priority),
4429
+ };
4430
+ };
4431
+ const deserializeAws_restJson1RuleSummaryList = (output, context) => {
4432
+ const retVal = (output || [])
4433
+ .filter((e) => e != null)
4434
+ .map((entry) => {
4435
+ if (entry === null) {
4436
+ return null;
4437
+ }
4438
+ return deserializeAws_restJson1RuleSummary(entry, context);
4439
+ });
4440
+ return retVal;
4441
+ };
4442
+ const deserializeAws_restJson1RuleUpdateFailure = (output, context) => {
4443
+ return {
4444
+ failureCode: __expectString(output.failureCode),
4445
+ failureMessage: __expectString(output.failureMessage),
4446
+ ruleIdentifier: __expectString(output.ruleIdentifier),
4447
+ };
4448
+ };
4449
+ const deserializeAws_restJson1RuleUpdateFailureList = (output, context) => {
4450
+ const retVal = (output || [])
4451
+ .filter((e) => e != null)
4452
+ .map((entry) => {
4453
+ if (entry === null) {
4454
+ return null;
4455
+ }
4456
+ return deserializeAws_restJson1RuleUpdateFailure(entry, context);
4457
+ });
4458
+ return retVal;
4459
+ };
4460
+ const deserializeAws_restJson1RuleUpdateSuccess = (output, context) => {
4461
+ return {
4462
+ action: output.action != null ? deserializeAws_restJson1RuleAction(__expectUnion(output.action), context) : undefined,
4463
+ arn: __expectString(output.arn),
4464
+ id: __expectString(output.id),
4465
+ isDefault: __expectBoolean(output.isDefault),
4466
+ match: output.match != null ? deserializeAws_restJson1RuleMatch(__expectUnion(output.match), context) : undefined,
4467
+ name: __expectString(output.name),
4468
+ priority: __expectInt32(output.priority),
4469
+ };
4470
+ };
4471
+ const deserializeAws_restJson1RuleUpdateSuccessList = (output, context) => {
4472
+ const retVal = (output || [])
4473
+ .filter((e) => e != null)
4474
+ .map((entry) => {
4475
+ if (entry === null) {
4476
+ return null;
4477
+ }
4478
+ return deserializeAws_restJson1RuleUpdateSuccess(entry, context);
4479
+ });
4480
+ return retVal;
4481
+ };
4482
+ const deserializeAws_restJson1SecurityGroupList = (output, context) => {
4483
+ const retVal = (output || [])
4484
+ .filter((e) => e != null)
4485
+ .map((entry) => {
4486
+ if (entry === null) {
4487
+ return null;
4488
+ }
4489
+ return __expectString(entry);
4490
+ });
4491
+ return retVal;
4492
+ };
4493
+ const deserializeAws_restJson1ServiceArnList = (output, context) => {
4494
+ const retVal = (output || [])
4495
+ .filter((e) => e != null)
4496
+ .map((entry) => {
4497
+ if (entry === null) {
4498
+ return null;
4499
+ }
4500
+ return __expectString(entry);
4501
+ });
4502
+ return retVal;
4503
+ };
4504
+ const deserializeAws_restJson1ServiceList = (output, context) => {
4505
+ const retVal = (output || [])
4506
+ .filter((e) => e != null)
4507
+ .map((entry) => {
4508
+ if (entry === null) {
4509
+ return null;
4510
+ }
4511
+ return deserializeAws_restJson1ServiceSummary(entry, context);
4512
+ });
4513
+ return retVal;
4514
+ };
4515
+ const deserializeAws_restJson1ServiceNetworkList = (output, context) => {
4516
+ const retVal = (output || [])
4517
+ .filter((e) => e != null)
4518
+ .map((entry) => {
4519
+ if (entry === null) {
4520
+ return null;
4521
+ }
4522
+ return deserializeAws_restJson1ServiceNetworkSummary(entry, context);
4523
+ });
4524
+ return retVal;
4525
+ };
4526
+ const deserializeAws_restJson1ServiceNetworkServiceAssociationList = (output, context) => {
4527
+ const retVal = (output || [])
4528
+ .filter((e) => e != null)
4529
+ .map((entry) => {
4530
+ if (entry === null) {
4531
+ return null;
4532
+ }
4533
+ return deserializeAws_restJson1ServiceNetworkServiceAssociationSummary(entry, context);
4534
+ });
4535
+ return retVal;
4536
+ };
4537
+ const deserializeAws_restJson1ServiceNetworkServiceAssociationSummary = (output, context) => {
4538
+ return {
4539
+ arn: __expectString(output.arn),
4540
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4541
+ createdBy: __expectString(output.createdBy),
4542
+ customDomainName: __expectString(output.customDomainName),
4543
+ dnsEntry: output.dnsEntry != null ? deserializeAws_restJson1DnsEntry(output.dnsEntry, context) : undefined,
4544
+ id: __expectString(output.id),
4545
+ serviceArn: __expectString(output.serviceArn),
4546
+ serviceId: __expectString(output.serviceId),
4547
+ serviceName: __expectString(output.serviceName),
4548
+ serviceNetworkArn: __expectString(output.serviceNetworkArn),
4549
+ serviceNetworkId: __expectString(output.serviceNetworkId),
4550
+ serviceNetworkName: __expectString(output.serviceNetworkName),
4551
+ status: __expectString(output.status),
4552
+ };
4553
+ };
4554
+ const deserializeAws_restJson1ServiceNetworkSummary = (output, context) => {
4555
+ return {
4556
+ arn: __expectString(output.arn),
4557
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4558
+ id: __expectString(output.id),
4559
+ lastUpdatedAt: output.lastUpdatedAt != null
4560
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4561
+ : undefined,
4562
+ name: __expectString(output.name),
4563
+ numberOfAssociatedServices: __expectLong(output.numberOfAssociatedServices),
4564
+ numberOfAssociatedVPCs: __expectLong(output.numberOfAssociatedVPCs),
4565
+ };
4566
+ };
4567
+ const deserializeAws_restJson1ServiceNetworkVpcAssociationList = (output, context) => {
4568
+ const retVal = (output || [])
4569
+ .filter((e) => e != null)
4570
+ .map((entry) => {
4571
+ if (entry === null) {
4572
+ return null;
4573
+ }
4574
+ return deserializeAws_restJson1ServiceNetworkVpcAssociationSummary(entry, context);
4575
+ });
4576
+ return retVal;
4577
+ };
4578
+ const deserializeAws_restJson1ServiceNetworkVpcAssociationSummary = (output, context) => {
4579
+ return {
4580
+ arn: __expectString(output.arn),
4581
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4582
+ createdBy: __expectString(output.createdBy),
4583
+ id: __expectString(output.id),
4584
+ lastUpdatedAt: output.lastUpdatedAt != null
4585
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4586
+ : undefined,
4587
+ serviceNetworkArn: __expectString(output.serviceNetworkArn),
4588
+ serviceNetworkId: __expectString(output.serviceNetworkId),
4589
+ serviceNetworkName: __expectString(output.serviceNetworkName),
4590
+ status: __expectString(output.status),
4591
+ vpcId: __expectString(output.vpcId),
4592
+ };
4593
+ };
4594
+ const deserializeAws_restJson1ServiceSummary = (output, context) => {
4595
+ return {
4596
+ arn: __expectString(output.arn),
4597
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4598
+ customDomainName: __expectString(output.customDomainName),
4599
+ dnsEntry: output.dnsEntry != null ? deserializeAws_restJson1DnsEntry(output.dnsEntry, context) : undefined,
4600
+ id: __expectString(output.id),
4601
+ lastUpdatedAt: output.lastUpdatedAt != null
4602
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4603
+ : undefined,
4604
+ name: __expectString(output.name),
4605
+ status: __expectString(output.status),
4606
+ };
4607
+ };
4608
+ const deserializeAws_restJson1TagMap = (output, context) => {
4609
+ return Object.entries(output).reduce((acc, [key, value]) => {
4610
+ if (value === null) {
4611
+ return acc;
4612
+ }
4613
+ acc[key] = __expectString(value);
4614
+ return acc;
4615
+ }, {});
4616
+ };
4617
+ const deserializeAws_restJson1Target = (output, context) => {
4618
+ return {
4619
+ id: __expectString(output.id),
4620
+ port: __expectInt32(output.port),
4621
+ };
4622
+ };
4623
+ const deserializeAws_restJson1TargetFailure = (output, context) => {
4624
+ return {
4625
+ failureCode: __expectString(output.failureCode),
4626
+ failureMessage: __expectString(output.failureMessage),
4627
+ id: __expectString(output.id),
4628
+ port: __expectInt32(output.port),
4629
+ };
4630
+ };
4631
+ const deserializeAws_restJson1TargetFailureList = (output, context) => {
4632
+ const retVal = (output || [])
4633
+ .filter((e) => e != null)
4634
+ .map((entry) => {
4635
+ if (entry === null) {
4636
+ return null;
4637
+ }
4638
+ return deserializeAws_restJson1TargetFailure(entry, context);
4639
+ });
4640
+ return retVal;
4641
+ };
4642
+ const deserializeAws_restJson1TargetGroupConfig = (output, context) => {
4643
+ return {
4644
+ healthCheck: output.healthCheck != null ? deserializeAws_restJson1HealthCheckConfig(output.healthCheck, context) : undefined,
4645
+ ipAddressType: __expectString(output.ipAddressType),
4646
+ port: __expectInt32(output.port),
4647
+ protocol: __expectString(output.protocol),
4648
+ protocolVersion: __expectString(output.protocolVersion),
4649
+ vpcIdentifier: __expectString(output.vpcIdentifier),
4650
+ };
4651
+ };
4652
+ const deserializeAws_restJson1TargetGroupList = (output, context) => {
4653
+ const retVal = (output || [])
4654
+ .filter((e) => e != null)
4655
+ .map((entry) => {
4656
+ if (entry === null) {
4657
+ return null;
4658
+ }
4659
+ return deserializeAws_restJson1TargetGroupSummary(entry, context);
4660
+ });
4661
+ return retVal;
4662
+ };
4663
+ const deserializeAws_restJson1TargetGroupSummary = (output, context) => {
4664
+ return {
4665
+ arn: __expectString(output.arn),
4666
+ createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.createdAt)) : undefined,
4667
+ id: __expectString(output.id),
4668
+ ipAddressType: __expectString(output.ipAddressType),
4669
+ lastUpdatedAt: output.lastUpdatedAt != null
4670
+ ? __expectNonNull(__parseRfc3339DateTimeWithOffset(output.lastUpdatedAt))
4671
+ : undefined,
4672
+ name: __expectString(output.name),
4673
+ port: __expectInt32(output.port),
4674
+ protocol: __expectString(output.protocol),
4675
+ serviceArns: output.serviceArns != null ? deserializeAws_restJson1ServiceArnList(output.serviceArns, context) : undefined,
4676
+ status: __expectString(output.status),
4677
+ type: __expectString(output.type),
4678
+ vpcIdentifier: __expectString(output.vpcIdentifier),
4679
+ };
4680
+ };
4681
+ const deserializeAws_restJson1TargetList = (output, context) => {
4682
+ const retVal = (output || [])
4683
+ .filter((e) => e != null)
4684
+ .map((entry) => {
4685
+ if (entry === null) {
4686
+ return null;
4687
+ }
4688
+ return deserializeAws_restJson1Target(entry, context);
4689
+ });
4690
+ return retVal;
4691
+ };
4692
+ const deserializeAws_restJson1TargetSummary = (output, context) => {
4693
+ return {
4694
+ id: __expectString(output.id),
4695
+ port: __expectInt32(output.port),
4696
+ reasonCode: __expectString(output.reasonCode),
4697
+ status: __expectString(output.status),
4698
+ };
4699
+ };
4700
+ const deserializeAws_restJson1TargetSummaryList = (output, context) => {
4701
+ const retVal = (output || [])
4702
+ .filter((e) => e != null)
4703
+ .map((entry) => {
4704
+ if (entry === null) {
4705
+ return null;
4706
+ }
4707
+ return deserializeAws_restJson1TargetSummary(entry, context);
4708
+ });
4709
+ return retVal;
4710
+ };
4711
+ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
4712
+ return {
4713
+ message: __expectString(output.message),
4714
+ name: __expectString(output.name),
4715
+ };
4716
+ };
4717
+ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
4718
+ const retVal = (output || [])
4719
+ .filter((e) => e != null)
4720
+ .map((entry) => {
4721
+ if (entry === null) {
4722
+ return null;
4723
+ }
4724
+ return deserializeAws_restJson1ValidationExceptionField(entry, context);
4725
+ });
4726
+ return retVal;
4727
+ };
4728
+ const deserializeAws_restJson1WeightedTargetGroup = (output, context) => {
4729
+ return {
4730
+ targetGroupIdentifier: __expectString(output.targetGroupIdentifier),
4731
+ weight: __expectInt32(output.weight),
4732
+ };
4733
+ };
4734
+ const deserializeAws_restJson1WeightedTargetGroupList = (output, context) => {
4735
+ const retVal = (output || [])
4736
+ .filter((e) => e != null)
4737
+ .map((entry) => {
4738
+ if (entry === null) {
4739
+ return null;
4740
+ }
4741
+ return deserializeAws_restJson1WeightedTargetGroup(entry, context);
4742
+ });
4743
+ return retVal;
4744
+ };
4745
+ const deserializeMetadata = (output) => ({
4746
+ httpStatusCode: output.statusCode,
4747
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
4748
+ extendedRequestId: output.headers["x-amz-id-2"],
4749
+ cfId: output.headers["x-amz-cf-id"],
4750
+ });
4751
+ const collectBody = (streamBody = new Uint8Array(), context) => {
4752
+ if (streamBody instanceof Uint8Array) {
4753
+ return Promise.resolve(streamBody);
4754
+ }
4755
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4756
+ };
4757
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4758
+ const isSerializableHeaderValue = (value) => value !== undefined &&
4759
+ value !== null &&
4760
+ value !== "" &&
4761
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
4762
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
4763
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
4764
+ if (encoded.length) {
4765
+ return JSON.parse(encoded);
4766
+ }
4767
+ return {};
4768
+ });
4769
+ const parseErrorBody = async (errorBody, context) => {
4770
+ const value = await parseBody(errorBody, context);
4771
+ value.message = value.message ?? value.Message;
4772
+ return value;
4773
+ };
4774
+ const loadRestJsonErrorCode = (output, data) => {
4775
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
4776
+ const sanitizeErrorCode = (rawValue) => {
4777
+ let cleanValue = rawValue;
4778
+ if (typeof cleanValue === "number") {
4779
+ cleanValue = cleanValue.toString();
4780
+ }
4781
+ if (cleanValue.indexOf(",") >= 0) {
4782
+ cleanValue = cleanValue.split(",")[0];
4783
+ }
4784
+ if (cleanValue.indexOf(":") >= 0) {
4785
+ cleanValue = cleanValue.split(":")[0];
4786
+ }
4787
+ if (cleanValue.indexOf("#") >= 0) {
4788
+ cleanValue = cleanValue.split("#")[1];
4789
+ }
4790
+ return cleanValue;
4791
+ };
4792
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
4793
+ if (headerKey !== undefined) {
4794
+ return sanitizeErrorCode(output.headers[headerKey]);
4795
+ }
4796
+ if (data.code !== undefined) {
4797
+ return sanitizeErrorCode(data.code);
4798
+ }
4799
+ if (data["__type"] !== undefined) {
4800
+ return sanitizeErrorCode(data["__type"]);
4801
+ }
4802
+ };