aws-sdk-core 2.0.0.rc13 → 2.0.0.rc14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -7
  3. data/apis/s3-2006-03-01.api.json +27 -16
  4. data/bin/aws.rb +0 -1
  5. data/endpoints.json +7 -3
  6. data/lib/aws.rb +57 -40
  7. data/lib/aws/endpoint_provider.rb +5 -21
  8. data/lib/aws/plugins/global_configuration.rb +2 -5
  9. data/lib/aws/plugins/regional_endpoint.rb +1 -4
  10. data/lib/aws/plugins/request_signer.rb +8 -2
  11. data/lib/aws/plugins/response_paging.rb +1 -1
  12. data/lib/aws/plugins/s3_sse_cpk.rb +25 -4
  13. data/lib/aws/service.rb +1 -19
  14. data/lib/aws/service_builder.rb +56 -0
  15. data/lib/aws/version.rb +1 -1
  16. data/lib/aws/xml/builder.rb +3 -7
  17. data/{vendor/seahorse/lib → lib}/seahorse.rb +0 -0
  18. data/{vendor/seahorse/lib → lib}/seahorse/client/base.rb +0 -0
  19. data/{vendor/seahorse/lib → lib}/seahorse/client/block_io.rb +0 -0
  20. data/{vendor/seahorse/lib → lib}/seahorse/client/configuration.rb +0 -0
  21. data/{vendor/seahorse/lib → lib}/seahorse/client/handler.rb +0 -0
  22. data/{vendor/seahorse/lib → lib}/seahorse/client/handler_builder.rb +0 -0
  23. data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list.rb +0 -0
  24. data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list_entry.rb +0 -0
  25. data/{vendor/seahorse/lib → lib}/seahorse/client/http/error.rb +0 -0
  26. data/{vendor/seahorse/lib → lib}/seahorse/client/http/headers.rb +0 -0
  27. data/{vendor/seahorse/lib → lib}/seahorse/client/http/request.rb +1 -1
  28. data/{vendor/seahorse/lib → lib}/seahorse/client/http/response.rb +0 -0
  29. data/{vendor/seahorse/lib → lib}/seahorse/client/logging/formatter.rb +0 -0
  30. data/{vendor/seahorse/lib → lib}/seahorse/client/logging/handler.rb +0 -0
  31. data/{vendor/seahorse/lib → lib}/seahorse/client/managed_file.rb +0 -0
  32. data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/connection_pool.rb +0 -0
  33. data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/handler.rb +0 -0
  34. data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/patches.rb +0 -0
  35. data/{vendor/seahorse/lib → lib}/seahorse/client/param_converter.rb +0 -0
  36. data/{vendor/seahorse/lib → lib}/seahorse/client/param_validator.rb +0 -0
  37. data/{vendor/seahorse/lib → lib}/seahorse/client/plugin.rb +0 -0
  38. data/{vendor/seahorse/lib → lib}/seahorse/client/plugin_list.rb +0 -0
  39. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/api.rb +0 -0
  40. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/content_length.rb +0 -0
  41. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/endpoint.rb +23 -14
  42. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/json_simple.rb +0 -0
  43. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/logging.rb +0 -0
  44. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/net_http.rb +0 -0
  45. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/operation_methods.rb +0 -0
  46. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_conversion.rb +0 -0
  47. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_validation.rb +0 -0
  48. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/raise_response_errors.rb +0 -0
  49. data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/restful_bindings.rb +0 -0
  50. data/{vendor/seahorse/lib → lib}/seahorse/client/request.rb +0 -0
  51. data/{vendor/seahorse/lib → lib}/seahorse/client/request_context.rb +0 -0
  52. data/{vendor/seahorse/lib → lib}/seahorse/client/response.rb +0 -0
  53. data/{vendor/seahorse/lib → lib}/seahorse/client/xml/builder.rb +0 -0
  54. data/{vendor/seahorse/lib → lib}/seahorse/model/api.rb +0 -0
  55. data/{vendor/seahorse/lib → lib}/seahorse/model/operation.rb +0 -0
  56. data/{vendor/seahorse/lib → lib}/seahorse/model/shape_map.rb +0 -0
  57. data/{vendor/seahorse/lib → lib}/seahorse/model/shapes.rb +2 -2
  58. data/{vendor/seahorse/lib → lib}/seahorse/util.rb +0 -0
  59. data/{vendor/seahorse/lib → lib}/seahorse/version.rb +0 -0
  60. metadata +48 -49
  61. data/lib/aws/client_factory.rb +0 -251
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 316a6bcf420559fb4f1d2d0d4a419c5eabfca62f
4
- data.tar.gz: d658cd390c1996551dc8d5a2718b5949eeaa73cc
3
+ metadata.gz: 6a114b4f1b2952bcbc8fa69c0d2c1ee77d4b765a
4
+ data.tar.gz: 3e315c708aaa188211a0166108b65b00e5070fe4
5
5
  SHA512:
6
- metadata.gz: c88dd7bbf3c8f37030cb8d732e752929effc253ba1ddef29c917265c57e387dedbf4bc64132953752097e68edf5312e9b5a2a9f910e9ad288a55eb073e501344
7
- data.tar.gz: c3c02a802d170c10a00f6f5b465bd28ce030d096a428e1ddd4e8c644a8d9a5e9b101d49767563e1cda266ba551c87fd7026561e684112b8b319a2a99cbadd62b
6
+ metadata.gz: 72899869dde1fbddf3a7eb0fb61edf6616e3a15d97bc88e1820c8a04fa6256e1a3eee999ae45054534063bf820db61c690f4d4fd554700bf11e873e53ebfb2e8
7
+ data.tar.gz: 556e7a49dcad168eddbf0133db95945c4b979d4a03e8bcaf21f2a1fd13117caad0c570c33cded18f98a76fd9540900fb09cfbde9a29258427ff96c18ed74f605
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # AWS SDK Core [![Build Status](https://travis-ci.org/aws/aws-sdk-core-ruby.png?branch=master)](https://travis-ci.org/aws/aws-sdk-core-ruby) [![Code Climate](https://codeclimate.com/github/aws/aws-sdk-core-ruby.png)](https://codeclimate.com/github/aws/aws-sdk-core-ruby)
1
+ # AWS SDK Core [![Build Status](https://travis-ci.org/aws/aws-sdk-core-ruby.png?branch=master)](https://travis-ci.org/aws/aws-sdk-core-ruby) [![Code Climate](https://codeclimate.com/github/aws/aws-sdk-core-ruby.png)](https://codeclimate.com/github/aws/aws-sdk-core-ruby) [![Coverage Status](https://coveralls.io/repos/aws/aws-sdk-core-ruby/badge.png?branch=master)](https://coveralls.io/r/aws/aws-sdk-core-ruby?branch=master)
2
2
 
3
3
  This library is in a developer preview period.
4
4
 
@@ -9,7 +9,26 @@ than the clients in version 1 of the Ruby SDK.
9
9
 
