aws-sdk 1.6.6 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,15 +13,19 @@
13
13
 
14
14
  module AWS
15
15
  class Route53
16
+
17
+ # Client class for Route53.
16
18
  class Client < Core::RESTClient
17
19
 
20
+ define_client_methods('2012-02-29')
21
+
18
22
  # @private
19
23
  CACHEABLE_REQUESTS = Set[]
20
24
 
21
25
  ## client methods ##
22
26
 
27
+ # @!method change_resource_record_sets(options = {})
23
28
  # Calls the POST ChangeResourceRecordSets API operation.
24
- # @method change_resource_record_sets(options = {})
25
29
  # @param [Hash] options
26
30
  # * +:hosted_zone_id+ - *required* - (String) Alias resource record sets
27
31
  # only: The value of the hosted zone ID, CanonicalHostedZoneNameId, for
@@ -93,8 +97,8 @@ module AWS
93
97
  # * +:submitted_at+ - (Time)
94
98
  # * +:comment+ - (String)
95
99
 
100
+ # @!method create_hosted_zone(options = {})
96
101
  # Calls the POST CreateHostedZone API operation.
97
- # @method create_hosted_zone(options = {})
98
102
  # @param [Hash] options
99
103
  # * +:name+ - *required* - (String) The name of the domain. This must be
100
104
  # a fully-specified domain, for example, www.example.com. The trailing
@@ -137,8 +141,8 @@ module AWS
137
141
  # * +:delegation_set+ - (Hash)
138
142
  # * +:name_servers+ - (Array<String>)
139
143
 
144
+ # @!method delete_hosted_zone(options = {})
140
145
  # Calls the DELETE DeleteHostedZone API operation.
141
- # @method delete_hosted_zone(options = {})
142
146
  # @param [Hash] options
143
147
  # * +:id+ - *required* - (String) The ID of the request. Include this ID
144
148
  # in a call to GetChange to track when the change has propagated to all
@@ -152,8 +156,8 @@ module AWS
152
156
  # * +:submitted_at+ - (Time)
153
157
  # * +:comment+ - (String)
154
158
 
159
+ # @!method get_change(options = {})
155
160
  # Calls the GET GetChange API operation.
156
- # @method get_change(options = {})
157
161
  # @param [Hash] options
158
162
  # * +:id+ - *required* - (String) The ID of the change batch request. The
159
163
  # value that you specify here is the value that
@@ -168,8 +172,8 @@ module AWS
168
172
  # * +:submitted_at+ - (Time)
169
173
  # * +:comment+ - (String)
170
174
 
175
+ # @!method get_hosted_zone(options = {})
171
176
  # Calls the GET GetHostedZone API operation.
172
- # @method get_hosted_zone(options = {})
173
177
  # @param [Hash] options
174
178
  # * +:id+ - *required* - (String) The ID of the hosted zone for which you
175
179
  # want to get a list of the name servers in the delegation set.
@@ -186,8 +190,8 @@ module AWS
186
190
  # * +:delegation_set+ - (Hash)
187
191
  # * +:name_servers+ - (Array<String>)
188
192
 
193
+ # @!method list_hosted_zones(options = {})
189
194
  # Calls the GET ListHostedZones API operation.
190
- # @method list_hosted_zones(options = {})
191
195
  # @param [Hash] options
192
196
  # * +:marker+ - (String) If the request returned more than one page of
193
197
  # results, submit another request and specify the value of NextMarker
@@ -210,8 +214,8 @@ module AWS
210
214
  # * +:next_marker+ - (String)
211
215
  # * +:max_items+ - (Integer)
212
216
 
217
+ # @!method list_resource_record_sets(options = {})
213
218
  # Calls the GET ListResourceRecordSets API operation.
214
- # @method list_resource_record_sets(options = {})
215
219
  # @param [Hash] options
216
220
  # * +:hosted_zone_id+ - *required* - (String) The ID of the hosted zone
217
221
  # that contains the resource record sets that you want to get.
