aws-sdk 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/.yardopts +0 -1
  2. data/lib/aws/api_config/AutoScaling-2011-01-01.yml +772 -544
  3. data/lib/aws/api_config/CloudFormation-2010-05-15.yml +284 -185
  4. data/lib/aws/api_config/DynamoDB-2011-12-05.yml +458 -738
  5. data/lib/aws/api_config/EC2-2011-12-15.yml +3502 -2653
  6. data/lib/aws/api_config/ELB-2011-08-15.yml +484 -352
  7. data/lib/aws/api_config/IAM-2010-05-08.yml +899 -711
  8. data/lib/aws/api_config/SNS-2010-03-31.yml +235 -167
  9. data/lib/aws/api_config/SQS-2011-10-01.yml +290 -251
  10. data/lib/aws/api_config/STS-2011-06-15.yml +35 -41
  11. data/lib/aws/api_config/SimpleDB-2009-04-15.yml +290 -263
  12. data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +144 -130
  13. data/lib/aws/api_config/SimpleWorkflow-2012-01-25.yml +697 -1139
  14. data/lib/aws/auto_scaling/activity_collection.rb +1 -1
  15. data/lib/aws/auto_scaling/client.rb +724 -9
  16. data/lib/aws/auto_scaling/errors.rb +1 -5
  17. data/lib/aws/auto_scaling/group.rb +1 -1
  18. data/lib/aws/auto_scaling/group_collection.rb +1 -1
  19. data/lib/aws/auto_scaling/instance_collection.rb +1 -1
  20. data/lib/aws/auto_scaling/launch_configuration.rb +1 -1
  21. data/lib/aws/auto_scaling/launch_configuration_collection.rb +1 -1
  22. data/lib/aws/auto_scaling/notification_configuration_collection.rb +1 -1
  23. data/lib/aws/auto_scaling/request.rb +1 -2
  24. data/lib/aws/auto_scaling/scaling_policy_collection.rb +1 -1
  25. data/lib/aws/auto_scaling/scheduled_action_collection.rb +3 -3
  26. data/lib/aws/auto_scaling/tag_collection.rb +1 -1
  27. data/lib/aws/cloud_formation.rb +1 -18
  28. data/lib/aws/cloud_formation/client.rb +314 -8
  29. data/lib/aws/cloud_formation/errors.rb +1 -5
  30. data/lib/aws/cloud_formation/request.rb +1 -2
  31. data/lib/aws/cloud_formation/stack.rb +4 -3
  32. data/lib/aws/cloud_formation/stack_collection.rb +2 -2
  33. data/lib/aws/cloud_formation/stack_resource_collection.rb +1 -1
  34. data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +2 -2
  35. data/lib/aws/cloud_formation/stack_summary_collection.rb +1 -1
  36. data/lib/aws/core.rb +29 -14
  37. data/lib/aws/core/async_handle.rb +11 -12
  38. data/lib/aws/core/client.rb +112 -102
  39. data/lib/aws/core/client/query_json.rb +110 -0
  40. data/lib/aws/core/client/query_xml.rb +122 -0
  41. data/lib/aws/core/data.rb +242 -0
  42. data/lib/aws/core/http/request.rb +7 -4
  43. data/lib/aws/core/lazy_error_classes.rb +60 -38
  44. data/lib/aws/core/option_grammar.rb +1 -0
  45. data/lib/aws/core/policy.rb +2 -1
  46. data/lib/aws/core/resource.rb +38 -33
  47. data/lib/aws/core/response.rb +109 -44
  48. data/lib/aws/core/signature/version_2.rb +42 -0
  49. data/lib/aws/core/signature/version_3.rb +73 -0
  50. data/lib/aws/core/signature/version_3_http.rb +72 -0
  51. data/lib/aws/core/signature/version_4.rb +138 -0
  52. data/lib/aws/core/uri_escape.rb +6 -9
  53. data/lib/aws/core/xml/frame.rb +242 -0
  54. data/lib/aws/core/xml/frame_stack.rb +85 -0
  55. data/lib/aws/core/xml/grammar.rb +299 -0
  56. data/lib/aws/core/xml/parser.rb +70 -0
  57. data/lib/aws/core/xml/root_frame.rb +65 -0
  58. data/lib/aws/core/{configured_xml_grammars.rb → xml/sax_handlers/libxml.rb} +22 -20
  59. data/lib/aws/core/xml/sax_handlers/nokogiri.rb +55 -0
  60. data/lib/aws/core/{authorize_with_session_token.rb → xml/sax_handlers/ox.rb} +19 -7
  61. data/lib/aws/core/{configured_option_grammars.rb → xml/sax_handlers/rexml.rb} +22 -23
  62. data/lib/aws/core/xml/stub.rb +123 -0
  63. data/lib/aws/dynamo_db/batch_get.rb +1 -1
  64. data/lib/aws/dynamo_db/client.rb +796 -14
  65. data/lib/aws/dynamo_db/errors.rb +1 -38
  66. data/lib/aws/dynamo_db/item_collection.rb +29 -28
  67. data/lib/aws/dynamo_db/request.rb +3 -53
  68. data/lib/aws/dynamo_db/table.rb +6 -2
  69. data/lib/aws/ec2/attachment.rb +1 -1
  70. data/lib/aws/ec2/client.rb +3954 -9
  71. data/lib/aws/ec2/dhcp_options.rb +3 -3
  72. data/lib/aws/ec2/errors.rb +10 -4
  73. data/lib/aws/ec2/instance.rb +7 -6
  74. data/lib/aws/ec2/instance_collection.rb +2 -2
  75. data/lib/aws/ec2/key_pair_collection.rb +3 -3
  76. data/lib/aws/ec2/network_acl.rb +4 -2
  77. data/lib/aws/ec2/network_acl/entry.rb +10 -10
  78. data/lib/aws/ec2/network_interface.rb +2 -3
  79. data/lib/aws/ec2/network_interface/attachment.rb +8 -8
  80. data/lib/aws/ec2/permission_collection.rb +3 -3
  81. data/lib/aws/ec2/request.rb +1 -3
  82. data/lib/aws/ec2/resource_tag_collection.rb +4 -8
  83. data/lib/aws/ec2/route_table.rb +3 -2
  84. data/lib/aws/ec2/route_table/route.rb +7 -7
  85. data/lib/aws/ec2/security_group.rb +2 -2
  86. data/lib/aws/ec2/security_group/egress_ip_permission_collection.rb +16 -5
  87. data/lib/aws/ec2/security_group/ingress_ip_permission_collection.rb +4 -3
  88. data/lib/aws/ec2/security_group/ip_permission.rb +1 -2
  89. data/lib/aws/ec2/snapshot_collection.rb +6 -3
  90. data/lib/aws/ec2/subnet.rb +1 -1
  91. data/lib/aws/ec2/volume.rb +1 -3
  92. data/lib/aws/ec2/volume_collection.rb +2 -0
  93. data/lib/aws/elb/availability_zone_collection.rb +2 -2
  94. data/lib/aws/elb/backend_server_policy_collection.rb +1 -1
  95. data/lib/aws/elb/client.rb +513 -9
  96. data/lib/aws/elb/errors.rb +2 -6
  97. data/lib/aws/elb/instance_collection.rb +2 -2
  98. data/lib/aws/elb/request.rb +1 -1
  99. data/lib/aws/errors.rb +61 -74
  100. data/lib/aws/iam.rb +2 -3
  101. data/lib/aws/iam/client.rb +1178 -10
  102. data/lib/aws/iam/collection.rb +2 -1
  103. data/lib/aws/iam/errors.rb +1 -6
  104. data/lib/aws/iam/group.rb +8 -9
  105. data/lib/aws/iam/request.rb +1 -1
  106. data/lib/aws/iam/server_certificate_collection.rb +8 -5
  107. data/lib/aws/iam/signing_certificate.rb +1 -1
  108. data/lib/aws/iam/user.rb +2 -2
  109. data/lib/aws/iam/user_policy.rb +3 -2
  110. data/lib/aws/rails.rb +1 -2
  111. data/lib/aws/record.rb +3 -3
  112. data/lib/aws/record/abstract_base.rb +0 -3
  113. data/lib/aws/record/attributes.rb +7 -7
  114. data/lib/aws/record/model.rb +19 -19
  115. data/lib/aws/record/model/finder_methods.rb +7 -7
  116. data/lib/aws/s3/bucket.rb +7 -2
  117. data/lib/aws/s3/client.rb +391 -398
  118. data/lib/aws/s3/client/xml.rb +44 -71
  119. data/lib/aws/s3/data_options.rb +3 -2
  120. data/lib/aws/s3/errors.rb +8 -11
  121. data/lib/aws/s3/multipart_upload_collection.rb +1 -3
  122. data/lib/aws/s3/object_collection.rb +2 -1
  123. data/lib/aws/s3/object_metadata.rb +2 -2
  124. data/lib/aws/s3/paginated_collection.rb +2 -2
  125. data/lib/aws/s3/prefix_and_delimiter_collection.rb +1 -1
  126. data/lib/aws/s3/presigned_post.rb +18 -17
  127. data/lib/aws/s3/request.rb +4 -3
  128. data/lib/aws/s3/s3_object.rb +8 -10
  129. data/lib/aws/simple_db/attribute.rb +2 -2
  130. data/lib/aws/simple_db/attribute_collection.rb +14 -4
  131. data/lib/aws/simple_db/client.rb +313 -14
  132. data/lib/aws/simple_db/domain.rb +1 -1
  133. data/lib/aws/simple_db/domain_collection.rb +4 -4
  134. data/lib/aws/simple_db/domain_metadata.rb +1 -1
  135. data/lib/aws/simple_db/errors.rb +14 -2
  136. data/lib/aws/simple_db/expect_condition_option.rb +1 -1
  137. data/lib/aws/simple_db/item.rb +1 -1
  138. data/lib/aws/simple_db/item_collection.rb +9 -9
  139. data/lib/aws/simple_db/item_data.rb +9 -6
  140. data/lib/aws/simple_db/request.rb +1 -1
  141. data/lib/aws/simple_email_service.rb +8 -7
  142. data/lib/aws/simple_email_service/client.rb +174 -9
  143. data/lib/aws/simple_email_service/email_address_collection.rb +0 -1
  144. data/lib/aws/simple_email_service/errors.rb +1 -5
  145. data/lib/aws/simple_email_service/quotas.rb +8 -6
  146. data/lib/aws/simple_email_service/request.rb +7 -1
  147. data/lib/aws/simple_workflow/client.rb +1383 -6
  148. data/lib/aws/simple_workflow/decision_task.rb +1 -3
  149. data/lib/aws/simple_workflow/errors.rb +1 -38
  150. data/lib/aws/simple_workflow/history_event_collection.rb +2 -2
  151. data/lib/aws/simple_workflow/request.rb +5 -49
  152. data/lib/aws/simple_workflow/type.rb +1 -1
  153. data/lib/aws/simple_workflow/type_collection.rb +4 -3
  154. data/lib/aws/simple_workflow/workflow_execution_collection.rb +2 -2
  155. data/lib/aws/sns/client.rb +345 -9
  156. data/lib/aws/sns/errors.rb +1 -5
  157. data/lib/aws/sns/request.rb +1 -2
  158. data/lib/aws/sns/subscription_collection.rb +2 -2
  159. data/lib/aws/sns/topic.rb +15 -14
  160. data/lib/aws/sns/topic_collection.rb +1 -1
  161. data/lib/aws/sqs/client.rb +334 -9
  162. data/lib/aws/sqs/errors.rb +1 -6
  163. data/lib/aws/sqs/queue.rb +20 -21
  164. data/lib/aws/sqs/queue_collection.rb +3 -3
  165. data/lib/aws/sqs/request.rb +2 -2
  166. data/lib/aws/sts.rb +8 -10
  167. data/lib/aws/sts/client.rb +67 -10
  168. data/lib/aws/sts/errors.rb +1 -5
  169. data/lib/aws/sts/request.rb +1 -1
  170. data/lib/user.rb +49 -0
  171. metadata +21 -28
  172. data/lib/aws/auto_scaling/client/xml.rb +0 -32
  173. data/lib/aws/cloud_formation/client/xml.rb +0 -32
  174. data/lib/aws/core/api_config.rb +0 -44
  175. data/lib/aws/core/authorize_v2.rb +0 -39
  176. data/lib/aws/core/authorize_v3.rb +0 -38
  177. data/lib/aws/core/authorize_v4.rb +0 -149
  178. data/lib/aws/core/configured_client_methods.rb +0 -76
  179. data/lib/aws/core/configured_grammars.rb +0 -63
  180. data/lib/aws/core/configured_json_client_methods.rb +0 -74
  181. data/lib/aws/core/ignore_result_element.rb +0 -34
  182. data/lib/aws/core/json_client.rb +0 -41
  183. data/lib/aws/core/xml_grammar.rb +0 -957
  184. data/lib/aws/ec2/client/xml.rb +0 -175
  185. data/lib/aws/elb/client/xml.rb +0 -33
  186. data/lib/aws/elb/listener_spec.rb +0 -14
  187. data/lib/aws/iam/client/xml.rb +0 -34
  188. data/lib/aws/simple_db/client/options.rb +0 -32
  189. data/lib/aws/simple_db/client/xml.rb +0 -63
  190. data/lib/aws/simple_email_service/client/xml.rb +0 -34
  191. data/lib/aws/sns/client/xml.rb +0 -34
  192. data/lib/aws/sqs/client/xml.rb +0 -33
  193. data/lib/aws/sts/client/xml.rb +0 -34