10
10
  For version 1.0 of the Ruby SDK, see [aws/aws-sdk-ruby](http://github.com/aws/aws-sdk-ruby).
11
11
 
12
- ## 2.0.0.rc11 Upgrading Notes
12
+ #### 2.0.0.rc14 Upgrading Notes
13
+
14
+ RC14 simplifies the API versioning strategy. This may require small changes for
15
+ users that use the API version locking options. Also, there are minor changes
16
+ when configuring raw endpoints.
17
+
18
+ * Versioned client classes removed, e.g. `Aws::S3::Client::V20060301.new` should
19
+ be replaced with `Aws::S3::Client.new` The `:api_version` constructor option
20
+ is no longer accepted.
21
+
22
+ * Aws helper methods for client construction deprecated; For example,
23
+ calling `Aws.s3` will generate a deprecation warning. Call `Aws::S3::Client.new`
24
+ instead. Top-level helpers will be removed as of v2.0.0 final.
25
+
26
+ * When configuring an `:endpoint` directly, you must now specify the
27
+ HTTP scheme, e.g. "http://localhost:3000", instead of "localhost:3000".
28
+ Please note, this should only be done for testing. Normally you only
29
+ need to configure a `:region`.
30
+
31
+ #### 2.0.0.rc11 Upgrading Notes
13
32
 
14
33
  RC 11 requires a few minor updates. These should be the final public-facing
15
34
  changes before 2.0.0 final.
@@ -193,23 +212,24 @@ version.
193
212
 
194
213
  | Service Name | Service Class | API Versions |
195
214
  | ----------------------------------- | ------------------------- | ------------------------------ |
196
- | Amazon CloudFront | CloudFront | 2014-01-31 — 2014-05-31 |
197
- | Amazon CloudSearch | CloudSearch | 2011-02-01 — 2013-01-01 |
215
+ | Amazon CloudFront | CloudFront | 2014-05-31 |
216
+ | Amazon CloudSearch | CloudSearch | 2013-01-01 |
198
217
  | Amazon CloudSearch Domain | CloudSearchDomain | 2013-01-01 |
199
218
  | Amazon CloudWatch | CloudWatch | 2010-08-01 |
200
219
  | Amazon CloudWatch Logs | CloudWatchLogs | 2014-03-28 |
201
220
  | Amazon Cognito Identity | CognitoIdentity | 2014-06-30 |
202
221
  | Amazon Cognito Sync | CognitoSync | 2014-06-30 |
203
- | Amazon DynamoDB | DynamoDB | 2011-12-05 — 2012-08-10 |
222
+ | Amazon DynamoDB | DynamoDB | 2012-08-10 |
204
223
  | Amazon Elastic Compute Cloud | EC2 | 2014-06-15 |
205
224
  | Amazon Elastic MapReduce | EMR | 2009-03-31 |
206
225
  | Amazon Elastic Transcoder | ElasticTranscoder | 2012-09-25 |
207
- | Amazon ElastiCache | ElastiCache | 2014-03-24 |
226
+ | Amazon ElastiCache | ElastiCache | 2014-07-15 |
208
227
  | Amazon Glacier | Glacier | 2012-06-01 |
209
228
  | Amazon Kinesis | Kinesis | 2013-12-02 |
210
229
  | Amazon Redshift | Redshift | 2012-12-01 |
211
- | Amazon Relational Database Service | RDS | 2013-01-10 — 2013-09-09 |
230
+ | Amazon Relational Database Service | RDS | 2013-09-09 |
212
231
  | Amazon Route 53 | Route53 | 2013-04-01 |
232
+ | Amazon Route 53 Domains | Route53Domains | 2014-05-15 |
213
233
  | Amazon Simple Email Service | SES | 2010-12-01 |
214
234
  | Amazon Simple Notification Service | SNS | 2010-03-31 |
215
235
  | Amazon Simple Queue Service | SQS | 2012-11-05 |
@@ -6,7 +6,18 @@
6
6
  "globalEndpoint":"s3.amazonaws.com",
7
7
  "serviceAbbreviation":"Amazon S3",
8
8
  "serviceFullName":"Amazon Simple Storage Service",
9
- "signatureVersion":"s3",
9
+ "signatureVersion":"v4",
10
+ "v3Regions": [
11
+ "us-east-1",
12
+ "us-west-1",
13
+ "us-west-2",
14
+ "ap-northeast-1",
15
+ "ap-southeast-1",
16
+ "ap-southeast-2",
17
+ "sa-east-1",
18
+ "eu-west-1",
19
+ "us-gov-west-1"
20
+ ],
10
21
  "timestampFormat":"rfc822",
11
22
  "protocol":"rest-xml"
12
23
  },
@@ -15,7 +26,7 @@
15
26
  "name":"AbortMultipartUpload",
16
27
  "http":{
17
28
  "method":"DELETE",
18
- "requestUri":"/{Bucket}/{Key}"
29
+ "requestUri":"/{Bucket}/{Key+}"
19
30
  },
