aws-sdk-core 2.0.0.rc12 → 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 (536) 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/CloudFront.paginators.json +32 -0
  6. data/apis/CloudSearch.api.json +1955 -0
  7. data/apis/CloudSearchDomain.api.json +349 -0
  8. data/apis/CloudTrail.api.json +559 -0
  9. data/apis/CloudWatch.api.json +917 -0
  10. data/apis/CloudWatchLogs.api.json +816 -0
  11. data/apis/CognitoIdentity.api.json +631 -0
  12. data/apis/CognitoSync.api.json +721 -0
  13. data/apis/DataPipeline.api.json +940 -0
  14. data/apis/DirectConnect.api.json +833 -0
  15. data/apis/DynamoDB.api.json +1210 -0
  16. data/apis/{dynamodb-2011-12-05.paginators.json → DynamoDB.paginators.json} +1 -3
  17. data/apis/EC2.api.json +9914 -0
  18. data/apis/{ec2-2014-06-15.resources.json → EC2.resources.json} +16 -0
  19. data/apis/EMR.api.json +1339 -0
  20. data/apis/ElastiCache.api.json +3410 -0
  21. data/apis/ElasticBeanstalk.api.json +1543 -0
  22. data/apis/ElasticLoadBalancing.api.json +2131 -0
  23. data/apis/ElasticTranscoder.api.json +1647 -0
  24. data/apis/Glacier.api.json +1456 -0
  25. data/apis/{glacier-2012-06-01.resources.json → Glacier.resources.json} +5 -9
  26. data/apis/IAM.api.json +4033 -0
  27. data/apis/{iam-2010-05-08.resources.json → IAM.resources.json} +1 -1
  28. data/apis/ImportExport.api.json +515 -0
  29. data/apis/Kinesis.api.json +706 -0
  30. data/apis/{kinesis-2013-12-02.paginators.json → Kinesis.paginators.json} +0 -6
  31. data/apis/OpsWorks.api.json +2555 -0
  32. data/apis/OpsWorks.resources.json +181 -0
  33. data/apis/RDS.api.json +4473 -0
  34. data/apis/Redshift.api.json +4482 -0
  35. data/apis/Route53.api.json +1935 -0
  36. data/apis/Route53Domains.api.json +1129 -0
  37. data/apis/{s3-2006-03-01.api.json → S3.api.json} +377 -972
  38. data/apis/{s3-2006-03-01.paginators.json → S3.paginators.json} +1 -1
  39. data/apis/{s3-2006-03-01.resources.json → S3.resources.json} +13 -2
  40. data/apis/SES.api.json +644 -0
  41. data/apis/SNS.api.json +1760 -0
  42. data/apis/SQS.api.json +1113 -0
  43. data/apis/{sqs-2012-11-05.resources.json → SQS.resources.json} +0 -10
  44. data/apis/STS.api.json +594 -0
  45. data/apis/SWF.api.json +2656 -0
  46. data/apis/SimpleDB.api.json +954 -0
  47. data/apis/StorageGateway.api.json +2311 -0
  48. data/apis/Support.api.json +869 -0
  49. data/bin/aws.rb +19 -1
  50. data/endpoints.json +77 -0
  51. data/lib/aws-sdk-core/api/docstrings.rb +35 -0
  52. data/lib/aws-sdk-core/api/documenter.rb +241 -0
  53. data/lib/{aws/api/documentor.rb → aws-sdk-core/api/operation_documenter.rb} +39 -28
  54. data/lib/{aws/api/doc_example.rb → aws-sdk-core/api/operation_example.rb} +31 -22
  55. data/lib/{aws → aws-sdk-core}/api/service_customizations.rb +5 -1
  56. data/lib/aws-sdk-core/autoscaling.rb +5 -0
  57. data/lib/aws-sdk-core/client.rb +121 -0
  58. data/lib/aws-sdk-core/cloudformation.rb +5 -0
  59. data/lib/aws-sdk-core/cloudfront.rb +6 -0
  60. data/lib/aws-sdk-core/cloudsearch.rb +5 -0
  61. data/lib/aws-sdk-core/cloudsearchdomain.rb +4 -0
  62. data/lib/aws-sdk-core/cloudtrail.rb +5 -0
  63. data/lib/aws-sdk-core/cloudwatch.rb +5 -0
  64. data/lib/aws-sdk-core/cloudwatchlogs.rb +5 -0
  65. data/lib/aws-sdk-core/cognitoidentity.rb +4 -0
  66. data/lib/aws-sdk-core/cognitosync.rb +4 -0
  67. data/lib/{aws → aws-sdk-core}/credential_provider_chain.rb +4 -1
  68. data/lib/aws-sdk-core/datapipeline.rb +5 -0
  69. data/lib/aws-sdk-core/directconnect.rb +5 -0
  70. data/lib/aws-sdk-core/dynamodb/attribute_value.rb +87 -0
  71. data/lib/aws-sdk-core/dynamodb.rb +12 -0
  72. data/lib/aws-sdk-core/ec2.rb +7 -0
  73. data/lib/aws-sdk-core/elasticache.rb +5 -0
  74. data/lib/aws-sdk-core/elasticbeanstalk.rb +5 -0
  75. data/lib/aws-sdk-core/elasticloadbalancing.rb +5 -0
  76. data/lib/aws-sdk-core/elastictranscoder.rb +5 -0
  77. data/lib/{aws → aws-sdk-core}/empty_structure.rb +4 -3
  78. data/lib/aws-sdk-core/emr.rb +5 -0
  79. data/lib/aws-sdk-core/endpoint_provider.rb +97 -0
  80. data/lib/{aws → aws-sdk-core}/errors.rb +27 -8
  81. data/lib/aws-sdk-core/glacier.rb +7 -0
  82. data/lib/aws-sdk-core/iam.rb +6 -0
  83. data/lib/aws-sdk-core/importexport.rb +5 -0
  84. data/lib/{aws → aws-sdk-core}/instance_profile_credentials.rb +13 -9
  85. data/lib/aws-sdk-core/kinesis.rb +5 -0
  86. data/lib/aws-sdk-core/opsworks.rb +6 -0
  87. data/lib/{aws → aws-sdk-core}/pageable_response.rb +1 -1
  88. data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +37 -0
  89. data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +179 -0
  90. data/lib/{aws → aws-sdk-core}/plugins/global_configuration.rb +14 -7
  91. data/lib/{aws → aws-sdk-core}/plugins/protocols/json_rpc.rb +9 -7
  92. data/lib/{aws → aws-sdk-core}/plugins/regional_endpoint.rb +2 -4
  93. data/lib/{aws → aws-sdk-core}/plugins/request_signer.rb +18 -8
  94. data/lib/aws-sdk-core/plugins/response_paging.rb +25 -0
  95. data/lib/{aws → aws-sdk-core}/plugins/retry_errors.rb +11 -1
  96. data/lib/aws-sdk-core/plugins/route_53_id_fix.rb +55 -0
  97. data/lib/aws-sdk-core/plugins/s3_expect_100_continue.rb +27 -0
  98. data/lib/aws-sdk-core/plugins/s3_sse_cpk.rb +63 -0
  99. data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +92 -0
  100. data/lib/{aws → aws-sdk-core}/plugins/user_agent.rb +1 -2
  101. data/lib/{aws → aws-sdk-core}/query/handler.rb +4 -5
  102. data/lib/aws-sdk-core/rds.rb +6 -0
  103. data/lib/aws-sdk-core/redshift.rb +6 -0
  104. data/lib/aws-sdk-core/route53.rb +5 -0
  105. data/lib/aws-sdk-core/route53domains.rb +4 -0
  106. data/lib/aws-sdk-core/s3/presigner.rb +64 -0
  107. data/lib/aws-sdk-core/s3.rb +13 -0
  108. data/lib/aws-sdk-core/service.rb +4 -0
  109. data/lib/aws-sdk-core/ses.rb +6 -0
  110. data/lib/{aws → aws-sdk-core}/signers/v4.rb +6 -5
  111. data/lib/aws-sdk-core/simpledb.rb +5 -0
  112. data/lib/aws-sdk-core/sns.rb +6 -0
  113. data/lib/aws-sdk-core/sqs.rb +6 -0
  114. data/lib/aws-sdk-core/storagegateway.rb +5 -0
  115. data/lib/{aws → aws-sdk-core}/structure.rb +60 -4
  116. data/lib/aws-sdk-core/sts.rb +4 -0
  117. data/lib/aws-sdk-core/support.rb +5 -0
  118. data/lib/aws-sdk-core/swf.rb +5 -0
  119. data/lib/aws-sdk-core/version.rb +3 -0
  120. data/lib/aws-sdk-core/waiters/errors.rb +30 -0
  121. data/lib/aws-sdk-core/waiters/null_provider.rb +12 -0
  122. data/lib/aws-sdk-core/waiters/provider.rb +54 -0
  123. data/lib/aws-sdk-core/waiters/waiter.rb +194 -0
  124. data/lib/{aws → aws-sdk-core}/xml/builder.rb +4 -3
  125. data/lib/aws-sdk-core/xml/default_list.rb +10 -0
  126. data/lib/{aws → aws-sdk-core}/xml/parser.rb +6 -1
  127. data/lib/aws-sdk-core.rb +288 -1
  128. data/{vendor/seahorse/lib → lib}/seahorse/client/base.rb +45 -20
  129. data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list.rb +17 -3
  130. data/{vendor/seahorse/lib → lib}/seahorse/client/http/error.rb +2 -2
  131. data/{vendor/seahorse/lib → lib}/seahorse/client/http/request.rb +1 -9
  132. data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/connection_pool.rb +2 -0
  133. data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/handler.rb +13 -1
  134. data/lib/seahorse/client/net_http/patches.rb +97 -0
  135. data/{vendor/seahorse/lib → lib}/seahorse/client/param_converter.rb +2 -2
  136. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/endpoint.rb +24 -15
  137. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/restful_bindings.rb +1 -1
  138. data/{vendor/seahorse/lib → lib}/seahorse/client/request.rb +1 -1
  139. data/{vendor/seahorse/lib → lib}/seahorse/client/response.rb +0 -2
  140. data/{vendor/seahorse/lib → lib}/seahorse/client/xml/builder.rb +0 -1
  141. data/{vendor/seahorse/lib → lib}/seahorse/model/shape_map.rb +1 -0
  142. data/{vendor/seahorse/lib → lib}/seahorse/model/shapes.rb +13 -4
  143. data/{vendor/seahorse/lib → lib}/seahorse.rb +3 -3
  144. metadata +257 -593
  145. data/.gitignore +0 -8
  146. data/.simplecov +0 -6
  147. data/.travis.yml +0 -20
  148. data/.yardopts +0 -11
  149. data/Gemfile +0 -26
  150. data/LICENSE.txt +0 -12
  151. data/README.md +0 -250
  152. data/Rakefile +0 -17
  153. data/apis/autoscaling-2011-01-01.api.json +0 -2602
  154. data/apis/cloudformation-2010-05-15.api.json +0 -1306
  155. data/apis/cloudfront-2014-01-31.api.json +0 -3478
  156. data/apis/cloudfront-2014-01-31.paginators.json +0 -32
  157. data/apis/cloudfront-2014-05-31.api.json +0 -3540
  158. data/apis/cloudfront-2014-05-31.paginators.json +0 -32
  159. data/apis/cloudfront-2014-05-31.waiters.json +0 -29
  160. data/apis/cloudsearch-2011-02-01.api.json +0 -2093
  161. data/apis/cloudsearch-2011-02-01.paginators.json +0 -13
  162. data/apis/cloudsearch-2013-01-01.api.json +0 -2655
  163. data/apis/cloudsearchdomain-2013-01-01.api.json +0 -508
  164. data/apis/cloudtrail-2013-11-01.api.json +0 -773
  165. data/apis/cognito-identity-2014-06-30.api.json +0 -884
  166. data/apis/cognito-sync-2014-06-30.api.json +0 -1029
  167. data/apis/datapipeline-2012-10-29.api.json +0 -1432
  168. data/apis/directconnect-2012-10-25.api.json +0 -1174
  169. data/apis/dynamodb-2011-12-05.api.json +0 -1208
  170. data/apis/dynamodb-2011-12-05.waiters.json +0 -27
  171. data/apis/dynamodb-2012-08-10.api.json +0 -1857
  172. data/apis/dynamodb-2012-08-10.paginators.json +0 -27
  173. data/apis/ec2-2014-06-15.api.json +0 -11661
  174. data/apis/elasticache-2014-03-24.api.json +0 -4789
  175. data/apis/elasticbeanstalk-2010-12-01.api.json +0 -2442
  176. data/apis/elasticloadbalancing-2012-06-01.api.json +0 -2576
  177. data/apis/elasticmapreduce-2009-03-31.api.json +0 -2282
  178. data/apis/elastictranscoder-2012-09-25.api.json +0 -2478
  179. data/apis/email-2010-12-01.api.json +0 -954
  180. data/apis/endpoints.json +0 -98
  181. data/apis/glacier-2012-06-01.api.json +0 -2012
  182. data/apis/iam-2010-05-08.api.json +0 -5046
  183. data/apis/importexport-2010-06-01.api.json +0 -687
  184. data/apis/kinesis-2013-12-02.api.json +0 -769
  185. data/apis/logs-2014-03-28.api.json +0 -942
  186. data/apis/manifest.json +0 -250
  187. data/apis/monitoring-2010-08-01.api.json +0 -1338
  188. data/apis/opsworks-2013-02-18.api.json +0 -4348
  189. data/apis/rds-2013-01-10.api.json +0 -6074
  190. data/apis/rds-2013-02-12.api.json +0 -6392
  191. data/apis/rds-2013-02-12.paginators.json +0 -110
  192. data/apis/rds-2013-09-09.api.json +0 -6564
  193. data/apis/rds-2013-09-09.paginators.json +0 -110
  194. data/apis/redshift-2012-12-01.api.json +0 -6318
  195. data/apis/route53-2013-04-01.api.json +0 -1927
  196. data/apis/sdb-2009-04-15.api.json +0 -1178
  197. data/apis/sns-2010-03-31.api.json +0 -2275
  198. data/apis/sqs-2012-11-05.api.json +0 -1438
  199. data/apis/storagegateway-2013-06-30.api.json +0 -3153
  200. data/apis/sts-2011-06-15.api.json +0 -786
  201. data/apis/support-2013-04-15.api.json +0 -1115
  202. data/apis/swf-2012-01-25.api.json +0 -4463
  203. data/aws-sdk-core.gemspec +0 -22
  204. data/doc-src/images/lastnode.png +0 -0
  205. data/doc-src/images/node.png +0 -0
  206. data/doc-src/images/vline.png +0 -0
  207. data/doc-src/plugins/apis.rb +0 -260
  208. data/doc-src/plugins/stability.rb +0 -1
  209. data/doc-src/services/CloudSearchDomain/client.md +0 -8
  210. data/doc-src/services/CloudSearchDomain/service.md +0 -0
  211. data/doc-src/services/default/client.md +0 -84
  212. data/doc-src/services/default/errors.md +0 -45
  213. data/doc-src/services/default/service.md +0 -28
  214. data/doc-src/templates/default/fulldoc/html/css/common.css +0 -90
  215. data/doc-src/templates/default/fulldoc/html/js/tabs.js +0 -21
  216. data/doc-src/templates/default/fulldoc/html/setup.rb +0 -66
  217. data/doc-src/templates/default/layout/html/footer.erb +0 -29
  218. data/doc-src/templates/default/layout/html/layout.erb +0 -37
  219. data/doc-src/templates/default/layout/html/setup.rb +0 -3
  220. data/features/autoscaling/client.feature +0 -18
  221. data/features/autoscaling/step_definitions.rb +0 -6
  222. data/features/cloudformation/client.feature +0 -17
  223. data/features/cloudformation/step_definitions.rb +0 -6
  224. data/features/cloudfront/client.feature +0 -17
  225. data/features/cloudfront/step_definitions.rb +0 -6
  226. data/features/cloudsearch/client.feature +0 -16
  227. data/features/cloudsearch/step_definitions.rb +0 -6
  228. data/features/cloudtrail/client.feature +0 -16
  229. data/features/cloudtrail/step_definitions.rb +0 -6
  230. data/features/cloudwatch/client.feature +0 -19
  231. data/features/cloudwatch/step_definitions.rb +0 -6
  232. data/features/cloudwatchlogs/client.feature +0 -17
  233. data/features/cloudwatchlogs/step_definitions.rb +0 -6
  234. data/features/cognitoidentity/client.feature +0 -17
  235. data/features/cognitoidentity/step_definitions.rb +0 -6
  236. data/features/cognitosync/client.feature +0 -16
  237. data/features/cognitosync/step_definitions.rb +0 -6
  238. data/features/datapipeline/client.feature +0 -16
  239. data/features/datapipeline/step_definitions.rb +0 -6
  240. data/features/directconnect/client.feature +0 -16
  241. data/features/directconnect/step_definitions.rb +0 -6
  242. data/features/dynamodb/client.feature +0 -17
  243. data/features/dynamodb/simplified.feature +0 -32
  244. data/features/dynamodb/step_definitions.rb +0 -11
  245. data/features/ec2/client.feature +0 -16
  246. data/features/ec2/step_definitions.rb +0 -6
  247. data/features/elasticache/client.feature +0 -16
  248. data/features/elasticache/step_definitions.rb +0 -6
  249. data/features/elasticbeanstalk/client.feature +0 -16
  250. data/features/elasticbeanstalk/step_definitions.rb +0 -6
  251. data/features/elasticloadbalancing/client.feature +0 -16
  252. data/features/elasticloadbalancing/step_definitions.rb +0 -6
  253. data/features/elastictranscoder/client.feature +0 -16
  254. data/features/elastictranscoder/step_definitions.rb +0 -6
  255. data/features/emr/client.feature +0 -16
  256. data/features/emr/step_definitions.rb +0 -6
  257. data/features/env.rb +0 -23
  258. data/features/glacier/client.feature +0 -17
  259. data/features/glacier/step_definitions.rb +0 -93
  260. data/features/glacier/upload.feature +0 -27
  261. data/features/iam/client.feature +0 -16
  262. data/features/iam/step_definitions.rb +0 -6
  263. data/features/importexport/client.feature +0 -16
  264. data/features/importexport/step_definitions.rb +0 -6
  265. data/features/kinesis/client.feature +0 -16
  266. data/features/kinesis/step_definitions.rb +0 -6
  267. data/features/opsworks/client.feature +0 -16
  268. data/features/opsworks/step_definitions.rb +0 -6
  269. data/features/rds/client.feature +0 -16
  270. data/features/rds/step_definitions.rb +0 -6
  271. data/features/redshift/client.feature +0 -16
  272. data/features/redshift/step_definitions.rb +0 -6
  273. data/features/route53/client.feature +0 -16
  274. data/features/route53/step_definitions.rb +0 -6
  275. data/features/s3/buckets.feature +0 -40
  276. data/features/s3/objects.feature +0 -37
  277. data/features/s3/step_definitions.rb +0 -165
  278. data/features/s3/test.png +0 -0
  279. data/features/ses/client.feature +0 -16
  280. data/features/ses/step_definitions.rb +0 -6
  281. data/features/simpledb/client.feature +0 -16
  282. data/features/simpledb/step_definitions.rb +0 -6
  283. data/features/sns/client.feature +0 -17
  284. data/features/sns/step_definitions.rb +0 -6
  285. data/features/sqs/client.feature +0 -21
  286. data/features/sqs/step_definitions.rb +0 -29
  287. data/features/step_definitions.rb +0 -94
  288. data/features/storagegateway/client.feature +0 -16
  289. data/features/storagegateway/step_definitions.rb +0 -6
  290. data/features/sts/client.feature +0 -17
  291. data/features/sts/step_definitions.rb +0 -6
  292. data/features/swf/client.feature +0 -17
  293. data/features/swf/step_definitions.rb +0 -6
  294. data/integration-test-config.json.sample +0 -3
  295. data/lib/aws/api/manifest.rb +0 -29
  296. data/lib/aws/api/manifest_builder.rb +0 -57
  297. data/lib/aws/client.rb +0 -241
  298. data/lib/aws/endpoint_provider.rb +0 -165
  299. data/lib/aws/plugins/response_paging.rb +0 -20
  300. data/lib/aws/plugins/s3_sse_cpk.rb +0 -42
  301. data/lib/aws/response_handler.rb +0 -38
  302. data/lib/aws/service.rb +0 -32
  303. data/lib/aws/signers/v4.rb.orig +0 -243
  304. data/lib/aws/version.rb +0 -3
  305. data/lib/aws/version.rb.orig +0 -7
  306. data/lib/aws.rb +0 -208
  307. data/lib/aws.rb.orig +0 -218
  308. data/spec/aws/client_spec.rb +0 -269
  309. data/spec/aws/credential_provider_chain_spec.rb +0 -120
  310. data/spec/aws/credentials_spec.rb +0 -47
  311. data/spec/aws/errors_spec.rb +0 -39
  312. data/spec/aws/iam_spec.rb +0 -17
  313. data/spec/aws/instance_profile_credentials_spec.rb +0 -94
  314. data/spec/aws/json/builder_spec.rb +0 -188
  315. data/spec/aws/json/parser_spec.rb +0 -214
  316. data/spec/aws/operations_spec.rb +0 -145
  317. data/spec/aws/pageable_response_spec.rb +0 -171
  318. data/spec/aws/plugins/global_configuration_spec.rb +0 -58
  319. data/spec/aws/plugins/region_endpoint_spec.rb +0 -86
  320. data/spec/aws/plugins/request_signer_spec.rb +0 -88
  321. data/spec/aws/plugins/retry_errors_spec.rb +0 -266
  322. data/spec/aws/plugins/s3_md5s_spec.rb +0 -84
  323. data/spec/aws/plugins/sqs_queue_urls_spec.rb +0 -42
  324. data/spec/aws/query/param_builder_spec.rb +0 -362
  325. data/spec/aws/query/param_list_spec.rb +0 -80
  326. data/spec/aws/query/param_spec.rb +0 -64
  327. data/spec/aws/s3_spec.rb +0 -79
  328. data/spec/aws/shared_credentials_spec.rb +0 -68
  329. data/spec/aws/signers/v4_spec.rb +0 -141
  330. data/spec/aws/structure_spec.rb +0 -166
  331. data/spec/aws/util_spec.rb +0 -60
  332. data/spec/aws/xml/builder_spec.rb +0 -412
  333. data/spec/aws/xml/parser_spec.rb +0 -723
  334. data/spec/aws_spec.rb +0 -94
  335. data/spec/fixtures/api/swf.json +0 -100
  336. data/spec/fixtures/credentials/mock_shared_credentials +0 -14
  337. data/spec/fixtures/operations/cloudfront/list_distributions.yml +0 -199
  338. data/spec/fixtures/operations/cloudfront/max_items.yml +0 -11
  339. data/spec/fixtures/operations/dynamodb/error_parsing.yml +0 -13
  340. data/spec/fixtures/operations/glacier/account_id_param.yml +0 -13
  341. data/spec/fixtures/operations/glacier/custom_account_id.yml +0 -11
  342. data/spec/fixtures/operations/glacier/default_account_id.yml +0 -10
  343. data/spec/fixtures/operations/glacier/error_parsing.yml +0 -10
  344. data/spec/fixtures/operations/glacier/get_job_output.yml +0 -23
  345. data/spec/fixtures/operations/glacier/list_vaults.yml +0 -24
  346. data/spec/fixtures/operations/iam/result_wrapped_elements.yml +0 -31
  347. data/spec/fixtures/operations/route53/change_resource_record_sets.yml +0 -18
  348. data/spec/fixtures/operations/s3/304_response.yml +0 -12
  349. data/spec/fixtures/operations/s3/400_response.yml +0 -12
  350. data/spec/fixtures/operations/s3/403_response.yml +0 -12
  351. data/spec/fixtures/operations/s3/404_response.yml +0 -12
  352. data/spec/fixtures/operations/s3/412_response_head.yml +0 -10
  353. data/spec/fixtures/operations/s3/comlete_multipart_upload_error.yml +0 -18
  354. data/spec/fixtures/operations/s3/content_type_header.yml +0 -12
  355. data/spec/fixtures/operations/s3/create_bucket_with_implied_location_constraint.yml +0 -23
  356. data/spec/fixtures/operations/s3/create_bucket_with_location_constraint.yml +0 -25
  357. data/spec/fixtures/operations/s3/create_bucket_without_location_constraint.yml +0 -9
  358. data/spec/fixtures/operations/s3/delete_objects.yml +0 -54
  359. data/spec/fixtures/operations/s3/error_parsing.yml +0 -17
  360. data/spec/fixtures/operations/s3/get_bucket_location.yml +0 -17
  361. data/spec/fixtures/operations/s3/get_bucket_location_classic.yml +0 -17
  362. data/spec/fixtures/operations/s3/get_bucket_policy.yml +0 -8
  363. data/spec/fixtures/operations/s3/head_bucket_with_dns_incompatible_name.yml +0 -12
  364. data/spec/fixtures/operations/s3/head_object.yml +0 -50
  365. data/spec/fixtures/operations/s3/list_buckets.yml +0 -41
  366. data/spec/fixtures/operations/s3/md5_checksum_disabled.yml +0 -10
  367. data/spec/fixtures/operations/s3/md5_checksum_enabled.yml +0 -8
  368. data/spec/fixtures/operations/swf/list_domains.yml +0 -20
  369. data/spec/fixtures/protocols/input/ec2.json +0 -383
  370. data/spec/fixtures/protocols/input/json.json +0 -47
  371. data/spec/fixtures/protocols/input/query.json +0 -335
  372. data/spec/fixtures/protocols/input/rest-json.json +0 -365
  373. data/spec/fixtures/protocols/input/rest-xml.json +0 -818
  374. data/spec/fixtures/protocols/output/ec2.json +0 -381
  375. data/spec/fixtures/protocols/output/json.json +0 -313
  376. data/spec/fixtures/protocols/output/query.json +0 -424
  377. data/spec/fixtures/protocols/output/rest-json.json +0 -486
  378. data/spec/fixtures/protocols/output/rest-xml.json +0 -486
  379. data/spec/protocols_spec.rb +0 -186
  380. data/spec/spec_helper.rb +0 -66
  381. data/tasks/docs.rake +0 -61
  382. data/tasks/handlers.rake +0 -98
  383. data/tasks/manifest.rake +0 -9
  384. data/tasks/test.rake +0 -30
  385. data/vendor/seahorse/.gitignore +0 -5
  386. data/vendor/seahorse/.simplecov +0 -4
  387. data/vendor/seahorse/.yardopts +0 -10
  388. data/vendor/seahorse/Gemfile +0 -17
  389. data/vendor/seahorse/LICENSE.txt +0 -12
  390. data/vendor/seahorse/README.md +0 -129
  391. data/vendor/seahorse/Rakefile +0 -7
  392. data/vendor/seahorse/lib/seahorse/client/plugins/api.rb +0 -11
  393. data/vendor/seahorse/seahorse.gemspec +0 -20
  394. data/vendor/seahorse/spec/fixtures/plugin.rb +0 -4
  395. data/vendor/seahorse/spec/seahorse/client/base_spec.rb +0 -299
  396. data/vendor/seahorse/spec/seahorse/client/configuration_spec.rb +0 -122
  397. data/vendor/seahorse/spec/seahorse/client/handler_builder_spec.rb +0 -159
  398. data/vendor/seahorse/spec/seahorse/client/handler_list_spec.rb +0 -232
  399. data/vendor/seahorse/spec/seahorse/client/handler_spec.rb +0 -40
  400. data/vendor/seahorse/spec/seahorse/client/http/headers_spec.rb +0 -213
  401. data/vendor/seahorse/spec/seahorse/client/http/request_spec.rb +0 -121
  402. data/vendor/seahorse/spec/seahorse/client/http/response_spec.rb +0 -77
  403. data/vendor/seahorse/spec/seahorse/client/logging/formatter_spec.rb +0 -185
  404. data/vendor/seahorse/spec/seahorse/client/logging/handler_spec.rb +0 -63
  405. data/vendor/seahorse/spec/seahorse/client/net_http/connection_pool_spec.rb +0 -10
  406. data/vendor/seahorse/spec/seahorse/client/net_http/handler_spec.rb +0 -242
  407. data/vendor/seahorse/spec/seahorse/client/param_converter_spec.rb +0 -308
  408. data/vendor/seahorse/spec/seahorse/client/param_validator_spec.rb +0 -275
  409. data/vendor/seahorse/spec/seahorse/client/plugin_list_spec.rb +0 -166
  410. data/vendor/seahorse/spec/seahorse/client/plugin_spec.rb +0 -118
  411. data/vendor/seahorse/spec/seahorse/client/plugins/content_length_spec.rb +0 -19
  412. data/vendor/seahorse/spec/seahorse/client/plugins/endpoint_spec.rb +0 -33
  413. data/vendor/seahorse/spec/seahorse/client/plugins/logging_spec.rb +0 -46
  414. data/vendor/seahorse/spec/seahorse/client/plugins/net_http_spec.rb +0 -70
  415. data/vendor/seahorse/spec/seahorse/client/plugins/operation_methods_spec.rb +0 -76
  416. data/vendor/seahorse/spec/seahorse/client/request_context_spec.rb +0 -105
  417. data/vendor/seahorse/spec/seahorse/client/request_spec.rb +0 -152
  418. data/vendor/seahorse/spec/seahorse/client/response_spec.rb +0 -95
  419. data/vendor/seahorse/spec/seahorse/client/xml/builder/xml_doc_spec.rb +0 -142
  420. data/vendor/seahorse/spec/seahorse/client/xml/builder_spec.rb +0 -10
  421. data/vendor/seahorse/spec/seahorse/model/api_spec.rb +0 -154
  422. data/vendor/seahorse/spec/seahorse/model/operation_spec.rb +0 -162
  423. data/vendor/seahorse/spec/seahorse/model/shape_map_spec.rb +0 -84
  424. data/vendor/seahorse/spec/seahorse/model/shapes_spec.rb +0 -522
  425. data/vendor/seahorse/spec/seahorse/util_spec.rb +0 -54
  426. data/vendor/seahorse/spec/seahorse/version_spec.rb +0 -11
  427. data/vendor/seahorse/spec/spec_helper.rb +0 -34
  428. data/vendor/seahorse/tasks/docs.rake +0 -11
  429. data/vendor/seahorse/tasks/test.rake +0 -15
  430. /data/apis/{autoscaling-2011-01-01.paginators.json → AutoScaling.paginators.json} +0 -0
  431. /data/apis/{cloudformation-2010-05-15.paginators.json → CloudFormation.paginators.json} +0 -0
  432. /data/apis/{cloudfront-2014-01-31.waiters.json → CloudFront.waiters.json} +0 -0
  433. /data/apis/{cloudsearch-2013-01-01.paginators.json → CloudSearch.paginators.json} +0 -0
  434. /data/apis/{cloudtrail-2013-11-01.paginators.json → CloudTrail.paginators.json} +0 -0
  435. /data/apis/{monitoring-2010-08-01.paginators.json → CloudWatch.paginators.json} +0 -0
  436. /data/apis/{logs-2014-03-28.paginators.json → CloudWatchLogs.paginators.json} +0 -0
  437. /data/apis/{datapipeline-2012-10-29.paginators.json → DataPipeline.paginators.json} +0 -0
  438. /data/apis/{directconnect-2012-10-25.paginators.json → DirectConnect.paginators.json} +0 -0
  439. /data/apis/{dynamodb-2012-08-10.waiters.json → DynamoDB.waiters.json} +0 -0
  440. /data/apis/{ec2-2014-06-15.paginators.json → EC2.paginators.json} +0 -0
  441. /data/apis/{ec2-2014-06-15.waiters.json → EC2.waiters.json} +0 -0
  442. /data/apis/{elasticmapreduce-2009-03-31.paginators.json → EMR.paginators.json} +0 -0
  443. /data/apis/{elasticache-2014-03-24.paginators.json → ElastiCache.paginators.json} +0 -0
  444. /data/apis/{elasticbeanstalk-2010-12-01.paginators.json → ElasticBeanstalk.paginators.json} +0 -0
  445. /data/apis/{elasticloadbalancing-2012-06-01.paginators.json → ElasticLoadBalancing.paginators.json} +0 -0
  446. /data/apis/{elastictranscoder-2012-09-25.paginators.json → ElasticTranscoder.paginators.json} +0 -0
  447. /data/apis/{glacier-2012-06-01.paginators.json → Glacier.paginators.json} +0 -0
  448. /data/apis/{glacier-2012-06-01.waiters.json → Glacier.waiters.json} +0 -0
  449. /data/apis/{iam-2010-05-08.paginators.json → IAM.paginators.json} +0 -0
  450. /data/apis/{importexport-2010-06-01.paginators.json → ImportExport.paginators.json} +0 -0
  451. /data/apis/{opsworks-2013-02-18.paginators.json → OpsWorks.paginators.json} +0 -0
  452. /data/apis/{rds-2013-01-10.paginators.json → RDS.paginators.json} +0 -0
  453. /data/apis/{rds-2013-09-09.waiters.json → RDS.waiters.json} +0 -0
  454. /data/apis/{redshift-2012-12-01.paginators.json → Redshift.paginators.json} +0 -0
  455. /data/apis/{redshift-2012-12-01.waiters.json → Redshift.waiters.json} +0 -0
  456. /data/apis/{route53-2013-04-01.paginators.json → Route53.paginators.json} +0 -0
  457. /data/apis/{s3-2006-03-01.waiters.json → S3.waiters.json} +0 -0
  458. /data/apis/{email-2010-12-01.paginators.json → SES.paginators.json} +0 -0
  459. /data/apis/{email-2010-12-01.waiters.json → SES.waiters.json} +0 -0
  460. /data/apis/{sns-2010-03-31.paginators.json → SNS.paginators.json} +0 -0
  461. /data/apis/{sns-2010-03-31.resources.json → SNS.resources.json} +0 -0
  462. /data/apis/{sqs-2012-11-05.paginators.json → SQS.paginators.json} +0 -0
  463. /data/apis/{swf-2012-01-25.paginators.json → SWF.paginators.json} +0 -0
  464. /data/apis/{sdb-2009-04-15.paginators.json → SimpleDB.paginators.json} +0 -0
  465. /data/apis/{storagegateway-2013-06-30.paginators.json → StorageGateway.paginators.json} +0 -0
  466. /data/apis/{support-2013-04-15.paginators.json → Support.paginators.json} +0 -0
  467. /data/lib/{aws → aws-sdk-core}/api/customizer.rb +0 -0
  468. /data/lib/{aws → aws-sdk-core}/credentials.rb +0 -0
  469. /data/lib/{aws → aws-sdk-core}/json/builder.rb +0 -0
  470. /data/lib/{aws → aws-sdk-core}/json/error_handler.rb +0 -0
  471. /data/lib/{aws → aws-sdk-core}/json/parser.rb +0 -0
  472. /data/lib/{aws → aws-sdk-core}/json/rest_handler.rb +0 -0
  473. /data/lib/{aws → aws-sdk-core}/json/rpc_body_handler.rb +0 -0
  474. /data/lib/{aws → aws-sdk-core}/json/rpc_headers_handler.rb +0 -0
  475. /data/lib/{aws → aws-sdk-core}/json/simple_body_handler.rb +0 -0
  476. /data/lib/{aws → aws-sdk-core}/paging/null_pager.rb +0 -0
  477. /data/lib/{aws → aws-sdk-core}/paging/null_provider.rb +0 -0
  478. /data/lib/{aws → aws-sdk-core}/paging/pager.rb +0 -0
  479. /data/lib/{aws → aws-sdk-core}/paging/provider.rb +0 -0
  480. /data/lib/{aws → aws-sdk-core}/plugins/dynamodb_extended_retries.rb +0 -0
  481. /data/lib/{aws → aws-sdk-core}/plugins/ec2_copy_encrypted_snapshot.rb +0 -0
  482. /data/lib/{aws → aws-sdk-core}/plugins/glacier_account_id.rb +0 -0
  483. /data/lib/{aws → aws-sdk-core}/plugins/glacier_api_version.rb +0 -0
  484. /data/lib/{aws → aws-sdk-core}/plugins/glacier_checksums.rb +0 -0
  485. /data/lib/{aws → aws-sdk-core}/plugins/protocols/ec2.rb +0 -0
  486. /data/lib/{aws → aws-sdk-core}/plugins/protocols/query.rb +0 -0
  487. /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_json.rb +0 -0
  488. /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_xml.rb +0 -0
  489. /data/lib/{aws → aws-sdk-core}/plugins/s3_bucket_dns.rb +0 -0
  490. /data/lib/{aws → aws-sdk-core}/plugins/s3_complete_multipart_upload_fix.rb +0 -0
  491. /data/lib/{aws → aws-sdk-core}/plugins/s3_get_bucket_location_fix.rb +0 -0
  492. /data/lib/{aws → aws-sdk-core}/plugins/s3_location_constraint.rb +0 -0
  493. /data/lib/{aws → aws-sdk-core}/plugins/s3_md5s.rb +0 -0
  494. /data/lib/{aws → aws-sdk-core}/plugins/s3_redirects.rb +0 -0
  495. /data/lib/{aws → aws-sdk-core}/plugins/sqs_queue_urls.rb +0 -0
  496. /data/lib/{aws → aws-sdk-core}/plugins/swf_read_timeouts.rb +0 -0
  497. /data/lib/{aws → aws-sdk-core}/query/ec2_param_builder.rb +0 -0
  498. /data/lib/{aws → aws-sdk-core}/query/param.rb +0 -0
  499. /data/lib/{aws → aws-sdk-core}/query/param_builder.rb +0 -0
  500. /data/lib/{aws → aws-sdk-core}/query/param_list.rb +0 -0
  501. /data/lib/{aws → aws-sdk-core}/rest_body_handler.rb +0 -0
  502. /data/lib/{aws → aws-sdk-core}/shared_credentials.rb +0 -0
  503. /data/lib/{aws → aws-sdk-core}/signers/base.rb +0 -0
  504. /data/lib/{aws → aws-sdk-core}/signers/handler.rb +0 -0
  505. /data/lib/{aws → aws-sdk-core}/signers/s3.rb +0 -0
  506. /data/lib/{aws → aws-sdk-core}/signers/v2.rb +0 -0
  507. /data/lib/{aws → aws-sdk-core}/signers/v3.rb +0 -0
  508. /data/lib/{aws → aws-sdk-core}/tree_hash.rb +0 -0
  509. /data/lib/{aws → aws-sdk-core}/xml/error_handler.rb +0 -0
  510. /data/lib/{aws → aws-sdk-core}/xml/rest_handler.rb +0 -0
  511. /data/{vendor/seahorse/lib → lib}/seahorse/client/block_io.rb +0 -0
  512. /data/{vendor/seahorse/lib → lib}/seahorse/client/configuration.rb +0 -0
  513. /data/{vendor/seahorse/lib → lib}/seahorse/client/handler.rb +0 -0
  514. /data/{vendor/seahorse/lib → lib}/seahorse/client/handler_builder.rb +0 -0
  515. /data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list_entry.rb +0 -0
  516. /data/{vendor/seahorse/lib → lib}/seahorse/client/http/headers.rb +0 -0
  517. /data/{vendor/seahorse/lib → lib}/seahorse/client/http/response.rb +0 -0
  518. /data/{vendor/seahorse/lib → lib}/seahorse/client/logging/formatter.rb +0 -0
  519. /data/{vendor/seahorse/lib → lib}/seahorse/client/logging/handler.rb +0 -0
  520. /data/{vendor/seahorse/lib → lib}/seahorse/client/managed_file.rb +0 -0
  521. /data/{vendor/seahorse/lib → lib}/seahorse/client/param_validator.rb +0 -0
  522. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugin.rb +0 -0
  523. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugin_list.rb +0 -0
  524. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/content_length.rb +0 -0
  525. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/json_simple.rb +0 -0
  526. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/logging.rb +0 -0
  527. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/net_http.rb +0 -0
  528. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/operation_methods.rb +0 -0
  529. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_conversion.rb +0 -0
  530. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_validation.rb +0 -0
  531. /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/raise_response_errors.rb +0 -0
  532. /data/{vendor/seahorse/lib → lib}/seahorse/client/request_context.rb +0 -0
  533. /data/{vendor/seahorse/lib → lib}/seahorse/model/api.rb +0 -0
  534. /data/{vendor/seahorse/lib → lib}/seahorse/model/operation.rb +0 -0
  535. /data/{vendor/seahorse/lib → lib}/seahorse/util.rb +0 -0
  536. /data/{vendor/seahorse/lib → lib}/seahorse/version.rb +0 -0
