aws-sdk-core 2.0.0.rc14 → 2.0.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 (282) hide show
  1. checksums.yaml +4 -4
  2. data/apis/AutoScaling.api.json +1943 -0
  3. data/apis/CloudFormation.api.json +785 -0
  4. data/apis/CloudFront.api.json +2581 -0
  5. data/apis/CloudSearch.api.json +1955 -0
  6. data/apis/CloudSearchDomain.api.json +349 -0
  7. data/apis/CloudTrail.api.json +559 -0
  8. data/apis/CloudWatch.api.json +917 -0
  9. data/apis/CloudWatchLogs.api.json +816 -0
  10. data/apis/CognitoIdentity.api.json +631 -0
  11. data/apis/CognitoSync.api.json +721 -0
  12. data/apis/DataPipeline.api.json +940 -0
  13. data/apis/DirectConnect.api.json +833 -0
  14. data/apis/DynamoDB.api.json +1210 -0
  15. data/apis/{dynamodb-2012-08-10.paginators.json → DynamoDB.paginators.json} +0 -1
  16. data/apis/EC2.api.json +9914 -0
  17. data/apis/{ec2-2014-06-15.resources.json → EC2.resources.json} +16 -0
  18. data/apis/EMR.api.json +1339 -0
  19. data/apis/ElastiCache.api.json +3410 -0
  20. data/apis/ElasticBeanstalk.api.json +1543 -0
  21. data/apis/ElasticLoadBalancing.api.json +2131 -0
  22. data/apis/ElasticTranscoder.api.json +1647 -0
  23. data/apis/Glacier.api.json +1456 -0
  24. data/apis/{glacier-2012-06-01.resources.json → Glacier.resources.json} +5 -9
  25. data/apis/IAM.api.json +4033 -0
  26. data/apis/{iam-2010-05-08.resources.json → IAM.resources.json} +1 -1
  27. data/apis/ImportExport.api.json +515 -0
  28. data/apis/Kinesis.api.json +706 -0
  29. data/apis/{kinesis-2013-12-02.paginators.json → Kinesis.paginators.json} +0 -6
  30. data/apis/OpsWorks.api.json +2555 -0
  31. data/apis/OpsWorks.resources.json +181 -0
  32. data/apis/RDS.api.json +4473 -0
  33. data/apis/Redshift.api.json +4482 -0
  34. data/apis/Route53.api.json +1935 -0
  35. data/apis/Route53Domains.api.json +1129 -0
  36. data/apis/{s3-2006-03-01.api.json → S3.api.json} +336 -942
  37. data/apis/{s3-2006-03-01.paginators.json → S3.paginators.json} +1 -1
  38. data/apis/{s3-2006-03-01.resources.json → S3.resources.json} +13 -2
  39. data/apis/SES.api.json +644 -0
  40. data/apis/SNS.api.json +1760 -0
  41. data/apis/SQS.api.json +1113 -0
  42. data/apis/{sqs-2012-11-05.resources.json → SQS.resources.json} +0 -10
  43. data/apis/STS.api.json +594 -0
  44. data/apis/SWF.api.json +2656 -0
  45. data/apis/SimpleDB.api.json +954 -0
  46. data/apis/StorageGateway.api.json +2311 -0
  47. data/apis/Support.api.json +869 -0
  48. data/bin/aws.rb +19 -0
  49. data/lib/aws-sdk-core/api/docstrings.rb +35 -0
  50. data/lib/aws-sdk-core/api/documenter.rb +241 -0
  51. data/lib/{aws/api/documentor.rb → aws-sdk-core/api/operation_documenter.rb} +9 -5
  52. data/lib/{aws/api/doc_example.rb → aws-sdk-core/api/operation_example.rb} +8 -7
  53. data/lib/{aws → aws-sdk-core}/api/service_customizations.rb +3 -1
  54. data/lib/aws-sdk-core/autoscaling.rb +5 -0
  55. data/lib/aws-sdk-core/client.rb +121 -0
  56. data/lib/aws-sdk-core/cloudformation.rb +5 -0
  57. data/lib/aws-sdk-core/cloudfront.rb +6 -0
  58. data/lib/aws-sdk-core/cloudsearch.rb +5 -0
  59. data/lib/aws-sdk-core/cloudsearchdomain.rb +4 -0
  60. data/lib/aws-sdk-core/cloudtrail.rb +5 -0
  61. data/lib/aws-sdk-core/cloudwatch.rb +5 -0
  62. data/lib/aws-sdk-core/cloudwatchlogs.rb +5 -0
  63. data/lib/aws-sdk-core/cognitoidentity.rb +4 -0
  64. data/lib/aws-sdk-core/cognitosync.rb +4 -0
  65. data/lib/{aws → aws-sdk-core}/credential_provider_chain.rb +4 -1
  66. data/lib/aws-sdk-core/datapipeline.rb +5 -0
  67. data/lib/aws-sdk-core/directconnect.rb +5 -0
  68. data/lib/aws-sdk-core/dynamodb/attribute_value.rb +87 -0
  69. data/lib/aws-sdk-core/dynamodb.rb +12 -0
  70. data/lib/aws-sdk-core/ec2.rb +7 -0
  71. data/lib/aws-sdk-core/elasticache.rb +5 -0
  72. data/lib/aws-sdk-core/elasticbeanstalk.rb +5 -0
  73. data/lib/aws-sdk-core/elasticloadbalancing.rb +5 -0
  74. data/lib/aws-sdk-core/elastictranscoder.rb +5 -0
  75. data/lib/{aws → aws-sdk-core}/empty_structure.rb +4 -3
  76. data/lib/aws-sdk-core/emr.rb +5 -0
  77. data/lib/{aws → aws-sdk-core}/endpoint_provider.rb +1 -0
  78. data/lib/{aws → aws-sdk-core}/errors.rb +18 -7
  79. data/lib/aws-sdk-core/glacier.rb +7 -0
  80. data/lib/aws-sdk-core/iam.rb +6 -0
  81. data/lib/aws-sdk-core/importexport.rb +5 -0
  82. data/lib/{aws → aws-sdk-core}/instance_profile_credentials.rb +1 -1
  83. data/lib/aws-sdk-core/kinesis.rb +5 -0
  84. data/lib/aws-sdk-core/opsworks.rb +6 -0
  85. data/lib/{aws → aws-sdk-core}/pageable_response.rb +1 -1
  86. data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +37 -0
  87. data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +179 -0
  88. data/lib/{aws → aws-sdk-core}/plugins/global_configuration.rb +13 -3
  89. data/lib/{aws → aws-sdk-core}/plugins/protocols/json_rpc.rb +9 -7
  90. data/lib/{aws → aws-sdk-core}/plugins/regional_endpoint.rb +1 -1
  91. data/lib/{aws → aws-sdk-core}/plugins/request_signer.rb +13 -6
  92. data/lib/aws-sdk-core/plugins/response_paging.rb +25 -0
  93. data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +92 -0
  94. data/lib/{aws → aws-sdk-core}/plugins/user_agent.rb +1 -2
  95. data/lib/{aws → aws-sdk-core}/query/handler.rb +4 -5
  96. data/lib/aws-sdk-core/rds.rb +6 -0
  97. data/lib/aws-sdk-core/redshift.rb +6 -0
  98. data/lib/aws-sdk-core/route53.rb +5 -0
  99. data/lib/aws-sdk-core/route53domains.rb +4 -0
  100. data/lib/aws-sdk-core/s3/presigner.rb +64 -0
  101. data/lib/aws-sdk-core/s3.rb +13 -0
  102. data/lib/aws-sdk-core/service.rb +4 -0
  103. data/lib/aws-sdk-core/ses.rb +6 -0
  104. data/lib/{aws → aws-sdk-core}/signers/v4.rb +6 -5
  105. data/lib/aws-sdk-core/simpledb.rb +5 -0
  106. data/lib/aws-sdk-core/sns.rb +6 -0
  107. data/lib/aws-sdk-core/sqs.rb +6 -0
  108. data/lib/aws-sdk-core/storagegateway.rb +5 -0
  109. data/lib/{aws → aws-sdk-core}/structure.rb +49 -2
  110. data/lib/aws-sdk-core/sts.rb +4 -0
  111. data/lib/aws-sdk-core/support.rb +5 -0
  112. data/lib/aws-sdk-core/swf.rb +5 -0
  113. data/lib/aws-sdk-core/version.rb +3 -0
  114. data/lib/aws-sdk-core/waiters/errors.rb +30 -0
  115. data/lib/aws-sdk-core/waiters/null_provider.rb +12 -0
  116. data/lib/aws-sdk-core/waiters/provider.rb +54 -0
  117. data/lib/aws-sdk-core/waiters/waiter.rb +194 -0
  118. data/lib/{aws → aws-sdk-core}/xml/builder.rb +1 -0
  119. data/lib/aws-sdk-core/xml/default_list.rb +10 -0
  120. data/lib/{aws → aws-sdk-core}/xml/parser.rb +6 -1
  121. data/lib/aws-sdk-core.rb +288 -1
  122. data/lib/seahorse/client/base.rb +45 -20
  123. data/lib/seahorse/client/handler_list.rb +17 -3
  124. data/lib/seahorse/client/http/request.rb +0 -8
  125. data/lib/seahorse/client/param_converter.rb +2 -2
  126. data/lib/seahorse/client/plugins/restful_bindings.rb +1 -1
  127. data/lib/seahorse/client/request.rb +1 -1
  128. data/lib/seahorse/client/response.rb +0 -2
  129. data/lib/seahorse/client/xml/builder.rb +0 -1
  130. data/lib/seahorse/model/shape_map.rb +1 -0
  131. data/lib/seahorse/model/shapes.rb +11 -2
  132. data/lib/seahorse.rb +2 -3
  133. metadata +214 -187
  134. data/LICENSE.txt +0 -12
  135. data/README.md +0 -272
  136. data/apis/autoscaling-2011-01-01.api.json +0 -3063
  137. data/apis/cloudformation-2010-05-15.api.json +0 -1306
  138. data/apis/cloudfront-2014-01-31.api.json +0 -3478
  139. data/apis/cloudfront-2014-01-31.paginators.json +0 -32
  140. data/apis/cloudfront-2014-05-31.api.json +0 -3540
  141. data/apis/cloudfront-2014-05-31.waiters.json +0 -29
  142. data/apis/cloudsearch-2011-02-01.api.json +0 -2093
  143. data/apis/cloudsearch-2011-02-01.paginators.json +0 -13
  144. data/apis/cloudsearch-2013-01-01.api.json +0 -2655
  145. data/apis/cloudsearchdomain-2013-01-01.api.json +0 -508
  146. data/apis/cloudtrail-2013-11-01.api.json +0 -773
  147. data/apis/cognito-identity-2014-06-30.api.json +0 -884
  148. data/apis/cognito-sync-2014-06-30.api.json +0 -1029
  149. data/apis/datapipeline-2012-10-29.api.json +0 -1432
  150. data/apis/directconnect-2012-10-25.api.json +0 -1174
  151. data/apis/dynamodb-2011-12-05.api.json +0 -1208
  152. data/apis/dynamodb-2011-12-05.paginators.json +0 -26
  153. data/apis/dynamodb-2011-12-05.waiters.json +0 -27
  154. data/apis/dynamodb-2012-08-10.api.json +0 -1857
  155. data/apis/ec2-2014-06-15.api.json +0 -11670
  156. data/apis/elasticache-2014-03-24.api.json +0 -4789
  157. data/apis/elasticache-2014-07-15.api.json +0 -4826
  158. data/apis/elasticache-2014-07-15.paginators.json +0 -76
  159. data/apis/elasticbeanstalk-2010-12-01.api.json +0 -2442
  160. data/apis/elasticloadbalancing-2012-06-01.api.json +0 -2605
  161. data/apis/elasticmapreduce-2009-03-31.api.json +0 -2282
  162. data/apis/elastictranscoder-2012-09-25.api.json +0 -2478
  163. data/apis/email-2010-12-01.api.json +0 -954
  164. data/apis/glacier-2012-06-01.api.json +0 -2012
  165. data/apis/iam-2010-05-08.api.json +0 -5322
  166. data/apis/importexport-2010-06-01.api.json +0 -687
  167. data/apis/kinesis-2013-12-02.api.json +0 -769
  168. data/apis/logs-2014-03-28.api.json +0 -942
  169. data/apis/manifest.json +0 -259
  170. data/apis/monitoring-2010-08-01.api.json +0 -1338
  171. data/apis/opsworks-2013-02-18.api.json +0 -4348
  172. data/apis/rds-2013-01-10.api.json +0 -6074
  173. data/apis/rds-2013-01-10.paginators.json +0 -97
  174. data/apis/rds-2013-02-12.api.json +0 -6392
  175. data/apis/rds-2013-09-09.api.json +0 -6564
  176. data/apis/rds-2013-09-09.paginators.json +0 -110
  177. data/apis/redshift-2012-12-01.api.json +0 -6318
  178. data/apis/route53-2013-04-01.api.json +0 -2493
  179. data/apis/route53domains-2014-05-15.api.json +0 -1622
  180. data/apis/sdb-2009-04-15.api.json +0 -1178
  181. data/apis/sns-2010-03-31.api.json +0 -2275
  182. data/apis/sqs-2012-11-05.api.json +0 -1438
  183. data/apis/storagegateway-2013-06-30.api.json +0 -3153
  184. data/apis/sts-2011-06-15.api.json +0 -786
  185. data/apis/support-2013-04-15.api.json +0 -1379
  186. data/apis/swf-2012-01-25.api.json +0 -4463
  187. data/lib/aws/api/manifest.rb +0 -29
  188. data/lib/aws/api/manifest_builder.rb +0 -57
  189. data/lib/aws/api/minifier.rb +0 -42
  190. data/lib/aws/plugins/response_paging.rb +0 -20
  191. data/lib/aws/response_handler.rb +0 -38
  192. data/lib/aws/service.rb +0 -26
  193. data/lib/aws/service_builder.rb +0 -56
  194. data/lib/aws/version.rb +0 -3
  195. data/lib/aws.rb +0 -227
  196. data/lib/seahorse/client/plugins/api.rb +0 -11
  197. /data/apis/{autoscaling-2011-01-01.paginators.json → AutoScaling.paginators.json} +0 -0
  198. /data/apis/{cloudformation-2010-05-15.paginators.json → CloudFormation.paginators.json} +0 -0
  199. /data/apis/{cloudfront-2014-05-31.paginators.json → CloudFront.paginators.json} +0 -0
  200. /data/apis/{cloudfront-2014-01-31.waiters.json → CloudFront.waiters.json} +0 -0
  201. /data/apis/{cloudsearch-2013-01-01.paginators.json → CloudSearch.paginators.json} +0 -0
  202. /data/apis/{cloudtrail-2013-11-01.paginators.json → CloudTrail.paginators.json} +0 -0
  203. /data/apis/{monitoring-2010-08-01.paginators.json → CloudWatch.paginators.json} +0 -0
  204. /data/apis/{logs-2014-03-28.paginators.json → CloudWatchLogs.paginators.json} +0 -0
  205. /data/apis/{datapipeline-2012-10-29.paginators.json → DataPipeline.paginators.json} +0 -0
  206. /data/apis/{directconnect-2012-10-25.paginators.json → DirectConnect.paginators.json} +0 -0
  207. /data/apis/{dynamodb-2012-08-10.waiters.json → DynamoDB.waiters.json} +0 -0
  208. /data/apis/{ec2-2014-06-15.paginators.json → EC2.paginators.json} +0 -0
  209. /data/apis/{ec2-2014-06-15.waiters.json → EC2.waiters.json} +0 -0
  210. /data/apis/{elasticmapreduce-2009-03-31.paginators.json → EMR.paginators.json} +0 -0
  211. /data/apis/{elasticache-2014-03-24.paginators.json → ElastiCache.paginators.json} +0 -0
  212. /data/apis/{elasticbeanstalk-2010-12-01.paginators.json → ElasticBeanstalk.paginators.json} +0 -0
  213. /data/apis/{elasticloadbalancing-2012-06-01.paginators.json → ElasticLoadBalancing.paginators.json} +0 -0
  214. /data/apis/{elastictranscoder-2012-09-25.paginators.json → ElasticTranscoder.paginators.json} +0 -0
  215. /data/apis/{glacier-2012-06-01.paginators.json → Glacier.paginators.json} +0 -0
  216. /data/apis/{glacier-2012-06-01.waiters.json → Glacier.waiters.json} +0 -0
  217. /data/apis/{iam-2010-05-08.paginators.json → IAM.paginators.json} +0 -0
  218. /data/apis/{importexport-2010-06-01.paginators.json → ImportExport.paginators.json} +0 -0
  219. /data/apis/{opsworks-2013-02-18.paginators.json → OpsWorks.paginators.json} +0 -0
  220. /data/apis/{rds-2013-02-12.paginators.json → RDS.paginators.json} +0 -0
  221. /data/apis/{rds-2013-09-09.waiters.json → RDS.waiters.json} +0 -0
  222. /data/apis/{redshift-2012-12-01.paginators.json → Redshift.paginators.json} +0 -0
  223. /data/apis/{redshift-2012-12-01.waiters.json → Redshift.waiters.json} +0 -0
  224. /data/apis/{route53-2013-04-01.paginators.json → Route53.paginators.json} +0 -0
  225. /data/apis/{s3-2006-03-01.waiters.json → S3.waiters.json} +0 -0
  226. /data/apis/{email-2010-12-01.paginators.json → SES.paginators.json} +0 -0
  227. /data/apis/{email-2010-12-01.waiters.json → SES.waiters.json} +0 -0
  228. /data/apis/{sns-2010-03-31.paginators.json → SNS.paginators.json} +0 -0
  229. /data/apis/{sns-2010-03-31.resources.json → SNS.resources.json} +0 -0
  230. /data/apis/{sqs-2012-11-05.paginators.json → SQS.paginators.json} +0 -0
  231. /data/apis/{swf-2012-01-25.paginators.json → SWF.paginators.json} +0 -0
  232. /data/apis/{sdb-2009-04-15.paginators.json → SimpleDB.paginators.json} +0 -0
  233. /data/apis/{storagegateway-2013-06-30.paginators.json → StorageGateway.paginators.json} +0 -0
  234. /data/apis/{support-2013-04-15.paginators.json → Support.paginators.json} +0 -0
  235. /data/lib/{aws → aws-sdk-core}/api/customizer.rb +0 -0
  236. /data/lib/{aws → aws-sdk-core}/credentials.rb +0 -0
  237. /data/lib/{aws → aws-sdk-core}/json/builder.rb +0 -0
  238. /data/lib/{aws → aws-sdk-core}/json/error_handler.rb +0 -0
  239. /data/lib/{aws → aws-sdk-core}/json/parser.rb +0 -0
  240. /data/lib/{aws → aws-sdk-core}/json/rest_handler.rb +0 -0
  241. /data/lib/{aws → aws-sdk-core}/json/rpc_body_handler.rb +0 -0
  242. /data/lib/{aws → aws-sdk-core}/json/rpc_headers_handler.rb +0 -0
  243. /data/lib/{aws → aws-sdk-core}/json/simple_body_handler.rb +0 -0
  244. /data/lib/{aws → aws-sdk-core}/paging/null_pager.rb +0 -0
  245. /data/lib/{aws → aws-sdk-core}/paging/null_provider.rb +0 -0
  246. /data/lib/{aws → aws-sdk-core}/paging/pager.rb +0 -0
  247. /data/lib/{aws → aws-sdk-core}/paging/provider.rb +0 -0
  248. /data/lib/{aws → aws-sdk-core}/plugins/dynamodb_extended_retries.rb +0 -0
  249. /data/lib/{aws → aws-sdk-core}/plugins/ec2_copy_encrypted_snapshot.rb +0 -0
  250. /data/lib/{aws → aws-sdk-core}/plugins/glacier_account_id.rb +0 -0
  251. /data/lib/{aws → aws-sdk-core}/plugins/glacier_api_version.rb +0 -0
  252. /data/lib/{aws → aws-sdk-core}/plugins/glacier_checksums.rb +0 -0
  253. /data/lib/{aws → aws-sdk-core}/plugins/protocols/ec2.rb +0 -0
  254. /data/lib/{aws → aws-sdk-core}/plugins/protocols/query.rb +0 -0
  255. /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_json.rb +0 -0
  256. /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_xml.rb +0 -0
  257. /data/lib/{aws → aws-sdk-core}/plugins/retry_errors.rb +0 -0
  258. /data/lib/{aws → aws-sdk-core}/plugins/route_53_id_fix.rb +0 -0
  259. /data/lib/{aws → aws-sdk-core}/plugins/s3_bucket_dns.rb +0 -0
  260. /data/lib/{aws → aws-sdk-core}/plugins/s3_complete_multipart_upload_fix.rb +0 -0
  261. /data/lib/{aws → aws-sdk-core}/plugins/s3_expect_100_continue.rb +0 -0
  262. /data/lib/{aws → aws-sdk-core}/plugins/s3_get_bucket_location_fix.rb +0 -0
  263. /data/lib/{aws → aws-sdk-core}/plugins/s3_location_constraint.rb +0 -0
  264. /data/lib/{aws → aws-sdk-core}/plugins/s3_md5s.rb +0 -0
  265. /data/lib/{aws → aws-sdk-core}/plugins/s3_redirects.rb +0 -0
  266. /data/lib/{aws → aws-sdk-core}/plugins/s3_sse_cpk.rb +0 -0
  267. /data/lib/{aws → aws-sdk-core}/plugins/sqs_queue_urls.rb +0 -0
  268. /data/lib/{aws → aws-sdk-core}/plugins/swf_read_timeouts.rb +0 -0
  269. /data/lib/{aws → aws-sdk-core}/query/ec2_param_builder.rb +0 -0
  270. /data/lib/{aws → aws-sdk-core}/query/param.rb +0 -0
  271. /data/lib/{aws → aws-sdk-core}/query/param_builder.rb +0 -0
  272. /data/lib/{aws → aws-sdk-core}/query/param_list.rb +0 -0
  273. /data/lib/{aws → aws-sdk-core}/rest_body_handler.rb +0 -0
  274. /data/lib/{aws → aws-sdk-core}/shared_credentials.rb +0 -0
  275. /data/lib/{aws → aws-sdk-core}/signers/base.rb +0 -0
  276. /data/lib/{aws → aws-sdk-core}/signers/handler.rb +0 -0
  277. /data/lib/{aws → aws-sdk-core}/signers/s3.rb +0 -0
  278. /data/lib/{aws → aws-sdk-core}/signers/v2.rb +0 -0
  279. /data/lib/{aws → aws-sdk-core}/signers/v3.rb +0 -0
  280. /data/lib/{aws → aws-sdk-core}/tree_hash.rb +0 -0
  281. /data/lib/{aws → aws-sdk-core}/xml/error_handler.rb +0 -0
  282. /data/lib/{aws → aws-sdk-core}/xml/rest_handler.rb +0 -0
