aws-sdk-core 2.4.0 → 3.53.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (487) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -0
  3. data/ca-bundle.crt +3615 -3541
  4. data/lib/aws-sdk-core.rb +96 -408
  5. data/lib/aws-sdk-core/async_client_stubs.rb +80 -0
  6. data/lib/aws-sdk-core/binary.rb +6 -0
  7. data/lib/aws-sdk-core/binary/decode_handler.rb +56 -0
  8. data/lib/aws-sdk-core/binary/encode_handler.rb +32 -0
  9. data/lib/aws-sdk-core/binary/event_builder.rb +122 -0
  10. data/lib/aws-sdk-core/binary/event_parser.rb +134 -0
  11. data/lib/aws-sdk-core/binary/event_stream_decoder.rb +62 -0
  12. data/lib/aws-sdk-core/binary/event_stream_encoder.rb +53 -0
  13. data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +41 -0
  14. data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +197 -0
  15. data/lib/aws-sdk-core/client_stubs.rb +73 -10
  16. data/lib/aws-sdk-core/credential_provider.rb +2 -0
  17. data/lib/aws-sdk-core/credential_provider_chain.rb +22 -5
  18. data/lib/aws-sdk-core/ecs_credentials.rb +3 -3
  19. data/lib/aws-sdk-core/endpoint_cache.rb +188 -0
  20. data/lib/aws-sdk-core/errors.rb +174 -10
  21. data/lib/aws-sdk-core/event_emitter.rb +62 -0
  22. data/lib/aws-sdk-core/ini_parser.rb +1 -0
  23. data/lib/aws-sdk-core/instance_profile_credentials.rb +21 -12
  24. data/lib/aws-sdk-core/json.rb +4 -5
  25. data/lib/aws-sdk-core/json/builder.rb +4 -2
  26. data/lib/aws-sdk-core/json/error_handler.rb +19 -2
  27. data/lib/aws-sdk-core/json/handler.rb +22 -3
  28. data/lib/aws-sdk-core/json/parser.rb +1 -1
  29. data/lib/aws-sdk-core/log/param_filter.rb +4 -3
  30. data/lib/aws-sdk-core/pageable_response.rb +1 -0
  31. data/lib/aws-sdk-core/pager.rb +30 -25
  32. data/lib/aws-sdk-core/param_converter.rb +3 -3
  33. data/lib/aws-sdk-core/param_validator.rb +56 -21
  34. data/lib/aws-sdk-core/plugins/api_key.rb +52 -0
  35. data/lib/aws-sdk-core/plugins/apig_authorizer_token.rb +30 -0
  36. data/lib/aws-sdk-core/plugins/apig_credentials_configuration.rb +34 -0
  37. data/lib/aws-sdk-core/plugins/apig_user_agent.rb +37 -0
  38. data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +256 -0
  39. data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +84 -0
  40. data/lib/aws-sdk-core/plugins/credentials_configuration.rb +62 -0
  41. data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +160 -0
  42. data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +63 -0
  43. data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +30 -0
  44. data/lib/aws-sdk-core/plugins/global_configuration.rb +19 -10
  45. data/lib/aws-sdk-core/plugins/helpful_socket_errors.rb +41 -0
  46. data/lib/aws-sdk-core/plugins/idempotency_token.rb +36 -0
  47. data/lib/aws-sdk-core/plugins/invocation_id.rb +33 -0
  48. data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +29 -0
  49. data/lib/aws-sdk-core/plugins/logging.rb +18 -18
  50. data/lib/aws-sdk-core/plugins/param_converter.rb +9 -5
  51. data/lib/aws-sdk-core/plugins/param_validator.rb +8 -5
  52. data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +10 -0
  53. data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -1
  54. data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +13 -12
  55. data/lib/aws-sdk-core/plugins/protocols/query.rb +2 -2
  56. data/lib/aws-sdk-core/plugins/regional_endpoint.rb +28 -16
  57. data/lib/aws-sdk-core/plugins/response_paging.rb +5 -18
  58. data/lib/aws-sdk-core/plugins/retry_errors.rb +97 -23
  59. data/lib/aws-sdk-core/plugins/signature_v2.rb +51 -0
  60. data/lib/aws-sdk-core/plugins/signature_v4.rb +141 -0
  61. data/lib/aws-sdk-core/plugins/stub_responses.rb +35 -18
  62. data/lib/aws-sdk-core/plugins/transfer_encoding.rb +53 -0
  63. data/lib/aws-sdk-core/plugins/user_agent.rb +23 -6
  64. data/lib/aws-sdk-core/process_credentials.rb +76 -0
  65. data/lib/aws-sdk-core/query.rb +5 -0
  66. data/lib/aws-sdk-core/query/ec2_param_builder.rb +9 -3
  67. data/lib/aws-sdk-core/query/handler.rb +20 -16
  68. data/lib/aws-sdk-core/query/param_builder.rb +10 -4
  69. data/lib/aws-sdk-core/refreshing_credentials.rb +1 -1
  70. data/lib/aws-sdk-core/resources/collection.rb +121 -0
  71. data/lib/aws-sdk-core/rest.rb +10 -0
  72. data/lib/aws-sdk-core/rest/handler.rb +1 -0
  73. data/lib/aws-sdk-core/rest/request/builder.rb +2 -1
  74. data/lib/aws-sdk-core/rest/request/endpoint.rb +11 -66
  75. data/lib/aws-sdk-core/rest/request/headers.rb +20 -1
  76. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +103 -0
  77. data/lib/aws-sdk-core/rest/response/body.rb +14 -1
  78. data/lib/aws-sdk-core/rest/response/headers.rb +9 -0
  79. data/lib/aws-sdk-core/rest/response/parser.rb +18 -14
  80. data/lib/aws-sdk-core/shared_config.rb +132 -18
  81. data/lib/aws-sdk-core/shared_credentials.rb +2 -0
  82. data/lib/aws-sdk-core/structure.rb +21 -11
  83. data/lib/aws-sdk-core/stubbing/data_applicator.rb +1 -1
  84. data/lib/aws-sdk-core/stubbing/empty_stub.rb +10 -3
  85. data/lib/aws-sdk-core/stubbing/protocols/api_gateway.rb +8 -0
  86. data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +1 -1
  87. data/lib/aws-sdk-core/stubbing/protocols/rest.rb +99 -1
  88. data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +5 -1
  89. data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +9 -5
  90. data/lib/aws-sdk-core/stubbing/stub_data.rb +16 -3
  91. data/lib/aws-sdk-core/util.rb +66 -0
  92. data/lib/aws-sdk-core/waiters.rb +3 -0
  93. data/lib/aws-sdk-core/waiters/poller.rb +5 -7
  94. data/lib/aws-sdk-core/waiters/waiter.rb +1 -0
  95. data/lib/aws-sdk-core/xml.rb +9 -0
  96. data/lib/aws-sdk-core/xml/builder.rb +11 -5
  97. data/lib/aws-sdk-core/xml/error_handler.rb +27 -5
  98. data/lib/aws-sdk-core/xml/parser.rb +1 -11
  99. data/lib/aws-sdk-core/xml/parser/engines/ox.rb +5 -1
  100. data/lib/aws-sdk-core/xml/parser/frame.rb +6 -6
  101. data/lib/aws-sdk-sts.rb +45 -0
  102. data/lib/aws-sdk-sts/client.rb +1761 -0
  103. data/lib/aws-sdk-sts/client_api.rb +304 -0
  104. data/lib/aws-sdk-sts/customizations.rb +0 -0
  105. data/lib/aws-sdk-sts/errors.rb +142 -0
  106. data/lib/aws-sdk-sts/resource.rb +23 -0
  107. data/lib/aws-sdk-sts/types.rb +1279 -0
  108. data/lib/seahorse.rb +60 -60
  109. data/lib/seahorse/client/async_base.rb +50 -0
  110. data/lib/seahorse/client/async_response.rb +62 -0
  111. data/lib/seahorse/client/base.rb +2 -8
  112. data/lib/seahorse/client/configuration.rb +9 -1
  113. data/lib/seahorse/client/h2/connection.rb +244 -0
  114. data/lib/seahorse/client/h2/handler.rb +151 -0
  115. data/lib/seahorse/client/http/async_response.rb +42 -0
  116. data/lib/seahorse/client/http/response.rb +10 -5
  117. data/lib/seahorse/client/logging/formatter.rb +5 -1
  118. data/lib/seahorse/client/logging/handler.rb +2 -0
  119. data/lib/seahorse/client/net_http/connection_pool.rb +27 -11
  120. data/lib/seahorse/client/net_http/handler.rb +10 -2
  121. data/lib/seahorse/client/net_http/patches.rb +9 -1
  122. data/lib/seahorse/client/networking_error.rb +28 -0
  123. data/lib/seahorse/client/plugin.rb +66 -6
  124. data/lib/seahorse/client/plugin_list.rb +3 -1
  125. data/lib/seahorse/client/plugins/content_length.rb +7 -2
  126. data/lib/seahorse/client/plugins/endpoint.rb +14 -10
  127. data/lib/seahorse/client/plugins/h2.rb +64 -0
  128. data/lib/seahorse/client/plugins/logging.rb +17 -19
  129. data/lib/seahorse/client/plugins/net_http.rb +23 -15
  130. data/lib/seahorse/client/plugins/raise_response_errors.rb +4 -4
  131. data/lib/seahorse/client/plugins/response_target.rb +10 -1
  132. data/lib/seahorse/client/request_context.rb +5 -0
  133. data/lib/seahorse/client/response.rb +9 -20
  134. data/lib/seahorse/model/api.rb +37 -0
  135. data/lib/seahorse/model/authorizer.rb +21 -0
  136. data/lib/seahorse/model/operation.rb +20 -0
  137. data/lib/seahorse/model/shapes.rb +44 -2
  138. data/lib/seahorse/util.rb +1 -21
  139. metadata +112 -359
  140. data/apis/acm/2015-12-08/api-2.json +0 -495
  141. data/apis/acm/2015-12-08/examples-1.json +0 -5
  142. data/apis/acm/2015-12-08/paginators-1.json +0 -10
  143. data/apis/apigateway/2015-07-09/api-2.json +0 -3347
  144. data/apis/apigateway/2015-07-09/examples-1.json +0 -5
  145. data/apis/apigateway/2015-07-09/paginators-1.json +0 -52
  146. data/apis/application-autoscaling/2016-02-06/api-2.json +0 -502
  147. data/apis/application-autoscaling/2016-02-06/examples-1.json +0 -5
  148. data/apis/application-autoscaling/2016-02-06/paginators-1.json +0 -22
  149. data/apis/autoscaling/2011-01-01/api-2.json +0 -2038
  150. data/apis/autoscaling/2011-01-01/examples-1.json +0 -5
  151. data/apis/autoscaling/2011-01-01/paginators-1.json +0 -52
  152. data/apis/autoscaling/2011-01-01/resources-1.json +0 -1613
  153. data/apis/autoscaling/2011-01-01/waiters-2.json +0 -62
  154. data/apis/cloudformation/2010-05-15/api-2.json +0 -1299
  155. data/apis/cloudformation/2010-05-15/examples-1.json +0 -5
  156. data/apis/cloudformation/2010-05-15/paginators-1.json +0 -27
  157. data/apis/cloudformation/2010-05-15/resources-1.json +0 -202
  158. data/apis/cloudformation/2010-05-15/waiters-2.json +0 -235
  159. data/apis/cloudfront/2016-01-28/api-2.json +0 -2218
  160. data/apis/cloudfront/2016-01-28/examples-1.json +0 -5
  161. data/apis/cloudfront/2016-01-28/paginators-1.json +0 -32
  162. data/apis/cloudfront/2016-01-28/waiters-2.json +0 -47
  163. data/apis/cloudhsm/2014-05-30/api-2.json +0 -877
  164. data/apis/cloudhsm/2014-05-30/examples-1.json +0 -5
  165. data/apis/cloudsearch/2013-01-01/api-2.json +0 -2001
  166. data/apis/cloudsearch/2013-01-01/paginators-1.json +0 -20
  167. data/apis/cloudsearchdomain/2013-01-01/api-2.json +0 -373
  168. data/apis/cloudsearchdomain/2013-01-01/examples-1.json +0 -5
  169. data/apis/cloudtrail/2013-11-01/api-2.json +0 -801
  170. data/apis/cloudtrail/2013-11-01/examples-1.json +0 -5
  171. data/apis/cloudtrail/2013-11-01/paginators-1.json +0 -7
  172. data/apis/codecommit/2015-04-13/api-2.json +0 -916
  173. data/apis/codecommit/2015-04-13/examples-1.json +0 -5
  174. data/apis/codecommit/2015-04-13/paginators-1.json +0 -14
  175. data/apis/codedeploy/2014-10-06/api-2.json +0 -1954
  176. data/apis/codedeploy/2014-10-06/examples-1.json +0 -5
  177. data/apis/codedeploy/2014-10-06/paginators-1.json +0 -34
  178. data/apis/codepipeline/2015-07-09/api-2.json +0 -1633
  179. data/apis/codepipeline/2015-07-09/examples-1.json +0 -902
  180. data/apis/cognito-identity/2014-06-30/api-2.json +0 -859
  181. data/apis/cognito-identity/2014-06-30/examples-1.json +0 -5
  182. data/apis/cognito-idp/2016-04-18/api-2.json +0 -1657
  183. data/apis/cognito-idp/2016-04-18/examples-1.json +0 -5
  184. data/apis/cognito-sync/2014-06-30/api-2.json +0 -1874
  185. data/apis/config/2014-11-12/api-2.json +0 -1303
  186. data/apis/config/2014-11-12/examples-1.json +0 -5
  187. data/apis/config/2014-11-12/paginators-1.json +0 -10
  188. data/apis/datapipeline/2012-10-29/api-2.json +0 -1167
  189. data/apis/datapipeline/2012-10-29/paginators-1.json +0 -26
  190. data/apis/devicefarm/2015-06-23/api-2.json +0 -2030
  191. data/apis/devicefarm/2015-06-23/examples-1.json +0 -5
  192. data/apis/devicefarm/2015-06-23/paginators-1.json +0 -74
  193. data/apis/directconnect/2012-10-25/api-2.json +0 -793
  194. data/apis/directconnect/2012-10-25/examples-1.json +0 -5
  195. data/apis/directconnect/2012-10-25/paginators-1.json +0 -22
  196. data/apis/discovery/2015-11-01/api-2.json +0 -556
  197. data/apis/discovery/2015-11-01/examples-1.json +0 -5
  198. data/apis/dms/2016-01-01/api-2.json +0 -1469
  199. data/apis/dms/2016-01-01/examples-1.json +0 -5
  200. data/apis/ds/2015-04-16/api-2.json +0 -1674
  201. data/apis/ds/2015-04-16/examples-1.json +0 -5
  202. data/apis/dynamodb/2012-08-10/api-2.json +0 -1200
  203. data/apis/dynamodb/2012-08-10/examples-1.json +0 -5
  204. data/apis/dynamodb/2012-08-10/paginators-1.json +0 -26
  205. data/apis/dynamodb/2012-08-10/resources-1.json +0 -136
  206. data/apis/dynamodb/2012-08-10/waiters-2.json +0 -35
  207. data/apis/ec2/2015-10-01/api-2.json +0 -13759
  208. data/apis/ec2/2015-10-01/examples-1.json +0 -5
  209. data/apis/ec2/2015-10-01/paginators-1.json +0 -138
  210. data/apis/ec2/2015-10-01/resources-1.json +0 -2582
  211. data/apis/ec2/2015-10-01/waiters-2.json +0 -593
  212. data/apis/ec2/2016-04-01/api-2.json +0 -13842
  213. data/apis/ec2/2016-04-01/examples-1.json +0 -5
  214. data/apis/ec2/2016-04-01/paginators-1.json +0 -138
  215. data/apis/ec2/2016-04-01/resources-1.json +0 -2582
  216. data/apis/ec2/2016-04-01/waiters-2.json +0 -593
  217. data/apis/ecr/2015-09-21/api-2.json +0 -849
  218. data/apis/ecr/2015-09-21/examples-1.json +0 -5
  219. data/apis/ecs/2014-11-13/api-2.json +0 -1396
  220. data/apis/ecs/2014-11-13/examples-1.json +0 -5
  221. data/apis/ecs/2014-11-13/paginators-1.json +0 -40
  222. data/apis/ecs/2014-11-13/waiters-2.json +0 -93
  223. data/apis/elasticache/2015-02-02/api-2.json +0 -2426
  224. data/apis/elasticache/2015-02-02/examples-1.json +0 -5
  225. data/apis/elasticache/2015-02-02/paginators-1.json +0 -76
  226. data/apis/elasticache/2015-02-02/waiters-2.json +0 -143
  227. data/apis/elasticbeanstalk/2010-12-01/api-2.json +0 -1894
  228. data/apis/elasticbeanstalk/2010-12-01/examples-1.json +0 -1109
  229. data/apis/elasticbeanstalk/2010-12-01/paginators-1.json +0 -25
  230. data/apis/elasticfilesystem/2015-02-01/api-2.json +0 -713
  231. data/apis/elasticfilesystem/2015-02-01/examples-1.json +0 -5
  232. data/apis/elasticloadbalancing/2012-06-01/api-2.json +0 -2145
  233. data/apis/elasticloadbalancing/2012-06-01/paginators-1.json +0 -18
  234. data/apis/elasticloadbalancing/2012-06-01/waiters-2.json +0 -49
  235. data/apis/elasticmapreduce/2009-03-31/api-2.json +0 -1341
  236. data/apis/elasticmapreduce/2009-03-31/examples-1.json +0 -5
  237. data/apis/elasticmapreduce/2009-03-31/paginators-1.json +0 -32
  238. data/apis/elasticmapreduce/2009-03-31/waiters-2.json +0 -67
  239. data/apis/elastictranscoder/2012-09-25/api-2.json +0 -1807
  240. data/apis/elastictranscoder/2012-09-25/paginators-1.json +0 -24
  241. data/apis/elastictranscoder/2012-09-25/waiters-2.json +0 -30
  242. data/apis/email/2010-12-01/api-2.json +0 -1791
  243. data/apis/email/2010-12-01/examples-1.json +0 -5
  244. data/apis/email/2010-12-01/paginators-1.json +0 -13
  245. data/apis/email/2010-12-01/waiters-2.json +0 -18
  246. data/apis/es/2015-01-01/api-2.json +0 -764
  247. data/apis/events/2015-10-07/api-2.json +0 -643
  248. data/apis/events/2015-10-07/examples-1.json +0 -5
  249. data/apis/firehose/2015-08-04/api-2.json +0 -719
  250. data/apis/gamelift/2015-10-01/api-2.json +0 -2307
  251. data/apis/gamelift/2015-10-01/examples-1.json +0 -5
  252. data/apis/glacier/2012-06-01/api-2.json +0 -2144
  253. data/apis/glacier/2012-06-01/paginators-1.json +0 -28
  254. data/apis/glacier/2012-06-01/resources-1.json +0 -563
  255. data/apis/glacier/2012-06-01/waiters-2.json +0 -39
  256. data/apis/iam/2010-05-08/api-2.json +0 -4514
  257. data/apis/iam/2010-05-08/examples-1.json +0 -5
  258. data/apis/iam/2010-05-08/paginators-1.json +0 -198
  259. data/apis/iam/2010-05-08/resources-1.json +0 -1740
  260. data/apis/iam/2010-05-08/waiters-2.json +0 -39
  261. data/apis/importexport/2010-06-01/api-2.json +0 -666
  262. data/apis/importexport/2010-06-01/paginators-1.json +0 -11
  263. data/apis/inspector/2016-02-16/api-2.json +0 -1964
  264. data/apis/inspector/2016-02-16/examples-1.json +0 -5
  265. data/apis/iot-data/2015-05-28/api-2.json +0 -263
  266. data/apis/iot/2015-05-28/api-2.json +0 -3800
  267. data/apis/iot/2015-05-28/examples-1.json +0 -5
  268. data/apis/kinesis/2013-12-02/api-2.json +0 -822
  269. data/apis/kinesis/2013-12-02/examples-1.json +0 -5
  270. data/apis/kinesis/2013-12-02/paginators-1.json +0 -18
  271. data/apis/kinesis/2013-12-02/waiters-2.json +0 -18
  272. data/apis/kms/2014-11-01/api-2.json +0 -1209
  273. data/apis/kms/2014-11-01/examples-1.json +0 -5
  274. data/apis/kms/2014-11-01/paginators-1.json +0 -32
  275. data/apis/lambda/2014-11-11/api-2.json +0 -667
  276. data/apis/lambda/2014-11-11/paginators-1.json +0 -16
  277. data/apis/lambda/2015-03-31/api-2.json +0 -1342
  278. data/apis/lambda/2015-03-31/examples-1.json +0 -5
  279. data/apis/lambda/2015-03-31/paginators-1.json +0 -16
  280. data/apis/logs/2014-03-28/api-2.json +0 -1138
  281. data/apis/logs/2014-03-28/examples-1.json +0 -5
  282. data/apis/logs/2014-03-28/paginators-1.json +0 -49
  283. data/apis/machinelearning/2014-12-12/api-2.json +0 -1947
  284. data/apis/machinelearning/2014-12-12/paginators-1.json +0 -28
  285. data/apis/machinelearning/2014-12-12/waiters-2.json +0 -81
  286. data/apis/marketplacecommerceanalytics/2015-07-01/api-2.json +0 -120
  287. data/apis/marketplacecommerceanalytics/2015-07-01/examples-1.json +0 -5
  288. data/apis/meteringmarketplace/2016-01-14/api-2.json +0 -127
  289. data/apis/meteringmarketplace/2016-01-14/examples-1.json +0 -5
  290. data/apis/monitoring/2010-08-01/api-2.json +0 -790
  291. data/apis/monitoring/2010-08-01/examples-1.json +0 -5
  292. data/apis/monitoring/2010-08-01/paginators-1.json +0 -24
  293. data/apis/monitoring/2010-08-01/resources-1.json +0 -346
  294. data/apis/monitoring/2010-08-01/waiters-2.json +0 -18
  295. data/apis/opsworks/2013-02-18/api-2.json +0 -2606
  296. data/apis/opsworks/2013-02-18/examples-1.json +0 -5
  297. data/apis/opsworks/2013-02-18/paginators-1.json +0 -55
  298. data/apis/opsworks/2013-02-18/resources-1.json +0 -173
  299. data/apis/opsworks/2013-02-18/waiters-2.json +0 -295
  300. data/apis/rds/2014-10-31/api-2.json +0 -4757
  301. data/apis/rds/2014-10-31/examples-1.json +0 -5
  302. data/apis/rds/2014-10-31/paginators-1.json +0 -110
  303. data/apis/rds/2014-10-31/resources-1.json +0 -3272
  304. data/apis/rds/2014-10-31/waiters-2.json +0 -102
  305. data/apis/redshift/2012-12-01/api-2.json +0 -3768
  306. data/apis/redshift/2012-12-01/examples-1.json +0 -5
  307. data/apis/redshift/2012-12-01/paginators-1.json +0 -94
  308. data/apis/redshift/2012-12-01/waiters-2.json +0 -97
  309. data/apis/route53/2013-04-01/api-2.json +0 -3245
  310. data/apis/route53/2013-04-01/examples-1.json +0 -5
  311. data/apis/route53/2013-04-01/paginators-1.json +0 -33
  312. data/apis/route53/2013-04-01/waiters-2.json +0 -18
  313. data/apis/route53domains/2014-05-15/api-2.json +0 -1197
  314. data/apis/route53domains/2014-05-15/paginators-1.json +0 -17
  315. data/apis/s3/2006-03-01/api-2.json +0 -4517
  316. data/apis/s3/2006-03-01/examples-1.json +0 -5
  317. data/apis/s3/2006-03-01/paginators-1.json +0 -66
  318. data/apis/s3/2006-03-01/resources-1.json +0 -1176
  319. data/apis/s3/2006-03-01/waiters-2.json +0 -73
  320. data/apis/sdb/2009-04-15/api-2.json +0 -954
  321. data/apis/sdb/2009-04-15/paginators-1.json +0 -15
  322. data/apis/servicecatalog/2015-12-10/api-2.json +0 -749
  323. data/apis/servicecatalog/2015-12-10/examples-1.json +0 -5
  324. data/apis/sns/2010-03-31/api-2.json +0 -1139
  325. data/apis/sns/2010-03-31/paginators-1.json +0 -29
  326. data/apis/sns/2010-03-31/resources-1.json +0 -327
  327. data/apis/sqs/2012-11-05/api-2.json +0 -950
  328. data/apis/sqs/2012-11-05/examples-1.json +0 -44
  329. data/apis/sqs/2012-11-05/paginators-1.json +0 -7
  330. data/apis/ssm/2014-11-06/api-2.json +0 -1796
  331. data/apis/ssm/2014-11-06/examples-1.json +0 -5
  332. data/apis/ssm/2014-11-06/paginators-1.json +0 -34
  333. data/apis/storagegateway/2013-06-30/api-2.json +0 -2275
  334. data/apis/storagegateway/2013-06-30/examples-1.json +0 -5
  335. data/apis/storagegateway/2013-06-30/paginators-1.json +0 -52
  336. data/apis/streams.dynamodb/2012-08-10/api-2.json +0 -397
  337. data/apis/streams.dynamodb/2012-08-10/examples-1.json +0 -5
  338. data/apis/sts/2011-06-15/api-2.json +0 -521
  339. data/apis/sts/2011-06-15/examples-1.json +0 -5
  340. data/apis/support/2013-04-15/api-2.json +0 -869
  341. data/apis/support/2013-04-15/paginators-1.json +0 -25
  342. data/apis/swf/2012-01-25/api-2.json +0 -2838
  343. data/apis/swf/2012-01-25/paginators-1.json +0 -46
  344. data/apis/waf/2015-08-24/api-2.json +0 -1959
  345. data/apis/waf/2015-08-24/examples-1.json +0 -5
  346. data/apis/workspaces/2015-04-08/api-2.json +0 -632
  347. data/apis/workspaces/2015-04-08/examples-1.json +0 -5
  348. data/apis/workspaces/2015-04-08/paginators-1.json +0 -20
  349. data/bin/aws.rb +0 -180
  350. data/endpoints.json +0 -1460
  351. data/lib/aws-sdk-core/acm.rb +0 -6
  352. data/lib/aws-sdk-core/api/builder.rb +0 -106
  353. data/lib/aws-sdk-core/api/customizations.rb +0 -217
  354. data/lib/aws-sdk-core/api/docs/builder.rb +0 -220
  355. data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +0 -109
  356. data/lib/aws-sdk-core/api/docs/docstring_provider.rb +0 -75
  357. data/lib/aws-sdk-core/api/docs/operation_documenter.rb +0 -138
  358. data/lib/aws-sdk-core/api/docs/param_formatter.rb +0 -163
  359. data/lib/aws-sdk-core/api/docs/request_syntax_example.rb +0 -22
  360. data/lib/aws-sdk-core/api/docs/response_structure_example.rb +0 -91
  361. data/lib/aws-sdk-core/api/docs/shared_example.rb +0 -100
  362. data/lib/aws-sdk-core/api/docs/utils.rb +0 -133
  363. data/lib/aws-sdk-core/api/shape_map.rb +0 -142
  364. data/lib/aws-sdk-core/apigateway.rb +0 -6
  365. data/lib/aws-sdk-core/applicationautoscaling.rb +0 -6
  366. data/lib/aws-sdk-core/applicationdiscoveryservice.rb +0 -5
  367. data/lib/aws-sdk-core/autoscaling.rb +0 -8
  368. data/lib/aws-sdk-core/checksums.rb +0 -51
  369. data/lib/aws-sdk-core/client.rb +0 -57
  370. data/lib/aws-sdk-core/client_waiters.rb +0 -120
  371. data/lib/aws-sdk-core/cloudformation.rb +0 -8
  372. data/lib/aws-sdk-core/cloudfront.rb +0 -15
  373. data/lib/aws-sdk-core/cloudfront/url_signer.rb +0 -167
  374. data/lib/aws-sdk-core/cloudhsm.rb +0 -5
  375. data/lib/aws-sdk-core/cloudsearch.rb +0 -5
  376. data/lib/aws-sdk-core/cloudsearchdomain.rb +0 -5
  377. data/lib/aws-sdk-core/cloudtrail.rb +0 -6
  378. data/lib/aws-sdk-core/cloudwatch.rb +0 -8
  379. data/lib/aws-sdk-core/cloudwatchevents.rb +0 -5
  380. data/lib/aws-sdk-core/cloudwatchlogs.rb +0 -6
  381. data/lib/aws-sdk-core/codecommit.rb +0 -6
  382. data/lib/aws-sdk-core/codedeploy.rb +0 -6
  383. data/lib/aws-sdk-core/codepipeline.rb +0 -5
  384. data/lib/aws-sdk-core/cognitoidentity.rb +0 -5
  385. data/lib/aws-sdk-core/cognitoidentityprovider.rb +0 -5
  386. data/lib/aws-sdk-core/cognitosync.rb +0 -4
  387. data/lib/aws-sdk-core/configservice.rb +0 -6
  388. data/lib/aws-sdk-core/databasemigrationservice.rb +0 -5
  389. data/lib/aws-sdk-core/datapipeline.rb +0 -5
  390. data/lib/aws-sdk-core/devicefarm.rb +0 -6
  391. data/lib/aws-sdk-core/directconnect.rb +0 -6
  392. data/lib/aws-sdk-core/directoryservice.rb +0 -5
  393. data/lib/aws-sdk-core/dynamodb.rb +0 -40
  394. data/lib/aws-sdk-core/dynamodb/attribute_value.rb +0 -108
  395. data/lib/aws-sdk-core/dynamodbstreams.rb +0 -5
  396. data/lib/aws-sdk-core/ec2.rb +0 -8
  397. data/lib/aws-sdk-core/ecr.rb +0 -5
  398. data/lib/aws-sdk-core/ecs.rb +0 -7
  399. data/lib/aws-sdk-core/efs.rb +0 -5
  400. data/lib/aws-sdk-core/elasticache.rb +0 -7
  401. data/lib/aws-sdk-core/elasticbeanstalk.rb +0 -6
  402. data/lib/aws-sdk-core/elasticloadbalancing.rb +0 -6
  403. data/lib/aws-sdk-core/elasticsearchservice.rb +0 -4
  404. data/lib/aws-sdk-core/elastictranscoder.rb +0 -6
  405. data/lib/aws-sdk-core/empty_structure.rb +0 -3
  406. data/lib/aws-sdk-core/emr.rb +0 -7
  407. data/lib/aws-sdk-core/endpoint_provider.rb +0 -95
  408. data/lib/aws-sdk-core/firehose.rb +0 -4
  409. data/lib/aws-sdk-core/gamelift.rb +0 -5
  410. data/lib/aws-sdk-core/glacier.rb +0 -7
  411. data/lib/aws-sdk-core/iam.rb +0 -8
  412. data/lib/aws-sdk-core/importexport.rb +0 -5
  413. data/lib/aws-sdk-core/inspector.rb +0 -5
  414. data/lib/aws-sdk-core/iot.rb +0 -5
  415. data/lib/aws-sdk-core/iotdataplane.rb +0 -4
  416. data/lib/aws-sdk-core/kinesis.rb +0 -7
  417. data/lib/aws-sdk-core/kms.rb +0 -6
  418. data/lib/aws-sdk-core/lambda.rb +0 -6
  419. data/lib/aws-sdk-core/lambdapreview.rb +0 -5
  420. data/lib/aws-sdk-core/machinelearning.rb +0 -6
  421. data/lib/aws-sdk-core/marketplacecommerceanalytics.rb +0 -5
  422. data/lib/aws-sdk-core/marketplacemetering.rb +0 -5
  423. data/lib/aws-sdk-core/opsworks.rb +0 -8
  424. data/lib/aws-sdk-core/partitions.rb +0 -174
  425. data/lib/aws-sdk-core/partitions/partition.rb +0 -95
  426. data/lib/aws-sdk-core/partitions/partition_list.rb +0 -60
  427. data/lib/aws-sdk-core/partitions/region.rb +0 -78
  428. data/lib/aws-sdk-core/partitions/service.rb +0 -84
  429. data/lib/aws-sdk-core/plugins/api_gateway_header.rb +0 -19
  430. data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +0 -30
  431. data/lib/aws-sdk-core/plugins/dynamodb_crc32_validation.rb +0 -52
  432. data/lib/aws-sdk-core/plugins/dynamodb_extended_retries.rb +0 -22
  433. data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +0 -209
  434. data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +0 -87
  435. data/lib/aws-sdk-core/plugins/ec2_region_validation.rb +0 -17
  436. data/lib/aws-sdk-core/plugins/glacier_account_id.rb +0 -19
  437. data/lib/aws-sdk-core/plugins/glacier_api_version.rb +0 -19
  438. data/lib/aws-sdk-core/plugins/glacier_checksums.rb +0 -87
  439. data/lib/aws-sdk-core/plugins/machine_learning_predict_endpoint.rb +0 -20
  440. data/lib/aws-sdk-core/plugins/request_signer.rb +0 -138
  441. data/lib/aws-sdk-core/plugins/route_53_id_fix.rb +0 -55
  442. data/lib/aws-sdk-core/plugins/s3_accelerate.rb +0 -73
  443. data/lib/aws-sdk-core/plugins/s3_bucket_dns.rb +0 -86
  444. data/lib/aws-sdk-core/plugins/s3_bucket_name_restrictions.rb +0 -21
  445. data/lib/aws-sdk-core/plugins/s3_expect_100_continue.rb +0 -27
  446. data/lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb +0 -21
  447. data/lib/aws-sdk-core/plugins/s3_http_200_errors.rb +0 -45
  448. data/lib/aws-sdk-core/plugins/s3_location_constraint.rb +0 -31
  449. data/lib/aws-sdk-core/plugins/s3_md5s.rb +0 -50
  450. data/lib/aws-sdk-core/plugins/s3_redirects.rb +0 -37
  451. data/lib/aws-sdk-core/plugins/s3_request_signer.rb +0 -166
  452. data/lib/aws-sdk-core/plugins/s3_sse_cpk.rb +0 -64
  453. data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +0 -92
  454. data/lib/aws-sdk-core/plugins/sqs_md5s.rb +0 -162
  455. data/lib/aws-sdk-core/plugins/sqs_queue_urls.rb +0 -34
  456. data/lib/aws-sdk-core/plugins/swf_read_timeouts.rb +0 -23
  457. data/lib/aws-sdk-core/rds.rb +0 -8
  458. data/lib/aws-sdk-core/redshift.rb +0 -7
  459. data/lib/aws-sdk-core/route53.rb +0 -7
  460. data/lib/aws-sdk-core/route53domains.rb +0 -5
  461. data/lib/aws-sdk-core/s3.rb +0 -26
  462. data/lib/aws-sdk-core/s3/bucket_region_cache.rb +0 -75
  463. data/lib/aws-sdk-core/s3/presigner.rb +0 -113
  464. data/lib/aws-sdk-core/service.rb +0 -4
  465. data/lib/aws-sdk-core/servicecatalog.rb +0 -5
  466. data/lib/aws-sdk-core/ses.rb +0 -7
  467. data/lib/aws-sdk-core/signers/base.rb +0 -31
  468. data/lib/aws-sdk-core/signers/s3.rb +0 -184
  469. data/lib/aws-sdk-core/signers/v2.rb +0 -51
  470. data/lib/aws-sdk-core/signers/v3.rb +0 -34
  471. data/lib/aws-sdk-core/signers/v4.rb +0 -233
  472. data/lib/aws-sdk-core/simpledb.rb +0 -5
  473. data/lib/aws-sdk-core/sns.rb +0 -6
  474. data/lib/aws-sdk-core/sqs.rb +0 -6
  475. data/lib/aws-sdk-core/ssm.rb +0 -6
  476. data/lib/aws-sdk-core/storagegateway.rb +0 -6
  477. data/lib/aws-sdk-core/sts.rb +0 -5
  478. data/lib/aws-sdk-core/support.rb +0 -5
  479. data/lib/aws-sdk-core/swf.rb +0 -5
  480. data/lib/aws-sdk-core/tree_hash.rb +0 -69
  481. data/lib/aws-sdk-core/version.rb +0 -3
  482. data/lib/aws-sdk-core/waf.rb +0 -5
  483. data/lib/aws-sdk-core/waiters/null_provider.rb +0 -12
  484. data/lib/aws-sdk-core/waiters/provider.rb +0 -35
  485. data/lib/aws-sdk-core/workspaces.rb +0 -6
  486. data/lib/seahorse/client/plugins/restful_bindings.rb +0 -127
  487. data/service-models.json +0 -285