@@ -1,299 +0,0 @@
1
- require 'spec_helper'
2
- require 'ostruct'
3
-
4
- module Seahorse
5
- module Client
6
- describe Base do
7
-
8
- let(:api) {{
9
- 'operations' => {
10
- 'operation_name' => {},
11
- }
12
- }}
13
-
14
- let(:client_class) { Base.define(api: api) }
15
-
16
- let(:client) { client_class.new }
17
-
18
- let(:required_plugins) { Base::REQUIRED_PLUGINS }
19
-
20
- let(:plugin_a) { Class.new }
21
-
22
- let(:plugin_b) { Class.new }
23
-
24
- it 'is a HandlerBuilder' do
25
- expect(client).to be_kind_of(HandlerBuilder)
26
- end
27
-
28
- describe '#config' do
29
-
30
- it 'returns a Configuration struct' do
31
- expect(client.config).to be_kind_of(Struct)
32
- end
33
-
34
- it 'contains the client api' do
35
- expect(client.config.api).to be(client_class.api)
36
- end
37
-
38
- it 'passes constructor args to the config' do
39
- expect {
40
- client_class.new(foo: 'bar')
41
- }.to raise_error(ArgumentError, /invalid configuration option/)
42
- end
43
-
44
- end
45
-
46
- describe '#handlers' do
47
-
48
- it 'returns a HandlerList' do
49
- expect(client.handlers).to be_kind_of(HandlerList)
50
- end
51
-
52
- it 'builds a handler list from client plugins' do
53
- client_class.clear_plugins
54
- client_class.add_plugin(Plugins::NetHttp)
55
- expect(client.handlers.to_a).to eq([
56
- NetHttp::Handler,
57
- Plugins::Endpoint::Handler,
58
- ])
59
- end
60
-
61
- it 'defaults the send handler to a NetHttp::Handler' do
62
- expect(client.handlers.first).to be(NetHttp::Handler)
63
- end
64
-
65
- end
66
-
67
- describe '#build_request' do
68
-
69
- let(:request) { client.build_request('operation_name') }
70
-
71
- it 'returns a Request' do
72
- expect(request).to be_kind_of(Request)
73
- end
74
-
75
- it 'populates the request handlers' do
76
- expect(request.handlers.to_a).to eq(client.handlers.to_a)
77
- end
78
-
79
- it 'includes operation specific handlers in the handler list' do
80
- handler = double('handler')
81
- client.handler(handler, operations: ['operation_name'])
82
- request = client.build_request('operation_name')
83
- expect(request.handlers.to_a).to include(handler)
84
- end
85
-
86
- it 'populates the request context operation name' do
87
- request = client.build_request('operation_name')
88
- expect(request.context.operation_name).to eq('operation_name')
89
- end
90
-
91
- it 'stringifies the operation name' do
92
- request = client.build_request(:operation_name)
93
- expect(request.context.operation_name).to eq('operation_name')
94
- end
95
-
96
- it 'populates the request context params' do
97
- params = double('params')
98
- request = client.build_request('operation_name', params)
99
- expect(request.context.params).to be(params)
100
- end
101
-
102
- it 'defaults params to an empty hash' do
103
- request = client.build_request('operation_name')
104
- expect(request.context.params).to eq({})
105
- end
106
-
107
- it 'populates the request context configuration' do
108
- request = client.build_request('operation_name')
109
- expect(request.context.config).to be(client.config)
110
- end
111
-
112
- it 'raises an error for unknown operations' do
113
- expect {
114
- client.build_request('foo')
115
- }.to raise_error("unknown operation :foo")
116
- end
117
-
118
- end
119
-
120
- describe '.api' do
121
-
122
- it 'can be set' do
123
- api = Model::Api.new({})
124
- client_class = Class.new(Base)
125
- client_class.set_api(api)
126
- expect(client_class.api).to be(api)
127
- end
128
-
129
- it 'can be set as a hash, returning a Model::Api' do
130
- client_class = Class.new(Base)
131
- api = client_class.set_api({})
132
- expect(api).to be_kind_of(Model::Api)
133
- expect(api.definition).to eq(Model::Api.new({}).definition)
134
- end
135
-
136
- end
137
-
138
- describe '.define' do
139
-
140
- it 'creates a new client class' do
141
- client_class = Base.define
142
- expect(client_class.ancestors).to include(Client::Base)
143
- end
144
-
145
- it 'sets the api on the client class' do
146
- api = Model::Api.new({})
147
- client_class = Base.define(api: api)
148
- expect(client_class.api).to be(api)
149
- end
150
-
151
- it 'extends from subclasses of client' do
152
- klass1 = Base.define
153
- klass2 = klass1.define
154
- expect(klass2.ancestors).to include(klass1)
155
- expect(klass2.ancestors).to include(Client::Base)
156
- end
157
-
158
- it 'applies plugins passed in via :plugins' do
159
- client_class = Base.define(plugins: [plugin_a])
160
- expect(client_class.plugins).to include(plugin_a)
161
- end
162
-
163
- end
164
-
165
- describe '.add_plugin' do
166
-
167
- it 'adds plugins to the client' do
168
- client_class.add_plugin(plugin_a)
169
- expect(client_class.plugins).to include(plugin_a)
170
- end
171
-
172
- it 'does not add plugins to the client parent class' do
173
- subclass = Class.new(client_class)
174
- subclass.add_plugin(plugin_a)
175
- expect(client_class.plugins).to_not include(plugin_a)
176
- expect(subclass.plugins).to include(plugin_a)
177
- end
178
-
179
- end
180
-
181
- describe '.remove_plugin' do
182
-
183
- it 'removes a plugin from the client' do
184
- client_class.add_plugin(plugin_a)
185
- client_class.add_plugin(plugin_b)
186
- client_class.remove_plugin(plugin_a)
187
- expect(client_class.plugins).not_to include(plugin_a)
188
- expect(client_class.plugins).to include(plugin_b)
189
- end
190
-
191
- it 'does not remove plugins from the client parent class' do
192
- client_class.add_plugin(plugin_a)
193
- subclass = client_class.define
194
- subclass.remove_plugin(plugin_a)
195
- expect(client_class.plugins).to include(plugin_a)
196
- expect(subclass.plugins).not_to include(plugin_a)
197
- end
198
-
199
- end
200
-
201
- describe '.set_plugins' do
202
-
203
- it 'replaces existing plugins' do
204
- client_class.add_plugin(plugin_a)
205
- client_class.set_plugins([plugin_b])
206
- expect(client_class.plugins).to eq(required_plugins + [plugin_b])
207
- end
208
-
209
- end
210
-
211
- describe '.clear_plugins' do
212
-
213
- it 'removes all plugins' do
214
- client_class.add_plugin(plugin_a)
215
- client_class.clear_plugins
216
- expect(client_class.plugins).to eq(required_plugins + [])
217
- end
218
-
219
- end
220
-
221
- describe '.plugins' do
222
-
223
- it 'returns a list of plugins applied to the client' do
224
- expect(client_class.plugins).to be_kind_of(Array)
225
- end
226
-
227
- it 'returns a frozen list of plugins' do
228
- expect(client_class.plugins.frozen?).to eq(true)
229
- end
230
-
231
- it 'has a defualt list of plugins' do
232
- client_class = Class.new(Base)
233
- expect(client_class.plugins.to_a).to eq([
234
- Plugins::Api,
235
- Plugins::Endpoint,
236
- Plugins::NetHttp,
237
- Plugins::OperationMethods,
238
- Plugins::ParamConversion,
239
- Plugins::ParamValidation,
240
- Plugins::RaiseResponseErrors,
241
- ])
242
- end
243
-
244
- it 'add plugins specified in the api to the default plugins' do
245
- stub_const('Seahorse::Client::PluginA', plugin_a)
246
- api = { 'plugins' => ['Seahorse::Client::PluginA'] }
247
- client_class = Base.define(api: api)
248
- expect(client_class.plugins).to include(Plugins::NetHttp)
249
- expect(client_class.plugins).to include(Client::Plugins::NetHttp)
250
- end
251
-
252
- end
253
-
254
- describe '.new' do
255
-
256
- let(:plugin) {
257
- p = double('plugin')
258
- allow(p).to receive(:is_a?).with(kind_of(Class)).and_return(false)
259
- p
260
- }
261
-
262
- it 'instructs plugins to #before_initialize' do
263
- options = {}
264
- expect(plugin).to receive(:before_initialize).with(client_class, options)
265
- client_class.add_plugin(plugin)
266
- client_class.new(options)
267
- end
268
-
269
- it 'instructs plugins to #add_options' do
270
- expect(plugin).to receive(:add_options) do |config|
271
- config.add_option(:foo, 'bar')
272
- end
273
- client_class.add_plugin(plugin)
274
- expect(client_class.new.config.foo).to eq('bar')
275
- end
276
-
277
- it 'instructs plugins to #add_handlers' do
278
- expect(plugin).to receive(:add_handlers).
279
- with(kind_of(HandlerList), kind_of(Struct))
280
- client_class.add_plugin(plugin)
281
- client_class.new
282
- end
283
-
284
- it 'instructs plugins to #after_initialize' do
285
- expect(plugin).to receive(:after_initialize).with(kind_of(Client::Base))
286
- client_class.add_plugin(plugin)
287
- client_class.new
288
- end
289
-
290
- it 'does not call methods that plugin does not respond to' do
291
- plugin = Object.new
292
- client_class.add_plugin(plugin)
293
- client_class.new
294
- end
295
-
296
- end
297
- end
298
- end
299
- end
@@ -1,122 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Seahorse
4
- module Client
5
- describe Configuration do
6
-
7
- let(:config) { Configuration.new }
8
-
9
- describe '#add_option' do
10
-
11
- it 'defines a getter' do
12
- config.add_option(:name)
13
- expect(config.build!).to respond_to(:name)
14
- end
15
-
16
- it 'defaults the value to nil' do
17
- config.add_option(:name)
18
- expect(config.build!.name).to be(nil)
19
- end
20
-
21
- it 'accepts a default value' do
22
- config.add_option(:name, 'John Doe')
23
- expect(config.build!.name).to eq('John Doe')
24
- end
25
-
26
- it 'accepts blocks' do
27
- config.add_option(:name) { 'John Doe' }
28
- expect(config.build!.name).to eq('John Doe')
29
- end
30
-
31
- it 'accepts blocks with an arity of 1, yielding self' do
32
- config.add_option(:name) { 'John Doe' }
33
- config.add_option(:username) { |cfg| cfg.name.gsub(/\W+/, '').downcase }
34
- expect(config.build!.name).to eq('John Doe')
35
- expect(config.build!.username).to eq('johndoe')
36
- end
37
-
38
- it 'blocks can rely on other blocks' do
39
- config.add_option(:base) { 2 }
40
- config.add_option(:next) { |cfg| cfg.base * 2 }
41
- config.add_option(:last) { |cfg| cfg.next * 3 }
42
- cfg = config.build!
43
- expect(cfg.last).to eq(12)
44
- expect(cfg.next).to eq(4)
45
- expect(cfg.base).to eq(2)
46
- end
47
-
48
- it 'blocks work with supplied values' do
49
- config.add_option(:base) { 2 }
50
- config.add_option(:next) { |cfg| cfg.base * 2 }
51
- config.add_option(:last) { |cfg| cfg.next * 3 }
52
- cfg = config.build!(base: 1, next: 1)
53
- expect(cfg.base).to eq(1)
54
- expect(cfg.next).to eq(1)
55
- expect(cfg.last).to eq(3)
56
- end
57
-
58
- it 'replaces previous default values when called twice' do
59
- config.add_option(:name, 'abc')
60
- config.add_option(:name, 'xyz')
61
- expect(config.build!.name).to eq('xyz')
62
- end
63
-
64
- it 'returns self so it can be chained' do
65
- c = config.add_option(:name).add_option(:color)
66
- expect(c).to be(config)
67
- expect(c.build!.members).to eq([:color, :name])
68
- end
69
-
70
- end
71
-
72
- describe '#build!' do
73
-
74
- it 'returns a Struct' do
75
- expect(config.add_option(:opt).build!).to be_kind_of(Struct)
76
- end
77
-
78
- it 'accepts a hash of options' do
79
- config.add_option(:size, 'default')
80
- config.add_option(:color, 'default')
81
- cfg = config.build!(size: 'large', color: 'red')
82
- expect(cfg.size).to eq('large')
83
- expect(cfg.color).to eq('red')
84
- end
85
-
86
- it 'raises an argument error for uknown options' do
87
- config.add_option(:known)
88
- expect {
89
- config.build!(unknown: 'option')
90
- }.to raise_error(ArgumentError, /invalid configuration option/)
91
- end
92
-
93
- it 'resolves nested dependent options' do
94
- config.add_option(:base, 1)
95
- config.add_option(:top) { |cfg| cfg.middle }
96
- config.add_option(:middle) { |cfg| cfg.base }
97
- expect(config.build!.top).to eq(1)
98
- end
99
-
100
- it 'does not resolve procs passed as args' do
101
- value = lambda {}
102
- config.add_option(:proc, value)
103
- expect(config.build!.proc).to be(value)
104
- end
105
-
106
- it 'resolves defaults in LIFO order until a non-nil value is found' do
107
- # default cost is 10
108
- config.add_option(:cost) { 10 }
109
-
110
- # increase cost for red items
111
- config.add_option(:cost) { |cfg| cfg.color == 'red' ? 9001 : nil }
112
-
113
- config.add_option(:color)
114
-
115
- expect(config.build!(color: 'green').cost).to eq(10)
116
- expect(config.build!(color: 'red').cost).to eq(9001) # over 9000!
117
- end
118
-
119
- end
120
- end
121
- end
122
- end
@@ -1,159 +0,0 @@
1
- require 'spec_helper'
2
- require 'ostruct'
3
-
4
- module Seahorse
5
- module Client
6
- describe HandlerBuilder do
7
-
8
- let(:klass) {
9
- Class.new do
10
-
11
- include HandlerBuilder
12
-
13
- def initialize
14
- @handlers = HandlerList.new
15
- end
16
-
17
- attr_reader :handlers
18
-
19
- end
20
- }
21
-
22
- let(:obj) { klass.new }
23
-
24
- describe '#handler' do
25
-
26
- it 'registers a handler' do
27
- handler_class = Class.new(Handler)
28
- obj.handler(handler_class)
29
- expect(obj.handlers).to include(handler_class)
30
- end
31
-
32
- it 'accepts a step option' do
33
- handler1 = Class.new(Handler)
34
- handler2 = Class.new(Handler)
35
- obj.handler(handler1, step: :validate)
36
- obj.handler(handler2, step: :build)
37
- expect(obj.handlers).to include(handler1)
38
- expect(obj.handlers).to include(handler2)
39
- end
40
-
41
- it 'builds a handler from a block' do
42
- handler_class = obj.handler do |context|
43
- context
44
- end
45
- expect(handler_class.ancestors).to include(Handler)
46
- expect(handler_class.new.call('context')).to eq('context')
47
- end
48
-
49
- it 'accepts a step with the block' do
50
- obj.handler(step: :validate) do |context|
51
- context << :validate
52
- super(context)
53
- end
54
- obj.handler(step: :build) do |context|
55
- context << :build
56
- @handler.call(context)
57
- end
58
- obj.handler(step: :sign) do |context|
59
- context << :sign
60
- handler.call(context)
61
- end
62
- obj.handler(step: :send) do |context|
63
- context << :send
64
- context
65
- end
66
- resp = obj.handlers.to_stack.call([])
67
- expect(resp).to eq([:validate, :build, :sign, :send])
68
- end
69
-
70
- it 'returns the handler class' do
71
- handler_class = Class.new(Handler)
72
- expect(obj.handler(handler_class)).to be(handler_class)
73
- end
74
-
75
- end
76
-
77
- describe '#handle_request' do
78
-
79
- it 'passes the context to the block' do
80
- yielded = nil
81
- handler = obj.handle_request do |context|
82
- yielded = context
83
- end
84
- handler.new(->(_) { }).call('context')
85
- expect(yielded).to eq('context')
86
- end
87
-
88
- it 'calls the next handler in the stack reguardless of the return' do
89
- handler = obj.handle_request do |context|
90
- nil # still calls the next handler, despite the block return value
91
- end
92
- context = Object.new
93
- resp = handler.new(->(context) { context }).call(context)
94
- expect(resp).to be(context)
95
- end
96
-
97
- end
98
-
99
- describe '#handle_response' do
100
-
101
- it 'is called when the response is signaled complete' do
102
- called = false
103
- handler = obj.handle_response { |response| called = true }
104
- handler.new(->(_) { Response.new.tap {|r| r.context.http_response.status_code = 200 } }).call(nil)
105
- expect(called).to be(true)
106
- end
107
-
108
- it 'is not called if the response is not signaled complete' do
109
- called = false
110
- handler = obj.handle_response { |response| called = true }
111
- handler.new(->(_) { Response.new }).call(nil)
112
- expect(called).to be(false)
113
- end
114
-
115
- end
116
-
117
- describe 'naming handlers inside modules' do
118
-
119
- let(:mod) {
120
- Module.new do
121
- extend HandlerBuilder
122
- def self.handlers
123
- @handlers ||= HandlerList.new
124
- end
125
- end
126
- }
127
-
128
- it 'assigns the handler to a constant if a name is given' do
129
- expect(mod.const_defined?('MyHandler')).to be(false)
130
- handler_class = mod.handler('MyHandler') { |arg| }
131
- expect(mod::MyHandler).to be(handler_class)
132
- end
133
-
134
- it 'accepts the handler name as a symbol' do
135
- handler_class = mod.handler(:MyHandler) { |arg| }
136
- expect(mod::MyHandler).to be(handler_class)
137
- end
138
-
139
- it 'accepts a name and options at the same time' do
140
- mod.handler(:FirstSendHandler, step: :send) { |arg| }
141
- mod.handler(:SecondSendHandler, step: :send) { |arg| }
142
- expect(mod.handlers).not_to include(mod::FirstSendHandler)
143
- expect(mod.handlers).to include(mod::SecondSendHandler)
144
- end
145
-
146
- it 'can assign a name when calling handle_request' do
147
- handler_class = mod.handle_request(:MyHandler) { |arg| }
148
- expect(mod::MyHandler).to be(handler_class)
149
- end
150
-
151
- it 'can assign a name when calling handle_response' do
152
- handler_class = mod.handle_response(:MyHandler) { |arg| }
153
- expect(mod::MyHandler).to be(handler_class)
154
- end
155
-
156
- end
157
- end
158
- end
159
- end