@@ -0,0 +1,87 @@
1
+ require 'bigdecimal'
2
+ require 'stringio'
3
+ require 'set'
4
+
5
+ module Aws
6
+ module DynamoDB
7
+ # @api private
8
+ class AttributeValue
9
+
10
+ def initialize
11
+ @marshaler = Marshaler.new
12
+ @unmarshaler = Unmarshaler.new
13
+ end
14
+
15
+ def marshal(value)
16
+ @marshaler.format(value)
17
+ end
18
+
19
+ def unmarshal(value)
20
+ @unmarshaler.format(value)
21
+ end
22
+
23
+ class Marshaler
24
+
25
+ def format(obj)
26
+ case obj
27
+ when String then { s: obj }
28
+ when Numeric then { n: obj.to_s }
29
+ when StringIO, IO then { b: obj.read }
30
+ when Set then format_set(obj)
31
+ else
32
+ msg = "unsupported type, expected Set, String, Numeric, or "
33
+ msg << "IO object, got #{obj.class.name}"
34
+ raise ArgumentError, msg
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def format_set(set)
41
+ case set.first
42
+ when String then { ss: set.map(&:to_s) }
43
+ when Numeric then { ns: set.map(&:to_s) }
44
+ when StringIO, IO then { bs: set.map(&:read) }
45
+ else
46
+ msg = "set types only support String, Numeric, or IO objects"
47
+ raise ArgumentError, msg
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ class Unmarshaler
54
+
55
+ def format(obj)
56
+ type, value = extract_type_and_value(obj)
57
+ case type
58
+ when :s then value
59
+ when :n then BigDecimal.new(value)
60
+ when :b then StringIO.new(value)
61
+ when :ss then Set.new(value)
62
+ when :ns then Set.new(value.map { |n| BigDecimal.new(n) })
63
+ when :bs then Set.new(value.map { |b| StringIO.new(b) })
64
+ else
65
+ raise ArgumentError, "unhandled type #{type.inspect}"
66
+ end
67
+ end
68
+
69
+ private
70
+
71
+ def extract_type_and_value(obj)
72
+ case obj
73
+ when Hash then obj.to_a.first
74
+ when Struct
75
+ obj.members.each do |key|
76
+ value = obj[key]
77
+ return [key, value] unless value.nil?
78
+ end
79
+ else
80
+ raise ArgumentError, "unhandled type #{obj.inspect}"
81
+ end
82
+ end
83
+
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,12 @@
1
+ Aws.add_service(:DynamoDB, {
2
+ api: File.join(Aws::APIS_DIR, 'DynamoDB.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'DynamoDB.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'DynamoDB.paginators.json'),
5
+ waiters: File.join(Aws::APIS_DIR, 'DynamoDB.waiters.json'),
6
+ })
7
+
8
+ module Aws
9
+ module DynamoDB
10
+ autoload :AttributeValue, 'aws-sdk-core/dynamodb/attribute_value'
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ Aws.add_service(:EC2, {
2
+ api: File.join(Aws::APIS_DIR, 'EC2.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'EC2.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'EC2.paginators.json'),
5
+ resources: File.join(Aws::APIS_DIR, 'EC2.resources.json'),
6
+ waiters: File.join(Aws::APIS_DIR, 'EC2.waiters.json'),
7
+ })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:ElastiCache, {
2
+ api: File.join(Aws::APIS_DIR, 'ElastiCache.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'ElastiCache.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'ElastiCache.paginators.json'),
5
+ })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:ElasticBeanstalk, {
2
+ api: File.join(Aws::APIS_DIR, 'ElasticBeanstalk.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'ElasticBeanstalk.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'ElasticBeanstalk.paginators.json'),
5
+ })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:ElasticLoadBalancing, {
2
+ api: File.join(Aws::APIS_DIR, 'ElasticLoadBalancing.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'ElasticLoadBalancing.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'ElasticLoadBalancing.paginators.json'),
5
+ })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:ElasticTranscoder, {
2
+ api: File.join(Aws::APIS_DIR, 'ElasticTranscoder.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'ElasticTranscoder.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'ElasticTranscoder.paginators.json'),
5
+ })
@@ -6,14 +6,14 @@ module Aws
6
6
  end