20
31
  "input":{"shape":"AbortMultipartUploadRequest"},
21
32
  "errors":[
@@ -32,7 +43,7 @@
32
43
  "name":"CompleteMultipartUpload",
33
44
  "http":{
34
45
  "method":"POST",
35
- "requestUri":"/{Bucket}/{Key}"
46
+ "requestUri":"/{Bucket}/{Key+}"
36
47
  },
37
48
  "input":{"shape":"CompleteMultipartUploadRequest"},
38
49
  "output":{"shape":"CompleteMultipartUploadOutput"},
@@ -43,7 +54,7 @@
43
54
  "name":"CopyObject",
44
55
  "http":{
45
56
  "method":"PUT",
46
- "requestUri":"/{Bucket}/{Key}"
57
+ "requestUri":"/{Bucket}/{Key+}"
47
58
  },
48
59
  "input":{"shape":"CopyObjectRequest"},
49
60
  "output":{"shape":"CopyObjectOutput"},
@@ -81,7 +92,7 @@
81
92
  "name":"CreateMultipartUpload",
82
93
  "http":{
83
94
  "method":"POST",
84
- "requestUri":"/{Bucket}/{Key}?uploads"
95
+ "requestUri":"/{Bucket}/{Key+}?uploads"
85
96
  },
86
97
  "input":{"shape":"CreateMultipartUploadRequest"},
87
98
  "output":{"shape":"CreateMultipartUploadOutput"},
@@ -153,7 +164,7 @@
153
164
  "name":"DeleteObject",
154
165
  "http":{
155
166
  "method":"DELETE",
156
- "requestUri":"/{Bucket}/{Key}"
167
+ "requestUri":"/{Bucket}/{Key+}"
157
168
  },
158
169
  "input":{"shape":"DeleteObjectRequest"},
159
170
  "output":{"shape":"DeleteObjectOutput"},
@@ -297,7 +308,7 @@
297
308
  "name":"GetObject",
298
309
  "http":{
299
310
  "method":"GET",
300
- "requestUri":"/{Bucket}/{Key}"
311
+ "requestUri":"/{Bucket}/{Key+}"
301
312
  },
302
313
  "input":{"shape":"GetObjectRequest"},
303
314
  "output":{"shape":"GetObjectOutput"},
@@ -315,7 +326,7 @@
315
326
  "name":"GetObjectAcl",
316
327
  "http":{
317
328
  "method":"GET",
318
- "requestUri":"/{Bucket}/{Key}?acl"
329
+ "requestUri":"/{Bucket}/{Key+}?acl"
319
330
  },
320
331
  "input":{"shape":"GetObjectAclRequest"},
321
332
  "output":{"shape":"GetObjectAclOutput"},
@@ -333,7 +344,7 @@
333
344
  "name":"GetObjectTorrent",
334
345
  "http":{
335
346
  "method":"GET",
336
- "requestUri":"/{Bucket}/{Key}?torrent"
347
+ "requestUri":"/{Bucket}/{Key+}?torrent"
337
348
  },
338
349
  "input":{"shape":"GetObjectTorrentRequest"},
339
350
  "output":{"shape":"GetObjectTorrentOutput"},
@@ -361,7 +372,7 @@
361
372
  "name":"HeadObject",
362
373
  "http":{
363
374
  "method":"HEAD",
364
- "requestUri":"/{Bucket}/{Key}"
375
+ "requestUri":"/{Bucket}/{Key+}"
365
376
  },
366
377
  "input":{"shape":"HeadObjectRequest"},
367
378
  "output":{"shape":"HeadObjectOutput"},
@@ -432,7 +443,7 @@
432
443
  "name":"ListParts",
433
444
  "http":{
434
445
  "method":"GET",
435
- "requestUri":"/{Bucket}/{Key}"
446
+ "requestUri":"/{Bucket}/{Key+}"
436
447
  },
437
448
  "input":{"shape":"ListPartsRequest"},
438
449
  "output":{"shape":"ListPartsOutput"},
@@ -543,7 +554,7 @@
543
554
  "name":"PutObject",
544
555
  "http":{
545
556
  "method":"PUT",
546
- "requestUri":"/{Bucket}/{Key}"
557
+ "requestUri":"/{Bucket}/{Key+}"
547
558
  },
548
559
  "input":{"shape":"PutObjectRequest"},
549
560
  "output":{"shape":"PutObjectOutput"},
@@ -554,7 +565,7 @@
554
565
  "name":"PutObjectAcl",
555
566
  "http":{
556
567
  "method":"PUT",
557
- "requestUri":"/{Bucket}/{Key}?acl"
568
+ "requestUri":"/{Bucket}/{Key+}?acl"
558
569
  },
559
570
  "input":{"shape":"PutObjectAclRequest"},
560
571
  "errors":[
@@ -571,7 +582,7 @@
571
582
  "name":"RestoreObject",
572
583
  "http":{
573
584
  "method":"POST",
574
- "requestUri":"/{Bucket}/{Key}?restore"
585
+ "requestUri":"/{Bucket}/{Key+}?restore"
575
586
  },
576
587
  "input":{"shape":"RestoreObjectRequest"},
577
588
  "errors":[
@@ -589,7 +600,7 @@
589
600
  "name":"UploadPart",
590
601
  "http":{
591
602
  "method":"PUT",
592
- "requestUri":"/{Bucket}/{Key}"
603
+ "requestUri":"/{Bucket}/{Key+}"
593
604
  },
594
605
  "input":{"shape":"UploadPartRequest"},
595
606
  "output":{"shape":"UploadPartOutput"},
@@ -600,7 +611,7 @@
600
611
  "name":"UploadPartCopy",
601
612
  "http":{
602
613
  "method":"PUT",
603
- "requestUri":"/{Bucket}/{Key}"
614
+ "requestUri":"/{Bucket}/{Key+}"
604
615
  },
605
616
  "input":{"shape":"UploadPartCopyRequest"},
606
617
  "output":{"shape":"UploadPartCopyOutput"},
data/bin/aws.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  root = File.dirname(File.dirname(__FILE__))
4
4
  $:.unshift(File.join(root, 'lib'))
5
- $:.unshift(File.join(root, 'vendor', 'seahorse', 'lib'))
6
5
 
7
6
  require 'rubygems'
8
7
  require 'optparse'
data/endpoints.json CHANGED
@@ -6,13 +6,11 @@
6
6
  {
7
7
  "services": ["iam", "sts"],
8
8
  "config": {
9
- "signatureVersion": "v4",
10
9
  "endpoint": "{scheme}://{service}.cn-north-1.amazonaws.com.cn"
11
10
  }
12
11
  },
13
12
  {
14
13
  "config": {
15
- "signatureVersion": "v4",
16
14
  "endpoint": "{scheme}://{service}.{region}.amazonaws.com.cn"
17
15
  }
18
16
  }
@@ -29,8 +27,14 @@
29
27
  }
30
28
  },
31
29
  {
30
+ "services": ["s3"],
32
31
  "config": {
33
- "endpoint": "{scheme}://{service}.{region}.us-gov.amazonaws.com"
32
+ "endpoint": "{scheme}://{service}-{region}.amazonaws.com"
33
+ }
34
+ },
35
+ {
36
+ "config": {
37
+ "endpoint": "{scheme}://{service}.{region}.amazonaws.com"
34
38
  }
35
39
  }
36
40
  ]