@@ -13,13 +13,9 @@
13
13
 
14
14
  module AWS
15
15
  class SQS
16
-
17
16
  module Errors
18
17
 
19
- # @private
20
- BASE_ERROR_GRAMMAR = Client::XML::BaseError
21
-
22
- include Core::LazyErrorClasses
18
+ extend Core::LazyErrorClasses
23
19
 
24
20
  # @private
25
21
  def self.error_class(code)
@@ -100,7 +96,6 @@ module AWS
100
96
  attr_reader :failures
101
97
 
102
98
  end
103
-
104
99
  end
105
100
  end
106
101
  end
data/lib/aws/sqs/queue.rb CHANGED
@@ -111,8 +111,8 @@ module AWS
111
111
  response = client.send_message(client_opts)
112
112
 
113
113
  msg = SentMessage.new
114
- msg.message_id = response.message_id
115
- msg.md5 = response.md5_of_message_body
114
+ msg.message_id = response[:message_id]
115
+ msg.md5 = response[:md5_of_message_body]
116
116
  msg
117
117
 
118
118
  end
@@ -172,11 +172,11 @@ module AWS
172
172
  def receive_message(opts = {}, &block)
173
173
  resp = client.receive_message(receive_opts(opts))
174
174
 
175
- messages = resp.messages.map do |m|
176
- ReceivedMessage.new(self, m.message_id, m.receipt_handle,
177
- :body => m.body,
178
- :md5 => m.md5_of_body,
179
- :attributes => m.attributes)
175
+ messages = resp[:messages].map do |m|
176
+ ReceivedMessage.new(self, m[:message_id], m[:receipt_handle],
177
+ :body => m[:body],
178
+ :md5 => m[:md5_of_body],
179
+ :attributes => m[:attributes])
180
180
  end