7
7
 
8
8
  def ==(other)
9
- other.is_a?(EmptyStruct)
9
+ other.is_a?(EmptyStructure)
10
10
  end
11
11
 
12
12
  def [](member_name)
13
13
  raise NameError, "no member '#{member_name}' in struct"
14
14
  end
15
15
 
16
- def []=(member_name)
16
+ def []=(member_name, value)
17
17
  raise NameError, "no member '#{member_name}' in struct"
18
18
  end
19
19
 
@@ -30,7 +30,7 @@ module Aws
30
30
  end
31
31
 
32
32
  def eql?(other)
33
- other.is_a?(EmptyStruct)
33
+ other.is_a?(EmptyStructure)
34
34
  end
35
35
 
36
36
  # @api private
@@ -52,6 +52,7 @@ module Aws
52
52
  end
53
53
 
54
54
  def select(&block)
55
+ []
55
56
  end
56
57
 
57
58
  def size
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:EMR, {
2
+ api: File.join(Aws::APIS_DIR, 'EMR.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'EMR.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'EMR.paginators.json'),
5
+ })
@@ -1,6 +1,7 @@
1
1
  require 'multi_json'
2
2
 
3
3
  module Aws
4
+ # @api private
4
5
  class EndpointProvider
5
6
 
6
7
  # @option options [Array<Hash>] :rules ([]) An array of grouped rules.