@@ -1,78 +0,0 @@
1
- require 'set'
2
-
3
- module Aws
4
- module Partitions
5
- class Region
6
-
7
- # @option options [required, String] :name
8
- # @option options [required, String] :description
9
- # @option options [required, String] :partition_name
10
- # @option options [required, Set<String>] :services
11
- # @api private
12
- def initialize(options = {})
13
- @name = options[:name]
14
- @description = options[:description]
15
- @partition_name = options[:partition_name]
16
- @services = options[:services]
17
- end
18
-
19
- # @return [String] The name of this region, e.g. "us-east-1".
20
- attr_reader :name
21
-
22
- # @return [String] A short description of this region.
23
- attr_reader :description
24
-
25
- # @return [String] The partition this region exists in, e.g. "aws",
26
- # "aws-cn", "aws-us-gov".
27
- attr_reader :partition_name
28
-
29
- # @return [Set<String>] The list of services available in this region.
30
- # Service names are the module names as used by the AWS SDK
31
- # for Ruby.
32
- attr_reader :services
33
-
34
- class << self
35
-
36
- # @api private
37
- def build(region_name, region, partition)
38
- Region.new(
39
- name: region_name,
40
- description: region['description'],
41
- partition_name: partition['partition'],
42
- services: region_services(region_name, partition)
43
- )
44
- end
45
-
46
- private
47
-
48
- def region_services(region_name, partition)
49
- Partitions.service_ids.inject(Set.new) do |services, (svc_name, svc_id)|
50
- if svc = partition['services'][svc_id]
51
- services << svc_name if service_in_region?(svc, region_name)
52
- else
53
- #raise "missing endpoints for #{svc_name} / #{svc_id}"
54
- end
55
- services
56
- end
57
- end
58
-
59
- def service_in_region?(svc, region_name)
60
- svc_endpoints_contains_region?(svc, region_name) ||
61
- svc_partition_endpoint_matches_region?(svc, region_name)
62
- end
63
-
64
- def svc_endpoints_contains_region?(svc, region_name)
65
- svc['endpoints'].key?(region_name)
66
- end
67
-
68
- def svc_partition_endpoint_matches_region?(svc, region_name)
69
- if pe = svc['partitionEndpoint']
70
- region = svc['endpoints'][pe].fetch('credentialScope', {})['region']
71
- region == region_name
72
- end
73
- end
74
-
75
- end
76
- end
77
- end
78
- end
@@ -1,84 +0,0 @@
1
- require 'set'
2
-
3
- module Aws
4
- module Partitions
5
- class Service
6
-
7
- # @option options [required, String] :name
8
- # @option options [required, String] :partition_name
9
- # @option options [required, Set<String>] :region_name
10
- # @option options [required, Boolean] :regionalized
11
- # @option options [String] :partition_region
12
- # @api private
13
- def initialize(options = {})
14
- @name = options[:name]
15
- @partition_name = options[:partition_name]
16
- @regions = options[:regions]
17
- @regionalized = options[:regionalized]
18
- @partition_region = options[:partition_region]
19
- @regions << @partition_region if !@regionalized
20
- end
21
-
22
- # @return [String] The name of this service. The name is the module
23
- # name as used by the AWS SDK for Ruby.
24
- attr_reader :name
25
-
26
- # @return [String] The partition name, e.g "aws", "aws-cn", "aws-us-gov".
27
- attr_reader :partition_name
28
-
29
- # @return [Set<String>] The regions this service is available in.
30
- # Regions are scoped to the partition.
31
- attr_reader :regions
32
-
33
- # @return [String,nil] The global patition endpoint for this service.
34
- # May be `nil`.
35
- attr_reader :partition_region
36
-
37
- # Returns `false` if the service operates with a single global
38
- # endpoint for the current partition, returns `true` if the service
39
- # is available in mutliple regions.
40
- #
41
- # Some services have both a partition endpoint and regional endpoints.
42
- #
43
- # @return [Boolean]
44
- def regionalized?
45
- @regionalized
46
- end
47
-
48
- class << self
49
-
50
- # @api private
51
- def build(service_name, service, partition)
52
- Service.new(
53
- name: service_name,
54
- partition_name: partition['partition'],
55
- regions: regions(service, partition),
56
- regionalized: service['isRegionalized'] != false,
57
- partition_region: partition_region(service)
58
- )
59
- end
60
-
61
- private
62
-
63
- def regions(service, partition)
64
- names = Set.new(partition['regions'].keys & service['endpoints'].keys)
65
- names - ["#{partition['partition']}-global"]
66
- end
67
-
68
- def partition_region(service)
69
- if service['partitionEndpoint']
70
- endpoint = service['endpoints'][service['partitionEndpoint']]
71
- if endpoint['credentialScope']
72
- endpoint['credentialScope']['region']
73
- elsif service['defaults'] && service['defaults']['credentialScope']
74
- service['defaults']['credentialScope']['region']
75
- else
76
- service['partitionEndpoint']
77
- end
78
- end
79
- end
80
-
81
- end
82
- end
83
- end
84
- end
@@ -1,19 +0,0 @@
1
- module Aws
2
- module Plugins
3
- # @api private
4
- class APIGatewayHeader < Seahorse::Client::Plugin
5
-
6
- class Handler < Seahorse::Client::Handler
7
-
8
- def call(context)
9
- context.http_request.headers['Accept'] = 'application/json'
10
- @handler.call(context)
11
- end
12
-
13
- end
14
-
15
- handler(Handler)
16
-
17
- end
18
- end
19
- end
@@ -1,30 +0,0 @@
1
- module Aws
2
- module Plugins
3
-
4
- # Makes it possible to conditional sign {Aws::CloudSearchDomain::Client}
5
- # requests. When credentials are configured, requests are signed.
6
- # When they are omitted, the request is sent anonymously.
7
- #
8
- # @seahorse.client.option [String] :sigv4_region Only needed when sending
9
- # authenticated/signed requests to a Cloud Search domain and the
10
- # endpoint does not contain the region name.
11
- #
12
- class CSDConditionalSigning < Seahorse::Client::Plugin
13
-
14
- # Adding region as an option to avoid an issue when `Aws.config[:region]`
15
- # is populated and the global configuration plugin merges options onto
16
- # this client.
17
- option(:region)
18
-
19
- option(:sigv4_region) do |cfg|
20
- # extract the region name from the cloud search domain endpoint
21
- if cfg.endpoint
22
- cfg.endpoint.to_s.split('.')[1]
23
- else
24
- raise ArgumentError, 'missing required option :endpoint'
25
- end
26
- end
27
-
28
- end
29
- end
30
- end
@@ -1,52 +0,0 @@
1
- module Aws
2
- module Plugins
3
-
4
- # @seahorse.client.option [Boolean] :compute_checksums (true)
5
- # When `true`, a CRC32 checksum is computed of every HTTP
6
- # response body and compared against the `X-Amz-Crc32` header.
7
- # If the checksums do not match, the request is re-sent.
8
- # Failures can be retried up to `:retry_limit` times.
9
- class DynamoDBCRC32Validation < Seahorse::Client::Plugin
10
-
11
- option(:compute_checksums, true)
12
-
13
- def add_handlers(handlers, config)
14
- if config.compute_checksums
15
- handlers.add(Handler, step: :sign)
16
- end
17
- end
18
-
19
- class Handler < Seahorse::Client::Handler
20
-
21
- def call(context)
22
- # disable response gzipping - Net::HTTP unzips these responses
23
- # before we can see the body, making it impossible to verify
24
- # the CRC32 checksum against the compressed body stream
25
- context.http_request.headers['accept-encoding'] = ''
26
-
27
- @handler.call(context).on_success do |response|
28
- response.error = validate(context)
29
- end
30
- end
31
-
32
- private
33
-
34
- def validate(context)
35
- unless crc32_is_valid?(context.http_response)
36
- msg = "Response failed CRC32 check."
37
- return Aws::DynamoDB::Errors::CRC32CheckFailed.new(context, msg)
38
- end
39
- end
40
-
41
- def crc32_is_valid?(response)
42
- if crc_checksum = response.headers['x-amz-crc32']
43
- crc_checksum.to_i == Zlib.crc32(response.body_contents)
44
- else
45
- true
46
- end
47
- end
48
-
49
- end
50
- end
51
- end
52
- end
@@ -1,22 +0,0 @@
1
- module Aws
2
- module Plugins
3
-
4
- # @seahorse.client.option [Integer] :retry_limit (10)
5
- # The maximum number of times to retry failed requests. Only
6
- # ~ 500 level server errors and certain ~ 400 level client errors
7
- # are retried. Generally, these are throttling errors, data
8
- # checksum errors, networking errors, timeout errors and auth
9
- # errors from expired credentials.
10
- class DynamoDBExtendedRetries < Seahorse::Client::Plugin
11
-
12
- option(:retry_limit, 10)
13
-
14
- option(:retry_backoff, lambda { |context|
15
- if context.retries > 1
16
- Kernel.sleep(50 * (2 ** (context.retries - 1)) / 1000.0)
17
- end
18
- })
19
-
20
- end
21
- end
22
- end
@@ -1,209 +0,0 @@
1
- module Aws
2
- module Plugins
3
-
4
- # Simplifies working with Amazon DynamoDB attribute values.
5
- # Translates attribute values for requests and responses to sensible
6
- # Ruby natives.
7
- #
8
- # This plugin is enabled by default for all {DynamoDB::Client}
9
- # objects. You can disable this plugin by passing
10
- # `simple_attributes: false` to the client constructor:
11
- #
12
- # ddb = Aws::DynamoDB::Client.new(simple_attributes: false)
13
- #
14
- # ## Input Examples
15
- #
16
- # With this plugin **enabled**, `simple_attributes: true`:
17
- #
18
- # dynamodb.put_item(
19
- # table_name: 'aws-sdk',
20
- # item: {
21
- # id: 'uuid',
22
- # age: 35,
23
- # tags: Set.new(%w(simple attributes)),
24
- # data: StringIO.new('data'),
25
- # scores: [5, 4.5, 4.9, nil],
26
- # name: {
27
- # first: 'John',
28
- # last: 'Doe',
29
- # }
30
- # }
31
- # )
32
- #
33
- # With this plugin **disabled**, `simple_attributes: false`:
34
- #
35
- # # note that all types are prefixed in a hash and that
36
- # # numeric types must be serialized as strings
37
- # dynamodb.put_item(
38
- # table_name: 'aws-sdk',
39
- # item: {
40
- # 'id' => { s: 'uuid' },
41
- # 'age' => { n: '35' },
42
- # 'tags' => { ss: ['simple', 'attributes'] },
43
- # 'data' => { b: 'data' },
44
- # 'scores' => {
45
- # l: [
46
- # { n: '5' },
47
- # { n: '4.5' },
48
- # { n: '4.9' },
49
- # { null: true },
50
- # ]
51
- # },
52
- # 'name' => {
53
- # m: {
54
- # 'first' => { s: 'John' },
55
- # 'last' => { s: 'Doe' },
56
- # }
57
- # }
58
- # }
59
- # )
60
- #
61
- # ## Output Examples
62
- #
63
- # With this plugin **enabled**, `simple_attributes: true`:
64
- #
65
- # resp = dynamodb.get(table_name: 'aws-sdk', key: { id: 'uuid' })
66
- # resp.item
67
- # {
68
- # id: 'uuid',
69
- # age: 35,
70
- # tags: Set.new(%w(simple attributes)),
71
- # data: StringIO.new('data'),
72
- # scores: [5, 4.5, 4.9, nil],
73
- # name: {
74
- # first: 'John',
75
- # last: 'Doe',
76
- # }
77
- # }
78
- #
79
- # With this plugin **disabled**, `simple_attributes: false`:
80
- #
81
- # # note that the request `:key` had to be type prefixed
82
- # resp = dynamodb.get(table_name: 'aws-sdk', key: { 'id' => { s: 'uuid' }})
83
- # resp.item
84
- # # {
85
- # # "id"=> <struct s='uuid', n=nil, b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=nil>
86
- # # "age"=> <struct s=nil, n="35", b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=nil>
87
- # # ...
88
- # # }
89
- #
90
- # @seahorse.client.option [Boolean] :simple_attributes (true)
91
- # Enables working with DynamoDB attribute values using
92
- # hashes, arrays, sets, integers, floats, booleans, and nil.
93
- #
94
- # Disabling this option requires that all attribute values have
95
- # their types specified, e.g. `{ s: 'abc' }` instead of simply
96
- # `'abc'`.
97
- #
98
- class DynamoDBSimpleAttributes < Seahorse::Client::Plugin
99
-
100
- option(:simple_attributes) { |config| !config.simple_json }
101
-
102
- def add_handlers(handlers, config)
103
- if config.simple_attributes
104
- handlers.add(Handler, step: :initialize)
105
- end
106
- end
107
-
108
- class Handler < Seahorse::Client::Handler
109
-
110
- def call(context)
111
- context.params = translate_input(context)
112
- @handler.call(context).on(200) do |response|
113
- response.data = translate_output(response)
114
- end
115
- end
116
-
117
- private
118
-
119
- def translate_input(context)
120
- if shape = context.operation.input
121
- ValueTranslator.new(shape, :marshal).apply(context.params)
122
- else
123
- context.params
124
- end
125
- end
126
-
127
- def translate_output(response)
128
- if shape = response.context.operation.output
129
- ValueTranslator.new(shape, :unmarshal).apply(response.data)
130
- else
131
- response.data
132
- end
133
- end
134
-
135
- end
136
-
137
- # @api private
138
- class ValueTranslator
139
-
140
- include Seahorse::Model::Shapes
141
-
142
- def self.apply(rules, mode, data)
143
- new(rules, mode).apply(data)
144
- end
145
-
146
- def initialize(rules, mode)
147
- @rules = rules
148
- @mode = mode
149
- end
150
-
151
- def apply(values)
152
- structure(@rules, values) if @rules
153
- end
154
-
155
- private
156
-
157
- def structure(ref, values)
158
- shape = ref.shape
159
- if values.is_a?(Struct)
160
- values.members.each do |key|
161
- values[key] = translate(shape.member(key), values[key])
162
- end
163
- values
164
- elsif values.is_a?(Hash)
165
- values.each.with_object({}) do |(key, value), hash|
166
- hash[key] = translate(shape.member(key), value)
167
- end
168
- else
169
- values
170
- end
171
- end
172
-
173
- def list(ref, values)
174
- return values unless values.is_a?(Array)
175
- member_ref = ref.shape.member
176
- values.inject([]) do |list, value|
177
- list << translate(member_ref, value)
178
- end
179
- end
180
-
181
- def map(ref, values)
182
- return values unless values.is_a?(Hash)
183
- value_ref = ref.shape.value
184
- values.each.with_object({}) do |(key, value), hash|
185
- hash[key] = translate(value_ref, value)
186
- end
187
- end
188
-
189
- def translate(ref, value)
190
- if ref.shape.name == 'AttributeValue'
191
- DynamoDB::AttributeValue.new.send(@mode, value)
192
- else
193
- translate_complex(ref, value)
194
- end
195
- end
196
-
197
- def translate_complex(ref, value)
198
- case ref.shape
199
- when StructureShape then structure(ref, value)
200
- when ListShape then list(ref, value)
201
- when MapShape then map(ref, value)
202
- else value
203
- end
204
- end
205
-
206
- end
207
- end
208
- end
209
- end