181
181
 
182
182
  if block
@@ -498,10 +498,10 @@ module AWS
498
498
 
499
499
  failed = batch_failures(entries, response)
500
500
 
501
- sent = response.successful.collect do |sent|
501
+ sent = response[:successful].collect do |sent|
502
502
  msg = SentMessage.new
503
- msg.message_id = sent.message_id
504
- msg.md5 = sent.md5_of_message_body
503
+ msg.message_id = sent[:message_id]
504
+ msg.md5 = sent[:md5_of_message_body]
505
505
  msg
506
506
  end
507
507
 
@@ -511,7 +511,7 @@ module AWS
511
511
 
512
512
  end
513
513
 
514
- # @param [ReceivedMessage,String] message A list of up to 10 messages
514
+ # @param [ReceivedMessage,String] messages A list of up to 10 messages
515
515
  # to delete. Each message should be a {ReceivedMessage} object
516
516
  # or a received message handle (string).
517
517
  #
@@ -629,14 +629,14 @@ module AWS
629
629
 
630
630
  protected
631
631
  def batch_failures entries, response
632
- response.failed.inject([]) do |failures, failure|
632
+ response[:failed].inject([]) do |failures, failure|
633
633
 
634
- entry = entries.find{|e| e[:id] == failure.id }
634
+ entry = entries.find{|e| e[:id] == failure[:id] }
635
635
 