data/lib/aws.rb CHANGED
@@ -8,7 +8,10 @@ module Aws
8
8
 
9
9
  @config = {}
10
10
 
11
- autoload :ClientFactory, "#{SRC}/client_factory"
11
+ @services = {}
12
+
13
+ @service_added_callbacks = []
14
+
12
15
  autoload :CredentialProviderChain, "#{SRC}/credential_provider_chain"
13
16
  autoload :Credentials, "#{SRC}/credentials"
14
17
  autoload :EmptyStructure, "#{SRC}/empty_structure"
@@ -18,6 +21,7 @@ module Aws
18
21
  autoload :PageableResponse, "#{SRC}/pageable_response"
19
22
  autoload :RestBodyHandler, "#{SRC}/rest_body_handler"
20
23
  autoload :Service, "#{SRC}/service"
24
+ autoload :ServiceBuilder, "#{SRC}/service_builder"
21
25
  autoload :SharedCredentials, "#{SRC}/shared_credentials"
22
26
  autoload :Structure, "#{SRC}/structure"
23
27
  autoload :TreeHash, "#{SRC}/tree_hash"
@@ -133,8 +137,8 @@ module Aws
133
137
  # @param [Plugin] plugin
134
138
  # @return [void]
135
139
  def add_plugin(plugin)