@@ -1,6 +1,8 @@
1
1
  require 'thread'
2
2
 
3
3
  module Aws
4
+
5
+ # Each Service module has its own Errors module, e.g. {S3::Errors}.
4
6
  module Errors
5
7
 
6
8
  # The base class for all errors returned by an Amazon Web Service.
@@ -32,10 +34,6 @@ module Aws
32
34
  # This error indicates a checksum failed.
33
35
  class ChecksumError < RuntimeError; end
34
36
 
35
- # Raised when a {Service} is constructed an no suitable API
36
- # version is found based on configuration.
37
- class NoSuchApiVersionError < RuntimeError; end
38
-
39
37
  # Raised when a {Service} is constructed and the specified shared
40
38
  # credentials profile does not exist.
41
39
  class NoSuchProfileError < RuntimeError; end
@@ -78,9 +76,7 @@ module Aws
78
76
  #
79
77
  # @api private
80
78
  def error_class(error_code)
81
- constant = error_code.to_s
82
- constant = constant.gsub(/http:\/\/.*$/, '') # remove http namespaces
83
- constant = constant.gsub(/[^a-zA-Z0-9]/, '').to_sym
79
+ constant = error_class_constant(error_code)
84
80
  if error_const_set?(constant)
85
81
  const_get(constant)