636
636
  details = {
637
- :error_code => failure.code,
638
- :error_message => failure.message,
639
- :sender_fault => failure.sender_fault?,
637
+ :error_code => failure[:code],
638
+ :error_message => failure[:message],
639
+ :sender_fault => failure[:sender_fault],
640
640
  }
641
641
 
642
642
  if handle = entry[:receipt_handle]
@@ -713,11 +713,10 @@ module AWS
713
713
  # @private
714
714
  protected
715
715
  def set_attribute(name, value)
716
- client.set_queue_attributes(:queue_url => url,
717
- :attribute => {
718
- :name => name,
719
- :value => value
720
- })
716
+ client.set_queue_attributes({
717
+ :queue_url => url,
718
+ :attributes => { name => value },
719
+ })
721
720
  end
722
721
 
723
722
  end
@@ -105,7 +105,7 @@ module AWS
105
105
 
106
106
  response = client.create_queue(client_opts)
107
107
 
108
- Queue.new(response.queue_url, :config => config)
108
+ Queue.new(response[:queue_url], :config => config)
109
109
 
110
110
  end
111
111
 
@@ -113,7 +113,7 @@ module AWS
113
113
  def each(&block)
114
114
  options = {}
115
115
  options[:queue_name_prefix] = prefix if prefix