136
- service_clients.each do |client|
137
- client.add_plugin(plugin)
140
+ client_classes.each do |client_class|
141
+ client_class.add_plugin(plugin)
138
142
  end
139
143
  end
140
144
 
@@ -143,68 +147,81 @@ module Aws
143
147
  # @param [Plugin] plugin
144
148
  # @return [void]
145
149
  def remove_plugin(plugin)
146
- service_clients.each do |client|
147
- client.remove_plugin(plugin)
150
+ client_classes.each do |client_class|
151
+ client_class.remove_plugin(plugin)
148
152
  end
149
153
  end
150
154
 
151
- # @return [Hash<Symbol,Module>]
152
155
  # @api private
153
- def service_modules
154
- @service_modules ||= {}
156
+ def services
157
+ @services
155
158
  end
156
159
 
157
160
  # @return [Array<Class>]
158
161
  # @api private
159
- def service_clients
160
- service_modules.map { |_,svc_mod| svc_mod.const_get(:Client) }
162
+ def client_classes
163
+ @services.values.map { |svc_module, options| svc_module.const_get(:Client) }
161
164
  end
162
165
 
163
- # Registers a new service interface. This method accepts a constant
164
- # (class name) for the new service class and map of API
165
- # versions.
166
+ # Yields to the given block for each service that has already been
167
+ # defined via {add_service}. Also yields to the given block for
168
+ # each new service added after the callback is registered.
169
+ # @api private
170
+ def service_added(&block)
171
+ callback = Proc.new
172
+ @services.each do |svc_name, (svc_module, options)|
173
+ callback.call(svc_name, svc_module, options)
174
+ end
175
+ @service_added_callbacks << callback
176
+ end
177
+
178
+ # Registers a new service. Creates a Client class and an Errors
179
+ # module.
166
180
  #
167
181
  # # register a new service & API version
168
182
  # Aws.add_service('S3', {
169
- # '2006-03-01' => {
170
- # 'api' => '/path/to/api.json',
171
- # 'paginators' => '/path/to/paginators.json',
172
- # }
173
- # }
183
+ # 'api' => '/path/to/api.json',
184
+ # 'paginators' => '/path/to/paginators.json',
185
+ # 'resources' => '/path/to/resources.json',
186
+ # })
174
187
  #
175
188
  # # create a versioned client
176
- # Aws::S3.new
177
- # #=> #<Aws::S3::V20060301>
189
+ # Aws::S3::Client.new
190
+ # #=> #<Aws::S3::Client>
178
191
  #
179
- # You can register multiple API versions for a service, and
192
+ # To register multiple API versions for the same service, use separate
193
+ # service names.
180
194
  #
181
- # @param [String] name The name of the new service class.
182
- # @param [Hash<YYYY-MM-DD,Hash>] versions A hash of API versions. Hash
183
- # keys are API version dates, and values are hashes of:
184
- # * 'api' - path to API defintion
185
- # * 'paginators' - path to paginator defintion
186
- # @return [class<Service>]
187
- def add_service(name, versions = {})
188
- identifier = name.to_s.downcase.to_sym
189
- svc = const_set(name, Service.define(identifier, versions))
190
- add_helper(identifier, svc)
191
- svc
195
+ # @param (see ServiceBuilder.new)
196
+ # @option (see ServiceBuilder.new)
197
+ # @return (see ServiceBuilder.new)
198
+ def add_service(svc_name, options = {})
199
+ identifier = svc_name.downcase.to_sym
200
+ svc_module = ServiceBuilder.new(identifier, options)
201
+ const_set(svc_name, svc_module)
202
+ @services[identifier] = [svc_module, options]
203
+ @service_added_callbacks.each do |callback|
204
+ callback.call(identifier, svc_module, options)
205
+ end
206
+ svc_module
192
207
  end
193
208
 
194
- private
209
+ end
195
210
 
196
- def add_helper(method_name, svc_mod)
197
- service_modules[method_name] = svc_mod
198
- define_method(method_name) do |options = {}|
199
- svc_mod.const_get(:Client).new(options)
211
+ service_added do |identifier, svc_module, _|
212
+ define_singleton_method(identifier) do |options={}|
213
+ unless instance_variable_get("@#{identifier}_warned")
214
+ instance_variable_set("@#{identifier}_warned", true)
215
+ warn(<<-MSG.strip)
216
+ Aws.#{identifier} deprecated as of v2.0.0.rc14 and will be removed as of v2.0.0.0 final; use #{svc_module.name}::Client.new() instead
217
+ MSG
200
218
  end
201
- module_function(method_name)
219
+ svc_module::Client.new(options)
202
220
  end
203
-
204
221
  end
205
222
 
206
223
  Api::Manifest.default_manifest.services.each do |service|
207
- add_service(service.name, service.versions)
224
+ add_service(service.name, service.versions.values.last)
208
225
  end
209
226
 
210
227
  end
@@ -17,7 +17,7 @@ module Aws
17
17
  if region_matches?(rule_group, options)
18
18
  rule_group['rules'].each do |rule|
19
19
  if service_matches?(rule, options)
20
- return apply_rule(rule, options)
20
+ return expand_endpoint(rule['config']['endpoint'], options)
21
21
  end
22
22
  end
23
23
  end
@@ -29,18 +29,14 @@ module Aws
29
29
  # optional placeholders. This is applied when rules match during
30
30
  # resolution. Valid placeholders include:
31
31
  #
32
- # * "{scheme}"
33
- # * "{region}"
34
- # * "{service}"
32
+ # * `{scheme}`
33
+ # * `{region}`
34
+ # * `{service}`
35
35
  #
36
36
  # An example pattern:
37
37
  #
38
38
  # "#{scheme}://{service}.{region}.amazonaws.com"
39
39
  #
40
- # @option options [String] :signature_version When resolving and a match
41
- # is found, this is returned with the resolved `:pattern`. This can be
42
- # used to provide per-endpoint overrides for the signature version.
43
- #
44
40
  # @option options [Integer] :priority (100) A number from 0 to 999.
45
41
  # Rules with lower number have a higher priority and are evaluated first.
46
42
  #
@@ -65,8 +61,6 @@ module Aws
65
61
  rule['services'] = options[:services] if options[:services]
66
62
  rule['config'] = {}
67
63
  rule['config']['endpoint'] = options[:pattern]
68
- rule['config']['signatureVersion'] = options[:signature_version] if
69
- options[:signature_version]
70
64
  {
71
65
  'priority' => options[:priority] || 100,
72
66
  'regionPrefix' => options[:region_prefix] || '',
@@ -82,17 +76,7 @@ module Aws
82
76
  rule['services'].nil? || rule['services'].include?(options[:service])
83
77
  end
84
78
 
85
- def apply_rule(rule, options)
86
- rule['config'].each.with_object({}) do |(key, value), result|
87
- if key == 'endpoint'
88
- result[:endpoint] = resolve_endpoint(value, options)
89
- else
90
- result[Seahorse::Util.underscore(key).to_sym] = value
91
- end
92
- end
93
- end
94
-
95
- def resolve_endpoint(pattern, options)
79
+ def expand_endpoint(pattern, options)
96
80
  pattern.gsub(/{\w+}/) { |match| options[match[1..-2].to_sym] }
97
81
  end
98
82