86
82
  else
@@ -90,6 +86,21 @@ module Aws
90
86
 
91
87
  private
92
88
 
89
+ # Convert an error code to an error class name/constant.
90
+ # This requires filtering non-safe characters from the constant
91
+ # name and ensuring it begins with an uppercase letter.
92
+ # @param [String] error_code
93
+ # @return [Symbol] Returns a symbolized constant name for the given
94
+ # `error_code`.
95
+ def error_class_constant(error_code)
96
+ constant = error_code.to_s
97
+ constant = constant.gsub(/https?:.*$/, '')
98
+ constant = constant.gsub(/[^a-zA-Z0-9]/, '')
99
+ constant = 'Error' + constant unless constant.match(/^[a-z]/i)
100
+ constant = constant[0].upcase + constant[1..-1]
101
+ constant.to_sym
102
+ end
103
+
93
104
  def set_error_constant(constant)
94
105
  @const_set_mutex.synchronize do
95
106
  # Ensure the const was not defined while blocked by the mutex
@@ -0,0 +1,7 @@
1
+ Aws.add_service(:Glacier, {
2
+ api: File.join(Aws::APIS_DIR, 'Glacier.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'Glacier.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'Glacier.paginators.json'),
5
+ resources: File.join(Aws::APIS_DIR, 'Glacier.resources.json'),
6
+ waiters: File.join(Aws::APIS_DIR, 'Glacier.waiters.json'),
7
+ })
@@ -0,0 +1,6 @@
1
+ Aws.add_service(:IAM, {
2
+ api: File.join(Aws::APIS_DIR, 'IAM.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'IAM.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'IAM.paginators.json'),
5
+ resources: File.join(Aws::APIS_DIR, 'IAM.resources.json'),
6
+ })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:ImportExport, {
2
+ api: File.join(Aws::APIS_DIR, 'ImportExport.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'ImportExport.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'ImportExport.paginators.json'),
5
+ })
@@ -96,7 +96,7 @@ module Aws
96
96
  end