116
- client.list_queues(options).queue_urls.each do |url|
116
+ client.list_queues(options)[:queue_urls].each do |url|
117
117
  queue = self[url]
118
118
  yield(queue)
119
119
  end
@@ -161,7 +161,7 @@ module AWS
161
161
  def url_for queue_name, options = {}
162
162
  client_opts = {}
163
163
  client_opts[:queue_name] = queue_name
164
- client.get_queue_url(client_opts.merge(options)).queue_url
164
+ client.get_queue_url(client_opts.merge(options))[:queue_url]
165
165
  end
166
166
 
167
167
  end
@@ -17,8 +17,7 @@ module AWS
17
17
  # @private
18
18
  class Request < Core::Http::Request
19
19
 
20
- include Core::AuthorizeV2
21
- include Core::AuthorizeWithSessionToken
20
+ include Core::Signature::Version2
22
21
 
23
22
  def path
24
23
  full_url.path
@@ -29,6 +28,7 @@ module AWS
29
28
  end
30
29
 
31
30
  private
31
+
32
32
  def full_url
33
33
  if url_param = params.find { |p| p.name == "QueueUrl" }
34
34
  URI.parse(url_param.value)
data/lib/aws/sts.rb CHANGED
@@ -120,9 +120,11 @@ module AWS
120
120
  opts[:policy] = opts[:policy].to_json
121
121
  end
122
122
  get_session(:get_federation_token, opts) do |resp, session_opts|
123
- session_opts.merge!(:user_id => resp.federated_user.federated_user_id,
124
- :user_arn => resp.federated_user.arn,
125
- :packed_policy_size => resp.packed_policy_size)
123
+ session_opts.merge!(
124
+ :user_id => resp[:federated_user][:federated_user_id],
125
+ :user_arn => resp[:federated_user][:arn],
126
+ :packed_policy_size => resp[:packed_policy_size]
127
+ )
126
128
  FederatedSession.new(session_opts)
127
129
  end
128
130
  end
@@ -133,14 +135,10 @@ module AWS
133
135
  opts[:duration_seconds] = opts.delete(:duration) if
134
136
  opts[:duration]
135
137
  resp = client.send(method, opts)
136
- credentials = resp.credentials
138
+ credentials = resp[:credentials].dup
137
139
  session_opts = {
138
- :credentials => {
139
- :access_key_id => credentials.access_key_id,
140
- :secret_access_key => credentials.secret_access_key,
141
- :session_token => credentials.session_token
142
- },
143
- :expires_at => credentials.expiration
140
+ :credentials => credentials,
141
+ :expires_at => credentials.delete(:expiration),
144
142
  }
145
143
  yield(resp, session_opts)
146
144
  end
@@ -14,22 +14,17 @@
14
14
  module AWS
15
15
  class STS
16
16
 
17
- # @private
17
+ # Client class for AWS Security Token Service (STS).
18
18
  class Client < Core::Client
19
19
 
20
- AWS.register_autoloads(self) do
21
- autoload :XML, 'xml'
22
- end
23
-
24
- include Core::ConfiguredClientMethods
25
-
26
20
  API_VERSION = '2011-06-15'
27
21
 
28
- REGION_US_E1 = 'sts.amazonaws.com'
22
+ extend Core::Client::QueryXML
29
23
 
30
- REQUEST_CLASS = STS::Request
24
+ REGION_US_E1 = 'sts.amazonaws.com'
31
25
 
32
- configure_client
26
+ # @private
27
+ CACHEABLE_REQUESTS = Set[]
33
28
 
34
29
  def initialize *args
35
30
  super
@@ -40,6 +35,68 @@ module AWS
40
35
  end
41
36
  end
42
37
 