@@ -255,8 +259,6 @@ module AWS
255
259
 
256
260
  ## end client methods ##
257
261
 
258
- define_client_methods('2012-02-29')
259
-
260
262
  end
261
263
  end
262
264
  end
@@ -286,20 +286,42 @@ module AWS
286
286
  end
287
287
 
288
288
  # Enables versioning on this bucket.
289
+ #
290
+ # @option opts [String] :mfa_delete Set to 'Enabled' or 'Disabled'
291
+ # to control the state of MFA delete on the bucket versioning.
292
+ # Setting this option requires the :mfa option to also be set.
293
+ #
294
+ # @option opts [String] :mfa The serial number and current token code of
295
+ # the Multi-Factor Authentication (MFA) device for the user. Format
296
+ # is "SERIAL TOKEN" - with a space between the serial and token.
297
+ #
289
298
  # @return [nil]
290
- def enable_versioning
299
+ def enable_versioning(opts = {})
291
300
  client.set_bucket_versioning(
292
301
  :bucket_name => @name,
293
- :state => :enabled)
302
+ :state => :enabled,
303
+ :mfa_delete => opts[:mfa_delete],
304
+ :mfa => opts[:mfa])
294
305
  nil
295
306
  end
296
307
 
297
308
  # Suspends versioning on this bucket.
309
+ #
310
+ # @option opts [String] :mfa_delete Set to 'Enabled' or 'Disabled'
311
+ # to control the state of MFA delete on the bucket versioning.
312
+ # Setting this option requires the :mfa option to also be set.
313
+ #
314
+ # @option opts [String] :mfa The serial number and current token code of
315
+ # the Multi-Factor Authentication (MFA) device for the user. Format
316
+ # is "SERIAL TOKEN" - with a space between the serial and token.
317
+ #
298
318
  # @return [nil]
299
- def suspend_versioning
319
+ def suspend_versioning(opts = {})
300
320
  client.set_bucket_versioning(
301
321
  :bucket_name => @name,
302
- :state => :suspended)
322
+ :state => :suspended,
323
+ :mfa_delete => opts[:mfa_delete],
324
+ :mfa => opts[:mfa])
303
325
  nil
304
326
  end
305
327
 
@@ -428,20 +428,29 @@ module AWS
428
428
  # @param [Hash] options
429
429
  # @option options [required,String] :bucket_name
430
430
  # @option options [required,String] :state
431
+ # @option options [String] :mfa_delete
432
+ # @option options [String] :mfa
431
433
  # @return [Core::Response]
432
- bucket_method(:set_bucket_versioning, :put, 'versioning') do
434
+ bucket_method(:set_bucket_versioning, :put, 'versioning', :header_options => { :mfa => "x-amz-mfa" }) do
433
435
 
434
436
  configure_request do |req, options|
435
437
  state = options[:state].to_s.downcase.capitalize
436
438
  unless state =~ /^(Enabled|Suspended)$/
437
439
  raise ArgumentError, "invalid versioning state `#{state}`"
438
440
  end
441
+
442
+ # Leave validation of MFA options to S3
443
+ mfa_delete = options[:mfa_delete].to_s.downcase.capitalize if options[:mfa_delete]
444
+
445
+ # Generate XML request for versioning
446
+ req.body = Nokogiri::XML::Builder.new do |xml|
447
+ xml.VersioningConfiguration('xmlns' => XMLNS) do
448
+ xml.Status(state)
449
+ xml.MfaDelete(mfa_delete) if mfa_delete
450
+ end
451
+ end.doc.root.to_xml
452
+
439
453
  super(req, options)
440
- req.body = <<-XML.strip
441
- <VersioningConfiguration xmlns="#{XMLNS}">
442
- <Status>#{state}</Status>
443
- </VersioningConfiguration>
444
- XML
445
454
  end
446
455
 
447
456
  end
@@ -1201,7 +1201,7 @@ module AWS
1201
1201
 
1202
1202
  # @return [Boolean]
1203
1203
  def should_decrypt? options