97
97
 
98
98
  def open_connection
99
- http = Net::HTTP.new(@ip_address, @port)
99
+ http = Net::HTTP.new(@ip_address, @port, nil)
100
100
  http.open_timeout = @http_open_timeout
101
101
  http.read_timeout = @http_read_timeout
102
102
  http.set_debug_output(@http_debug_output) if @http_debug_output
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:Kinesis, {
2
+ api: File.join(Aws::APIS_DIR, 'Kinesis.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'Kinesis.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'Kinesis.paginators.json'),
5
+ })
@@ -0,0 +1,6 @@
1
+ Aws.add_service(:OpsWorks, {
2
+ api: File.join(Aws::APIS_DIR, 'OpsWorks.api.json'),
3
+ docs: File.join(Aws::APIS_DIR, 'OpsWorks.docs.json'),
4
+ paginators: File.join(Aws::APIS_DIR, 'OpsWorks.paginators.json'),
5
+ resources: File.join(Aws::APIS_DIR, 'OpsWorks.resources.json'),
6
+ })
@@ -101,7 +101,7 @@ module Aws
101
101
  # @return [Hash] Returns the hash of request parameters for the
102
102
  # next page, merging any given params.
103
103
  def next_page_params(params)
104
- context.params.merge(@pager.next_tokens(self).merge(params))
104
+ context[:original_params].merge(@pager.next_tokens(self).merge(params))
105
105
  end
106
106
 
107
107
  # Raised when calling {PageableResponse#next_page} on a pager that
@@ -0,0 +1,37 @@
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
+ def after_initialize(client)
29
+ # disable request singing when credentials are not set
30
+ if client.config.credentials.nil? or !client.config.credentials.set?
31
+ client.config.signature_version = nil
32
+ end
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,179 @@
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
+ # }
26
+ # )
27
+ #
28
+ # With this plugin **disabled**, `simple_attributes: false`:
29
+ #
30
+ # # note that all types are prefixed in a hash and that
31
+ # # numeric types must be serialized as strings
32
+ # dynamodb.put_item(
33
+ # table_name: 'aws-sdk',
34
+ # item: {
35
+ # 'id' => { s: 'uuid' },
36
+ # 'age' => { n: '35' },
37
+ # 'tags' => { ss: ['simple', 'attributes'] },
38
+ # 'data' => { b: 'data' },
39
+ # }
40
+ # )
41
+ #
42
+ # ## Output Examples
43
+ #
44
+ # With this plugin **enabled**, `simple_attributes: true`:
45
+ #
46
+ # resp = dynamodb.get(table_name: 'aws-sdk', key: { id: 'uuid' })
47
+ # resp.item
48
+ # {
49
+ # id: 'uuid',
50
+ # age: 35,
51
+ # tags: Set.new(%w(simple attributes)),
52
+ # data: StringIO.new('data')
53
+ # }
54
+ #
55
+ # With this plugin **disabled**, `simple_attributes: false`:
56
+ #
57
+ # # note that the request `:key` had to be type prefixed
58
+ # resp = dynamodb.get(table_name: 'aws-sdk', key: { 'id' => { s: 'uuid' }})
59
+ # resp.item
60
+ # # {
61
+ # # "id"=> <struct s='uuid', n=nil, b=nil, ss=nil, ns=nil, bs=nil>,
62
+ # # "age"=> <struct s=nil, n="35", b=nil, ss=nil, ns=nil, bs=nil>,
63
+ # # "tags"=> <struct s=nil, n=nil, b=nil, ss=['simple', 'attributes'], ns=nil, bs=nil>,
64
+ # # "data"=> <struct s=nil, n=nil, b="data", ss=nil, ns=nil, bs=nil>,
65
+ # # }
66
+ #
67
+ # @seahorse.client.option [Boolean] :simple_attributes (true)
68
+ # Enables working with DynamoDB attribute values using simple
69
+ # Ruby natives.
70
+ #
71
+ # Disabling this option requires that all attribute values have
72
+ # their types specified, e.g. `{ s: 'abc' }` instead of simply
73
+ # `'abc'`.
74
+ #
75
+ class DynamoDBSimpleAttributes < Seahorse::Client::Plugin
76
+
77
+ option(:simple_attributes) { |config| !config.simple_json }
78
+
79
+ def add_handlers(handlers, config)
80
+ if config.simple_attributes
81
+ handlers.add(Handler, step: :initialize)
82
+ end
83
+ end
84
+
85
+ class Handler < Seahorse::Client::Handler
86
+
87
+ def call(context)
88
+ context.params = translate_input(context)
89
+ @handler.call(context).on(200) do |response|
90
+ response.data = translate_output(response)
91
+ end
92
+ end
93
+
94
+ private
95
+
96
+ def translate_input(context)
97
+ if shape = context.operation.input
98
+ ValueTranslator.new(shape, :marshal).apply(context.params)
99
+ else
100
+ context.params
101
+ end
102
+ end
103
+
104
+ def translate_output(response)
105
+ if shape = response.context.operation.output
106
+ ValueTranslator.new(shape, :unmarshal).apply(response.data)
107
+ else
108
+ response.data
109
+ end
110
+ end
111
+
112
+ end
113
+
114
+ # @api private
115
+ class ValueTranslator
116
+
117
+ # @param [Seahorse::Model::Shapes::Shape] shape
118
+ # @param [Symbol<:marshal,:unmarshal>] mode
119
+ def initialize(shape, mode)
120
+ @shape = shape
121
+ @mode = mode
122
+ end
123
+
124
+ def apply(values)
125
+ structure(@shape, values) if @shape
126
+ end
127
+
128
+ private
129
+
130
+ def structure(shape, values)
131
+ if values.is_a?(Struct)
132
+ values.members.each do |key|
133
+ values[key] = translate(shape.member(key), values[key])
134
+ end
135
+ values
136
+ elsif values.is_a?(Hash)
137
+ values.each.with_object({}) do |(key, value), hash|
138
+ hash[key] = translate(shape.member(key), value)
139
+ end
140
+ else
141
+ values
142
+ end
143
+ end
144
+
145
+ def list(shape, values)
146
+ return values unless values.is_a?(Array)
147
+ values.inject([]) do |list, value|
148
+ list << translate(shape.member, value)
149
+ end
150
+ end
151
+
152
+ def map(shape, values)
153
+ return values unless values.is_a?(Hash)
154
+ values.each.with_object({}) do |(key, value), hash|
155
+ hash[key] = translate(shape.value, value)
156
+ end
157
+ end
158
+
159
+ def translate(shape, value)
160
+ if shape.name == 'AttributeValue'
161
+ DynamoDB::AttributeValue.new.send(@mode, value)
162
+ else
163
+ translate_complex(shape, value)
164
+ end
165
+ end
166
+
167
+ def translate_complex(shape, value)
168
+ case shape
169
+ when Seahorse::Model::Shapes::Structure then structure(shape, value)
170
+ when Seahorse::Model::Shapes::List then list(shape, value)
171
+ when Seahorse::Model::Shapes::Map then map(shape, value)
172
+ else value
173
+ end
174
+ end
175
+
176
+ end
177
+ end
178
+ end
179
+ end
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module Aws
2
4
  module Plugins
3
5
 
@@ -38,6 +40,9 @@ module Aws
38
40
  #
39
41
  class GlobalConfiguration < Seahorse::Client::Plugin
40
42
 
43
+ # @api private
44
+ IDENTIFIERS = Set.new
45
+
41
46
  # @api private
42
47
  def before_initialize(client_class, options)
43
48
  # apply service specific defaults before the global aws defaults
@@ -48,7 +53,7 @@ module Aws
48
53
  private
49
54
 
50
55
  def apply_service_defaults(client_class, options)
51
- if defaults = Aws.config[client_class::IDENTIFIER]
56
+ if defaults = Aws.config[client_class.identifier]
52
57
  defaults.each do |option_name, default|
53
58
  options[option_name] = default unless options.key?(option_name)
54
59
  end
@@ -57,8 +62,7 @@ module Aws
57
62
 
58
63
  def apply_aws_defaults(client_class, options)
59
64
  Aws.config.each do |option_name, default|
60
- next if client_class::IDENTIFIER == option_name
61
- next if Aws.services.key?(option_name)
65
+ next if IDENTIFIERS.include?(option_name)
62
66
  next if options.key?(option_name)
63
67
  options[option_name] = default
64
68
  end
@@ -66,4 +70,10 @@ module Aws
66
70
 
67
71
  end
68
72
  end
73
+
74
+ service_added do |name, _, _|
75
+ Plugins::GlobalConfiguration::IDENTIFIERS << name.downcase.to_sym
76
+ end
77
+
69
78
  end
79
+
@@ -3,13 +3,15 @@ module Aws
3
3
  module Protocols
4
4
 
5
5
  # @seahorse.client.option [Boolean] :simple_json (false)
6
- # Enables simple mode where the request body becomes a simple
7
- # JSON dump of the request paramters. The response data will also
8
- # be a simple JSON load of the response body. Enabling
9
- # simple mode avoids the overhead of request parameter valdiation,
10
- # request parameter type conversion, and structuring response
11
- # data. You must provide request params in the format expected
12
- # by the remote service.
6
+ # Disables request parameter conversion, validation, and formatting.
7
+ # Also disable response data type conversions. This option is useful
8
+ # when you want to ensure the highest level of performance by
9
+ # avoiding overhead of walking request parameters and response data
10
+ # structures.
11
+ #
12
+ # When `:simple_json` is enabled, the request parameters hash must
13
+ # be formatted exactly as the DynamoDB API expects.
14
+ #
13
15
  class JsonRpc < Seahorse::Client::Plugin
14
16
 
15
17
  option(:simple_json, false)
@@ -1,7 +1,7 @@
1
1
  module Aws
2
2
  module Plugins
3
3
 
4
- # @seahorse.client.option [String] :region
4
+ # @seahorse.client.option [required, String] :region
5
5
  # The AWS region to connect to. The region is used to construct
6
6
  # the client endpoint. Defaults to `ENV['AWS_DEFAULT_REGION']`.
7
7
  # Also checks `AWS_REGION` and `AMAZON_REGION`.
@@ -79,22 +79,29 @@ module Aws
79
79
  @handler.call(context)
80
80
  end
81
81
 
82
+ private
83
+
82
84
  def sign_authenticated_requests(context)
83
85
  if signer = SIGNERS[context.config.signature_version]
86
+ require_credentials(context)
84
87
  signer.sign(context)
85
88
  end
86
89
  end
87
90
 
91
+ def require_credentials(context)
92
+ if
93
+ context.config.credentials.nil? or
94
+ !context.config.credentials.set?
95
+ then
96
+ msg = 'unable to sign request without credentials set'
97
+ raise Errors::MissingCredentialsError, msg
98
+ end
99
+ end
100
+
88
101
  end
89
102
 
90
103
  handler(Handler, step: :sign)
91
104
 
92
- def after_initialize(client)
93
- if client.config.credentials.nil? or !client.config.credentials.set?
94
- raise Errors::MissingCredentialsError
95
- end
96
- end
97
-
98
105
  end
99
106
  end
100
107
  end
@@ -0,0 +1,25 @@
1
+ module Aws
2
+ module Plugins
3
+ class ResponsePaging < Seahorse::Client::Plugin
4
+
5
+ # @api private
6
+ class Handler < Seahorse::Client::Handler
7
+
8
+ def call(context)
9
+ context[:original_params] = context.params
10
+ PageableResponse.new(@handler.call(context), pager(context))
11
+ end
12
+
13
+ private
14
+
15
+ def pager(context)
16
+ context.client.class.paginators.pager(context.operation.name)
17
+ end
18
+
19
+ end
20
+
21
+ handler(Handler, step: :initialize, priority: 90)
22
+
23
+ end
24
+ end
25
+ end