38
+ ## client methods ##
39
+
40
+ # Calls the GetFederationToken API operation.
41
+ # @method get_federation_token(options = {})
42
+ #
43
+ # === Options:
44
+ #
45
+ # * +:name+ - *required* - (String) The name of the federated user
46
+ # associated with the session.
47
+ # * +:policy+ - (String) A policy specifying the permissions associated
48
+ # with the session. The caller can delegate their own permissions by
49
+ # specifying a policy for the session, and both policies will be
50
+ # checked when a service call is made. In other words, permissions of
51
+ # the session credentials are the intersection of the policy specified
52
+ # in the API and the policies associated with the user who issued the
53
+ # session.
54
+ # * +:duration_seconds+ - (Integer) The duration, in seconds, that the
55
+ # session should last. Acceptable durations for federation sessions
56
+ # range from 3600s (1 hour) to 129600s (36 hours), with 43200 as the
57
+ # default.
58
+ #
59
+ # === Response Structure:
60
+ #
61
+ # * +:credentials+ - (Hash)
62
+ # * +:access_key_id+ - (String)
63
+ # * +:secret_access_key+ - (String)
64
+ # * +:session_token+ - (String)
65
+ # * +:expiration+ - (Time)
66
+ # * +:federated_user+ - (Hash)
67
+ # * +:federated_user_id+ - (String)
68
+ # * +:arn+ - (String)
69
+ # * +:packed_policy_size+ - (Integer)
70
+ #
71
+ # @return [Core::Response]
72
+ #
73
+ define_client_method :get_federation_token, 'GetFederationToken'
74
+
75
+ # Calls the GetSessionToken API operation.
76
+ # @method get_session_token(options = {})
77
+ #
78
+ # === Options:
79
+ #
80
+ # * +:duration_seconds+ - (Integer) The duration, in seconds, that the
81
+ # session should last. Acceptable durations for IAM user sessions range
82
+ # from 3600s (1 hour) to 129600s (36 hours), with 43200 as the default.
83
+ # Sessions started for AWS Account owners are restricted to a maximum
84
+ # 3600s.
85
+ #
86
+ # === Response Structure:
87
+ #
88
+ # * +:credentials+ - (Hash)
89
+ # * +:access_key_id+ - (String)
90
+ # * +:secret_access_key+ - (String)
91
+ # * +:session_token+ - (String)
92
+ # * +:expiration+ - (Time)
93
+ #
94
+ # @return [Core::Response]
95
+ #
96
+ define_client_method :get_session_token, 'GetSessionToken'
97
+
98
+ ## end client methods ##
99
+
43
100
  end
44
101
  end
45
102
  end
@@ -13,13 +13,9 @@
13
13
 
14
14
  module AWS
15
15
  class STS
16
-
17
- # @private
18
16
  module Errors
19
17
 
20
- BASE_ERROR_GRAMMAR = Client::XML::BaseError
21
-
22
- include Core::LazyErrorClasses
18
+ extend Core::LazyErrorClasses
23
19
 
24
20
  end
25
21
  end
@@ -17,7 +17,7 @@ module AWS
17
17
  # @private
18
18
  class Request < Core::Http::Request
19
19
 
20
- include Core::AuthorizeV4
20
+ include Core::Signature::Version4
21
21
 
22
22
  def service
23
23
  'sts'
data/lib/user.rb ADDED
@@ -0,0 +1,49 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ class User < AWS::Record::HashModel
15
+
16
+ set_shard_name 'ruby-users'
17
+
18
+ optimistic_locking
19
+
20
+ ## attributes
21
+
22
+ string_attr :username
23
+ string_attr :role
24
+ string_attr :tags, :set => true
25
+
26
+ boolean_attr :verified, :default => false
27
+
28
+ timestamps
29
+
30
+ ## validations
31
+
32
+ validates_presence_of :username, :role
33
+
34
+ validates_inclusion_of :role,
35
+ :in => %w(root admin member),
36
+ :allow_nil => true
37
+
38
+ validates_length_of :username,
39
+ :within => 3..20,
40
+ :allow_nil => true
41
+
42
+ validates_format_of :username, :tags,
43
+ :with => /^[a-z0-9]+$/i,
44
+ :allow_nil => true,
45
+ :message => 'may only be letters and numbers'
46
+
47
+ validates_count_of :tags, :maximum => 3
48
+
49
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-19 00:00:00.000000000 Z
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uuidtools
@@ -85,7 +85,6 @@ files:
85
85
  - rails/init.rb
86
86
  - lib/aws/auto_scaling/activity.rb
87
87
  - lib/aws/auto_scaling/activity_collection.rb
88
- - lib/aws/auto_scaling/client/xml.rb
89
88
  - lib/aws/auto_scaling/client.rb
90
89
  - lib/aws/auto_scaling/config.rb
91
90
  - lib/aws/auto_scaling/errors.rb
@@ -107,7 +106,6 @@ files:
107
106
  - lib/aws/auto_scaling/tag.rb