1204
- options[:encryption_key]
1204
+ options[:encryption_key] or config.s3_encryption_key
1205
1205
  end
1206
1206
 
1207
1207
  # A small wrapper around client#get_object
@@ -1453,7 +1453,7 @@ module AWS
1453
1453
  cipher =
1454
1454
  decryption_materials(location) do |envelope_key, envelope_iv|
1455
1455
  envelope_key, envelope_iv =
1456
- decode_envelope_key(envelope_key, envelope_iv, options)
1456
+ decode_envelope_key(envelope_key, envelope_iv, encryption_key)
1457
1457
  get_aes_cipher(:decrypt, :CBC, envelope_key, envelope_iv)
1458
1458
  end
1459
1459
 
@@ -1465,10 +1465,10 @@ module AWS
1465
1465
  end
1466
1466
 
1467
1467
  # Decodes the envelope key for decryption
1468
- def decode_envelope_key envelope_key, envelope_iv, options
1468
+ def decode_envelope_key envelope_key, envelope_iv, encryption_key
1469
1469
  decrypted_key =
1470
1470
  begin
1471
- decrypt(decode64(envelope_key), options[:encryption_key])
1471
+ decrypt(decode64(envelope_key), encryption_key)
1472
1472
  rescue RuntimeError
1473
1473
  msg = "Master key used to decrypt data key is not correct."
1474
1474
  raise AWS::S3::Errors::IncorrectClientSideEncryptionKey, msg
@@ -17,6 +17,8 @@ module AWS
17
17
  # Client class for Amazon SimpleDB.
18
18
  class Client < Core::QueryClient
19
19
 
20
+ define_client_methods('2009-04-15')
21
+
20
22
  # @private
21
23
  REGION_US_E1 = 'sdb.amazonaws.com'
22
24
 
@@ -54,8 +56,8 @@ module AWS
54
56
 
55
57
  ## client methods ##
56
58
 
59
+ # @!method batch_delete_attributes(options = {})
57
60
  # Calls the BatchDeleteAttributes API operation.
58
- # @method batch_delete_attributes(options = {})
59
61
  # @param [Hash] options
60
62
  # * +:domain_name+ - *required* - (String) The name of the domain in
61
63
  # which the attributes are being deleted.
@@ -72,8 +74,8 @@ module AWS
72
74
  # * +:box_usage+ - (Numeric)
73
75
  # * +:response_id+ - (String)
74
76
 
77
+ # @!method batch_put_attributes(options = {})
75
78
  # Calls the BatchPutAttributes API operation.
76
- # @method batch_put_attributes(options = {})
77
79
  # @param [Hash] options
78
80
  # * +:domain_name+ - *required* - (String) The name of the domain in
79
81
  # which the attributes are being stored.
@@ -96,8 +98,8 @@ module AWS
96
98
  # * +:box_usage+ - (Numeric)
97
99
  # * +:response_id+ - (String)
98
100
 
101
+ # @!method create_domain(options = {})
99
102
  # Calls the CreateDomain API operation.
100
- # @method create_domain(options = {})
101
103
  # @param [Hash] options
102
104
  # * +:domain_name+ - *required* - (String) The name of the domain to
103
105
  # create. The name can range between 3 and 255 characters and can
@@ -109,8 +111,8 @@ module AWS
109
111
  # * +:box_usage+ - (Numeric)
110
112
  # * +:response_id+ - (String)
111
113
 
114
+ # @!method delete_attributes(options = {})
112
115
  # Calls the DeleteAttributes API operation.
113
- # @method delete_attributes(options = {})
114
116
  # @param [Hash] options
115
117
  # * +:domain_name+ - *required* - (String) The name of the domain in
116
118
  # which to perform the operation.
@@ -143,8 +145,8 @@ module AWS
143
145
  # * +:box_usage+ - (Numeric)
144
146
  # * +:response_id+ - (String)
145
147
 
148
+ # @!method delete_domain(options = {})
146
149
  # Calls the DeleteDomain API operation.
147
- # @method delete_domain(options = {})
148
150
  # @param [Hash] options
149
151
  # * +:domain_name+ - *required* - (String) The name of the domain to
150
152
  # delete.
@@ -155,8 +157,8 @@ module AWS
155
157
  # * +:box_usage+ - (Numeric)
156
158
  # * +:response_id+ - (String)
157
159
 
160
+ # @!method domain_metadata(options = {})
158
161
  # Calls the DomainMetadata API operation.
159
- # @method domain_metadata(options = {})
160
162
  # @param [Hash] options
161
163
  # * +:domain_name+ - *required* - (String) The name of the domain for
162
164
  # which to display the metadata of.
@@ -174,8 +176,8 @@ module AWS
174
176
  # * +:box_usage+ - (Numeric)
175
177
  # * +:response_id+ - (String)
176
178
 
179
+ # @!method get_attributes(options = {})
177
180
  # Calls the GetAttributes API operation.
178
- # @method get_attributes(options = {})
179
181
  # @param [Hash] options
180
182
  # * +:domain_name+ - *required* - (String) The name of the domain in
181
183
  # which to perform the operation.
@@ -198,8 +200,8 @@ module AWS
198
200
  # * +:box_usage+ - (Numeric)
199
201
  # * +:response_id+ - (String)
200
202
 
203
+ # @!method list_domains(options = {})
201
204
  # Calls the ListDomains API operation.
202
- # @method list_domains(options = {})
203
205
  # @param [Hash] options
204
206
  # * +:max_number_of_domains+ - (Integer) The maximum number of domain
205
207
  # names you want returned. The range is 1 to 100. The default setting
@@ -215,8 +217,8 @@ module AWS
215
217
  # * +:box_usage+ - (Numeric)
216
218
  # * +:response_id+ - (String)
217
219
 
220
+ # @!method put_attributes(options = {})
218
221
  # Calls the PutAttributes API operation.
219
- # @method put_attributes(options = {})
220
222
  # @param [Hash] options
221
223
  # * +:domain_name+ - *required* - (String) The name of the domain in
222
224
  # which to perform the operation.
@@ -250,8 +252,8 @@ module AWS
250
252
  # * +:box_usage+ - (Numeric)
251
253
  # * +:response_id+ - (String)
252
254
 
255
+ # @!method select(options = {})
253
256
  # Calls the Select API operation.
254
- # @method select(options = {})
255
257
  # @param [Hash] options
256
258
  # * +:select_expression+ - *required* - (String) The expression used to
257
259
  # query the domain.
@@ -280,8 +282,6 @@ module AWS
280
282
 
281
283
  ## end client methods ##
282
284
 
283
- define_client_methods('2009-04-15')
284
-
285
285
  end
286
286
  end
287
287
  end
@@ -17,6 +17,8 @@ module AWS
17
17
  # Client class for Amazon Simple E-mail Service (SES).
18
18
  class Client < Core::QueryClient
19
19
 
20
+ define_client_methods('2010-12-01')
21
+
20
22
  REGION_US_E1 = 'email.us-east-1.amazonaws.com'
21
23
 
22
24
  # @private
@@ -24,22 +26,22 @@ module AWS
24
26
 
25
27
  ## client methods ##
26
28
 
29
+ # @!method delete_identity(options = {})
27
30
  # Calls the DeleteIdentity API operation.
28
- # @method delete_identity(options = {})
29
31
  # @param [Hash] options
30
32
  # * +:identity+ - *required* - (String) The identity to be removed from
31
33
  # the list of identities for the AWS Account.
32
34
  # @return [Core::Response]
33
35
 
36
+ # @!method delete_verified_email_address(options = {})
34
37
  # Calls the DeleteVerifiedEmailAddress API operation.
35
- # @method delete_verified_email_address(options = {})
36
38
  # @param [Hash] options
37
39
  # * +:email_address+ - *required* - (String) An email address to be
38
40
  # removed from the list of verified addresses.
39
41
  # @return [Core::Response]
40
42
 
43
+ # @!method get_identity_dkim_attributes(options = {})
41
44
  # Calls the GetIdentityDkimAttributes API operation.
42
- # @method get_identity_dkim_attributes(options = {})
43
45
  # @param [Hash] options
44
46
  # * +:identities+ - *required* - (Array<String>) A list of one or more
45
47
  # verified identities - email addresses, domains, or both.
@@ -51,8 +53,8 @@ module AWS
51
53
  # * +:dkim_verification_status+ - (String)
52
54
  # * +:dkim_tokens+ - (Array<String>)
53
55
 
56
+ # @!method get_identity_notification_attributes(options = {})
54
57
  # Calls the GetIdentityNotificationAttributes API operation.
55
- # @method get_identity_notification_attributes(options = {})
56
58
  # @param [Hash] options
57
59
  # * +:identities+ - *required* - (Array<String>) A list of one or more
58
60
  # identities.
@@ -64,8 +66,8 @@ module AWS
64
66
  # * +:complaint_topic+ - (String)
65
67
  # * +:forwarding_enabled+ - (Boolean)
66
68
 
69
+ # @!method get_identity_verification_attributes(options = {})
67
70
  # Calls the GetIdentityVerificationAttributes API operation.
68
- # @method get_identity_verification_attributes(options = {})
69
71
  # @param [Hash] options
70
72
  # * +:identities+ - *required* - (Array<String>) A list of identities.
71
73
  # @return [Core::Response]
@@ -75,8 +77,8 @@ module AWS
75
77
  # * +:verification_status+ - (String)
76
78
  # * +:verification_token+ - (String)
77
79
 
80
+ # @!method get_send_quota(options = {})
78
81
  # Calls the GetSendQuota API operation.
79
- # @method get_send_quota(options = {})
80
82
  # @param [Hash] options
81
83
  # @return [Core::Response]
82
84
  # The #data method of the response object returns
@@ -85,8 +87,8 @@ module AWS
85
87
  # * +:max_send_rate+ - (Numeric)
86
88
  # * +:sent_last_24_hours+ - (Numeric)
87
89
 
90
+ # @!method get_send_statistics(options = {})
88
91
  # Calls the GetSendStatistics API operation.
89
- # @method get_send_statistics(options = {})
90
92
  # @param [Hash] options
91
93
  # @return [Core::Response]
92
94
  # The #data method of the response object returns
@@ -98,8 +100,8 @@ module AWS
98
100
  # * +:complaints+ - (Integer)
99
101
  # * +:rejects+ - (Integer)
100
102
 
103
+ # @!method list_identities(options = {})
101
104
  # Calls the ListIdentities API operation.
102
- # @method list_identities(options = {})
103
105
  # @param [Hash] options
104
106
  # * +:identity_type+ - (String) The type of the identities to list.
105
107
  # Possible values are "EmailAddress" and "Domain". If this parameter
@@ -113,16 +115,16 @@ module AWS
113
115
  # * +:identities+ - (Array<String>)
114
116
  # * +:next_token+ - (String)
115
117
 
118
+ # @!method list_verified_email_addresses(options = {})
116
119
  # Calls the ListVerifiedEmailAddresses API operation.
117
- # @method list_verified_email_addresses(options = {})
118
120
  # @param [Hash] options
119
121
  # @return [Core::Response]
120
122
  # The #data method of the response object returns
121
123
  # a hash with the following structure:
122
124
  # * +:verified_email_addresses+ - (Array<String>)
123
125
 
126
+ # @!method send_email(options = {})
124
127
  # Calls the SendEmail API operation.
125
- # @method send_email(options = {})
126
128
  # @param [Hash] options
127
129
  # * +:source+ - *required* - (String) The identity's email address.
128
130
  # * +:destination+ - *required* - (Hash) The destination for this
@@ -167,8 +169,8 @@ module AWS
167
169
  # a hash with the following structure:
168
170
  # * +:message_id+ - (String)
169
171
 
172
+ # @!method send_raw_email(options = {})
170
173
  # Calls the SendRawEmail API operation.
171
- # @method send_raw_email(options = {})
172
174
  # @param [Hash] options
173
175
  # * +:source+ - (String) The identity's email address. If you specify
174
176
  # the Source parameter, then bounce notifications and complaints will
@@ -195,8 +197,8 @@ module AWS
195
197
  # a hash with the following structure:
196
198
  # * +:message_id+ - (String)
197
199
 
200
+ # @!method set_identity_dkim_enabled(options = {})
198
201
  # Calls the SetIdentityDkimEnabled API operation.
199
- # @method set_identity_dkim_enabled(options = {})
200
202
  # @param [Hash] options
201
203
  # * +:identity+ - *required* - (String) The identity for which DKIM
202
204
  # signing should be enabled or disabled.
@@ -205,8 +207,8 @@ module AWS
205
207
  # for this identity; +false+ to disable it.
206
208
  # @return [Core::Response]
207
209
 
210
+ # @!method set_identity_feedback_forwarding_enabled(options = {})
208
211
  # Calls the SetIdentityFeedbackForwardingEnabled API operation.
209
- # @method set_identity_feedback_forwarding_enabled(options = {})
210
212
  # @param [Hash] options
211
213
  # * +:identity+ - *required* - (String) The identity for which to set
212
214
  # feedback notification forwarding. Examples: user@example.com,
@@ -221,8 +223,8 @@ module AWS
221
223
  # topic types.
222
224
  # @return [Core::Response]
223
225
 
226
+ # @!method set_identity_notification_topic(options = {})
224
227
  # Calls the SetIdentityNotificationTopic API operation.
225
- # @method set_identity_notification_topic(options = {})
226
228
  # @param [Hash] options
227
229
  # * +:identity+ - *required* - (String) The identity for which the
228
230
  # topic will be set. Examples: user@example.com, example.com.
@@ -234,8 +236,8 @@ module AWS
234
236
  # the topic is cleared and publishing is disabled.
235
237
  # @return [Core::Response]
236
238
 
239
+ # @!method verify_domain_dkim(options = {})
237
240
  # Calls the VerifyDomainDkim API operation.
238
- # @method verify_domain_dkim(options = {})
239
241
  # @param [Hash] options
240
242
  # * +:domain+ - *required* - (String) The name of the domain to be
241
243
  # verified for Easy DKIM signing.
@@ -244,8 +246,8 @@ module AWS
244
246
  # a hash with the following structure:
245
247
  # * +:dkim_tokens+ - (Array<String>)
246
248
 
249
+ # @!method verify_domain_identity(options = {})
247
250
  # Calls the VerifyDomainIdentity API operation.
248
- # @method verify_domain_identity(options = {})
249
251
  # @param [Hash] options
250
252
  # * +:domain+ - *required* - (String) The domain to be verified.
251
253
  # @return [Core::Response]
@@ -253,15 +255,15 @@ module AWS
253
255
  # a hash with the following structure:
254
256
  # * +:verification_token+ - (String)
255
257
 
258
+ # @!method verify_email_address(options = {})
256
259
  # Calls the VerifyEmailAddress API operation.
257
- # @method verify_email_address(options = {})
258
260
  # @param [Hash] options
259
261
  # * +:email_address+ - *required* - (String) The email address to be
260
262
  # verified.
261
263
  # @return [Core::Response]
262
264
 
265
+ # @!method verify_email_identity(options = {})
263
266
  # Calls the VerifyEmailIdentity API operation.
264
- # @method verify_email_identity(options = {})
265
267
  # @param [Hash] options
266
268
  # * +:email_address+ - *required* - (String) The email address to be
267
269
  # verified.
@@ -269,8 +271,6 @@ module AWS
269
271
 
270
272
  ## end client methods ##
271
273
 
272
- define_client_methods('2010-12-01')
273
-
274
274
  end
275
275
  end
276
276
  end