108
107
  - lib/aws/auto_scaling/tag_collection.rb
109
108
  - lib/aws/auto_scaling.rb
110
- - lib/aws/cloud_formation/client/xml.rb
111
109
  - lib/aws/cloud_formation/client.rb
112
110
  - lib/aws/cloud_formation/config.rb
113
111
  - lib/aws/cloud_formation/errors.rb
@@ -124,24 +122,17 @@ files:
124
122
  - lib/aws/cloud_formation/stack_summary.rb
125
123
  - lib/aws/cloud_formation/stack_summary_collection.rb
126
124
  - lib/aws/cloud_formation.rb
127
- - lib/aws/core/api_config.rb
128
125
  - lib/aws/core/async_handle.rb
129
- - lib/aws/core/authorize_v2.rb
130
- - lib/aws/core/authorize_v3.rb
131
- - lib/aws/core/authorize_v4.rb
132
- - lib/aws/core/authorize_with_session_token.rb
133
126
  - lib/aws/core/autoloader.rb
134
127
  - lib/aws/core/cacheable.rb
128
+ - lib/aws/core/client/query_json.rb
129
+ - lib/aws/core/client/query_xml.rb
135
130
  - lib/aws/core/client.rb
136
131
  - lib/aws/core/collection/limitable.rb
137
132
  - lib/aws/core/collection/simple.rb
138
133
  - lib/aws/core/collection.rb
139
134
  - lib/aws/core/configuration.rb
140
- - lib/aws/core/configured_client_methods.rb
141
- - lib/aws/core/configured_grammars.rb
142
- - lib/aws/core/configured_json_client_methods.rb
143
- - lib/aws/core/configured_option_grammars.rb
144
- - lib/aws/core/configured_xml_grammars.rb
135
+ - lib/aws/core/data.rb
145
136
  - lib/aws/core/default_signer.rb
146
137
  - lib/aws/core/http/curb_handler.rb
147
138
  - lib/aws/core/http/handler.rb
@@ -149,10 +140,8 @@ files:
149
140
  - lib/aws/core/http/net_http_handler.rb
150
141
  - lib/aws/core/http/request.rb
151
142
  - lib/aws/core/http/response.rb
152
- - lib/aws/core/ignore_result_element.rb
153
143
  - lib/aws/core/indifferent_hash.rb
154
144
  - lib/aws/core/inflection.rb
155
- - lib/aws/core/json_client.rb
156
145
  - lib/aws/core/lazy_error_classes.rb
157
146
  - lib/aws/core/log_formatter.rb
158
147
  - lib/aws/core/meta_utils.rb
@@ -167,8 +156,21 @@ files:
167
156
  - lib/aws/core/response_cache.rb
168
157
  - lib/aws/core/service_interface.rb
169
158
  - lib/aws/core/session_signer.rb
159
+ - lib/aws/core/signature/version_2.rb
160
+ - lib/aws/core/signature/version_3.rb
161
+ - lib/aws/core/signature/version_3_http.rb
162
+ - lib/aws/core/signature/version_4.rb
170
163
  - lib/aws/core/uri_escape.rb
171
- - lib/aws/core/xml_grammar.rb
164
+ - lib/aws/core/xml/frame.rb
165
+ - lib/aws/core/xml/frame_stack.rb
166
+ - lib/aws/core/xml/grammar.rb
167
+ - lib/aws/core/xml/parser.rb
168
+ - lib/aws/core/xml/root_frame.rb
169
+ - lib/aws/core/xml/sax_handlers/libxml.rb
170
+ - lib/aws/core/xml/sax_handlers/nokogiri.rb
171
+ - lib/aws/core/xml/sax_handlers/ox.rb
172
+ - lib/aws/core/xml/sax_handlers/rexml.rb
173
+ - lib/aws/core/xml/stub.rb
172
174
  - lib/aws/core.rb
173
175
  - lib/aws/dynamo_db/attribute_collection.rb
174
176
  - lib/aws/dynamo_db/batch_get.rb
@@ -193,7 +195,6 @@ files:
193
195
  - lib/aws/ec2/availability_zone.rb
194
196
  - lib/aws/ec2/availability_zone_collection.rb
195
197
  - lib/aws/ec2/block_device_mappings.rb
196
- - lib/aws/ec2/client/xml.rb
197
198
  - lib/aws/ec2/client.rb
198
199
  - lib/aws/ec2/collection.rb
199
200
  - lib/aws/ec2/config.rb
@@ -263,7 +264,6 @@ files:
263
264
  - lib/aws/ec2.rb
264
265
  - lib/aws/elb/availability_zone_collection.rb
265
266
  - lib/aws/elb/backend_server_policy_collection.rb
266
- - lib/aws/elb/client/xml.rb
267
267
  - lib/aws/elb/client.rb
268
268
  - lib/aws/elb/config.rb
269
269
  - lib/aws/elb/errors.rb
@@ -271,7 +271,6 @@ files:
271
271
  - lib/aws/elb/listener.rb
272
272
  - lib/aws/elb/listener_collection.rb
273
273
  - lib/aws/elb/listener_opts.rb
274
- - lib/aws/elb/listener_spec.rb
275
274
  - lib/aws/elb/load_balancer.rb
276
275
  - lib/aws/elb/load_balancer_collection.rb
277
276
  - lib/aws/elb/load_balancer_policy.rb
@@ -282,7 +281,6 @@ files:
282
281
  - lib/aws/iam/access_key.rb
283
282
  - lib/aws/iam/access_key_collection.rb
284
283
  - lib/aws/iam/account_alias_collection.rb
285
- - lib/aws/iam/client/xml.rb
286
284
  - lib/aws/iam/client.rb
287
285
  - lib/aws/iam/collection.rb
288
286
  - lib/aws/iam/config.rb
@@ -377,8 +375,6 @@ files:
377
375
  - lib/aws/s3.rb
378
376
  - lib/aws/simple_db/attribute.rb
379
377
  - lib/aws/simple_db/attribute_collection.rb
380
- - lib/aws/simple_db/client/options.rb
381
- - lib/aws/simple_db/client/xml.rb
382
378
  - lib/aws/simple_db/client.rb
383
379
  - lib/aws/simple_db/config.rb
384
380
  - lib/aws/simple_db/consistent_read_option.rb
@@ -394,7 +390,6 @@ files:
394
390
  - lib/aws/simple_db/put_attributes.rb
395
391
  - lib/aws/simple_db/request.rb
396
392
  - lib/aws/simple_db.rb
397
- - lib/aws/simple_email_service/client/xml.rb
398
393
  - lib/aws/simple_email_service/client.rb
399
394
  - lib/aws/simple_email_service/config.rb
400
395
  - lib/aws/simple_email_service/email_address_collection.rb
@@ -426,7 +421,6 @@ files:
426
421
  - lib/aws/simple_workflow/workflow_type.rb
427
422
  - lib/aws/simple_workflow/workflow_type_collection.rb
428
423
  - lib/aws/simple_workflow.rb
429
- - lib/aws/sns/client/xml.rb
430
424
  - lib/aws/sns/client.rb
431
425
  - lib/aws/sns/config.rb
432
426
  - lib/aws/sns/errors.rb
@@ -439,7 +433,6 @@ files:
439
433
  - lib/aws/sns/topic_collection.rb
440
434
  - lib/aws/sns/topic_subscription_collection.rb
441
435
  - lib/aws/sns.rb
442
- - lib/aws/sqs/client/xml.rb
443
436
  - lib/aws/sqs/client.rb
444
437
  - lib/aws/sqs/config.rb
445
438
  - lib/aws/sqs/errors.rb
@@ -450,7 +443,6 @@ files:
450
443
  - lib/aws/sqs/received_sns_message.rb
451
444
  - lib/aws/sqs/request.rb
452
445
  - lib/aws/sqs.rb
453
- - lib/aws/sts/client/xml.rb
454
446
  - lib/aws/sts/client.rb
455
447
  - lib/aws/sts/config.rb
456
448
  - lib/aws/sts/errors.rb
@@ -464,6 +456,7 @@ files:
464
456
  - lib/net/http/connection_pool/connection.rb
465
457
  - lib/net/http/connection_pool/session.rb
466
458
  - lib/net/http/connection_pool.rb
459
+ - lib/user.rb
467
460
  - lib/aws/api_config/AutoScaling-2011-01-01.yml
468
461
  - lib/aws/api_config/CloudFormation-2010-05-15.yml
469
462
  - lib/aws/api_config/DynamoDB-2011-12-05.yml
@@ -496,7 +489,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
496
489
  version: '0'
497
490
  segments:
498
491
  - 0
499
- hash: 886230137059201469
492
+ hash: -3624603295564050615
500
493
  required_rubygems_version: !ruby/object:Gem::Requirement
501
494
  none: false
502
495
  requirements: