aws-sdk-s3 1.0.0.rc2 → 1.0.0.rc3

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.
@@ -1,168 +1,166 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module S3
10
- class BucketAcl
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(bucket_name, options = {})
15
- # @param [String] bucket_name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :bucket_name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @bucket_name = extract_bucket_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::S3
9
+ class BucketAcl
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(bucket_name, options = {})
14
+ # @param [String] bucket_name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :bucket_name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @bucket_name = extract_bucket_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def bucket_name
31
- @bucket_name
32
- end
28
+ # @return [String]
29
+ def bucket_name
30
+ @bucket_name
31
+ end
33
32
 
34
- # @return [Types::Owner]
35
- def owner
36
- data.owner
37
- end
33
+ # @return [Types::Owner]
34
+ def owner
35
+ data.owner
36
+ end
38
37
 
39
- # A list of grants.
40
- # @return [Array<Types::Grant>]
41
- def grants
42
- data.grants
43
- end
38
+ # A list of grants.
39
+ # @return [Array<Types::Grant>]
40
+ def grants
41
+ data.grants
42
+ end
44
43
 
45
- # @!endgroup
44
+ # @!endgroup
46
45
 
47
- # @return [Client]
48
- def client
49
- @client
50
- end
46
+ # @return [Client]
47
+ def client
48
+ @client
49
+ end
51
50
 
52
- # Loads, or reloads {#data} for the current {BucketAcl}.
53
- # Returns `self` making it possible to chain methods.
54
- #
55
- # bucket_acl.reload.data
56
- #
57
- # @return [self]
58
- def load
59
- resp = @client.get_bucket_acl(bucket: @bucket_name)
60
- @data = resp.data
61
- self
62
- end
63
- alias :reload :load
64
-
65
- # @return [Types::GetBucketAclOutput]
66
- # Returns the data for this {BucketAcl}. Calls
67
- # {Client#get_bucket_acl} if {#data_loaded?} is `false`.
68
- def data
69
- load unless @data
70
- @data
71
- end
51
+ # Loads, or reloads {#data} for the current {BucketAcl}.
52
+ # Returns `self` making it possible to chain methods.
53
+ #
54
+ # bucket_acl.reload.data
55
+ #
56
+ # @return [self]
57
+ def load
58
+ resp = @client.get_bucket_acl(bucket: @bucket_name)
59
+ @data = resp.data
60
+ self
61
+ end
62
+ alias :reload :load
63
+
64
+ # @return [Types::GetBucketAclOutput]
65
+ # Returns the data for this {BucketAcl}. Calls
66
+ # {Client#get_bucket_acl} if {#data_loaded?} is `false`.
67
+ def data
68
+ load unless @data
69
+ @data
70
+ end
72
71
 
73
- # @return [Boolean]
74
- # Returns `true` if this resource is loaded. Accessing attributes or
75
- # {#data} on an unloaded resource will trigger a call to {#load}.
76
- def data_loaded?
77
- !!@data
78
- end
72
+ # @return [Boolean]
73
+ # Returns `true` if this resource is loaded. Accessing attributes or
74
+ # {#data} on an unloaded resource will trigger a call to {#load}.
75
+ def data_loaded?
76
+ !!@data
77
+ end
79
78
 
80
- # @!group Actions
81
-
82
- # @example Request syntax with placeholder values
83
- #
84
- # bucket_acl.put({
85
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
86
- # access_control_policy: {
87
- # grants: [
88
- # {
89
- # grantee: {
90
- # display_name: "DisplayName",
91
- # email_address: "EmailAddress",
92
- # id: "ID",
93
- # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
94
- # uri: "URI",
95
- # },
96
- # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP
97
- # },
98
- # ],
99
- # owner: {
100
- # display_name: "DisplayName",
101
- # id: "ID",
102
- # },
103
- # },
104
- # content_md5: "ContentMD5",
105
- # grant_full_control: "GrantFullControl",
106
- # grant_read: "GrantRead",
107
- # grant_read_acp: "GrantReadACP",
108
- # grant_write: "GrantWrite",
109
- # grant_write_acp: "GrantWriteACP",
110
- # })
111
- # @param [Hash] options ({})
112
- # @option options [String] :acl
113
- # The canned ACL to apply to the bucket.
114
- # @option options [Types::AccessControlPolicy] :access_control_policy
115
- # @option options [String] :content_md5
116
- # @option options [String] :grant_full_control
117
- # Allows grantee the read, write, read ACP, and write ACP permissions on
118
- # the bucket.
119
- # @option options [String] :grant_read
120
- # Allows grantee to list the objects in the bucket.
121
- # @option options [String] :grant_read_acp
122
- # Allows grantee to read the bucket ACL.
123
- # @option options [String] :grant_write
124
- # Allows grantee to create, overwrite, and delete any object in the
125
- # bucket.
126
- # @option options [String] :grant_write_acp
127
- # Allows grantee to write the ACL for the applicable bucket.
128
- # @return [EmptyStructure]
129
- def put(options = {})
130
- options = options.merge(bucket: @bucket_name)
131
- resp = @client.put_bucket_acl(options)
132
- resp.data
133
- end
79
+ # @!group Actions
80
+
81
+ # @example Request syntax with placeholder values
82
+ #
83
+ # bucket_acl.put({
84
+ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
85
+ # access_control_policy: {
86
+ # grants: [
87
+ # {
88
+ # grantee: {
89
+ # display_name: "DisplayName",
90
+ # email_address: "EmailAddress",
91
+ # id: "ID",
92
+ # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
93
+ # uri: "URI",
94
+ # },
95
+ # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP
96
+ # },
97
+ # ],
98
+ # owner: {
99
+ # display_name: "DisplayName",
100
+ # id: "ID",
101
+ # },
102
+ # },
103
+ # content_md5: "ContentMD5",
104
+ # grant_full_control: "GrantFullControl",
105
+ # grant_read: "GrantRead",
106
+ # grant_read_acp: "GrantReadACP",
107
+ # grant_write: "GrantWrite",
108
+ # grant_write_acp: "GrantWriteACP",
109
+ # })
110
+ # @param [Hash] options ({})
111
+ # @option options [String] :acl
112
+ # The canned ACL to apply to the bucket.
113
+ # @option options [Types::AccessControlPolicy] :access_control_policy
114
+ # @option options [String] :content_md5
115
+ # @option options [String] :grant_full_control
116
+ # Allows grantee the read, write, read ACP, and write ACP permissions on
117
+ # the bucket.
118
+ # @option options [String] :grant_read
119
+ # Allows grantee to list the objects in the bucket.
120
+ # @option options [String] :grant_read_acp
121
+ # Allows grantee to read the bucket ACL.
122
+ # @option options [String] :grant_write
123
+ # Allows grantee to create, overwrite, and delete any object in the
124
+ # bucket.
125
+ # @option options [String] :grant_write_acp
126
+ # Allows grantee to write the ACL for the applicable bucket.
127
+ # @return [EmptyStructure]
128
+ def put(options = {})
129
+ options = options.merge(bucket: @bucket_name)
130
+ resp = @client.put_bucket_acl(options)
131
+ resp.data
132
+ end
134
133
 
135
- # @!group Associations
134
+ # @!group Associations
136
135
 
137
- # @return [Bucket]
138
- def bucket
139
- Bucket.new(
140
- name: @bucket_name,
141
- client: @client
142
- )
143
- end
136
+ # @return [Bucket]
137
+ def bucket
138
+ Bucket.new(
139
+ name: @bucket_name,
140
+ client: @client
141
+ )
142
+ end
144
143
 
145
- # @deprecated
146
- # @api private
147
- def identifiers
148
- { bucket_name: @bucket_name }
149
- end
150
- deprecated(:identifiers)
151
-
152
- private
153
-
154
- def extract_bucket_name(args, options)
155
- value = args[0] || options.delete(:bucket_name)
156
- case value
157
- when String then value
158
- when nil then raise ArgumentError, "missing required option :bucket_name"
159
- else
160
- msg = "expected :bucket_name to be a String, got #{value.class}"
161
- raise ArgumentError, msg
162
- end
144
+ # @deprecated
145
+ # @api private
146
+ def identifiers
147
+ { bucket_name: @bucket_name }
148
+ end
149
+ deprecated(:identifiers)
150
+
151
+ private
152
+
153
+ def extract_bucket_name(args, options)
154
+ value = args[0] || options.delete(:bucket_name)
155
+ case value
156
+ when String then value
157
+ when nil then raise ArgumentError, "missing required option :bucket_name"
158
+ else
159
+ msg = "expected :bucket_name to be a String, got #{value.class}"
160
+ raise ArgumentError, msg
163
161
  end
164
-
165
- class Collection < Aws::Resources::Collection; end
166
162
  end
163
+
164
+ class Collection < Aws::Resources::Collection; end
167
165
  end
168
166
  end
@@ -1,146 +1,144 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module S3
10
- class BucketCors
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(bucket_name, options = {})
15
- # @param [String] bucket_name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :bucket_name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @bucket_name = extract_bucket_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::S3
9
+ class BucketCors
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(bucket_name, options = {})
14
+ # @param [String] bucket_name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :bucket_name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @bucket_name = extract_bucket_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def bucket_name
31
- @bucket_name
32
- end
28
+ # @return [String]
29
+ def bucket_name
30
+ @bucket_name
31
+ end
33
32
 
34
- # @return [Array<Types::CORSRule>]
35
- def cors_rules
36
- data.cors_rules
37
- end
33
+ # @return [Array<Types::CORSRule>]
34
+ def cors_rules
35
+ data.cors_rules
36
+ end
38
37
 
39
- # @!endgroup
38
+ # @!endgroup
40
39
 
41
- # @return [Client]
42
- def client
43
- @client
44
- end
40
+ # @return [Client]
41
+ def client
42
+ @client
43
+ end
45
44
 
46
- # Loads, or reloads {#data} for the current {BucketCors}.
47
- # Returns `self` making it possible to chain methods.
48
- #
49
- # bucket_cors.reload.data
50
- #
51
- # @return [self]
52
- def load
53
- resp = @client.get_bucket_cors(bucket: @bucket_name)
54
- @data = resp.data
55
- self
56
- end
57
- alias :reload :load
58
-
59
- # @return [Types::GetBucketCorsOutput]
60
- # Returns the data for this {BucketCors}. Calls
61
- # {Client#get_bucket_cors} if {#data_loaded?} is `false`.
62
- def data
63
- load unless @data
64
- @data
65
- end
45
+ # Loads, or reloads {#data} for the current {BucketCors}.
46
+ # Returns `self` making it possible to chain methods.
47
+ #
48
+ # bucket_cors.reload.data
49
+ #
50
+ # @return [self]
51
+ def load
52
+ resp = @client.get_bucket_cors(bucket: @bucket_name)
53
+ @data = resp.data
54
+ self
55
+ end
56
+ alias :reload :load
57
+
58
+ # @return [Types::GetBucketCorsOutput]
59
+ # Returns the data for this {BucketCors}. Calls
60
+ # {Client#get_bucket_cors} if {#data_loaded?} is `false`.
61
+ def data
62
+ load unless @data
63
+ @data
64
+ end
66
65
 
67
- # @return [Boolean]
68
- # Returns `true` if this resource is loaded. Accessing attributes or
69
- # {#data} on an unloaded resource will trigger a call to {#load}.
70
- def data_loaded?
71
- !!@data
72
- end
66
+ # @return [Boolean]
67
+ # Returns `true` if this resource is loaded. Accessing attributes or
68
+ # {#data} on an unloaded resource will trigger a call to {#load}.
69
+ def data_loaded?
70
+ !!@data
71
+ end
73
72
 
74
- # @!group Actions
75
-
76
- # @example Request syntax with placeholder values
77
- #
78
- # bucket_cors.delete()
79
- # @param [Hash] options ({})
80
- # @return [EmptyStructure]
81
- def delete(options = {})
82
- options = options.merge(bucket: @bucket_name)
83
- resp = @client.delete_bucket_cors(options)
84
- resp.data
85
- end
73
+ # @!group Actions
74
+
75
+ # @example Request syntax with placeholder values
76
+ #
77
+ # bucket_cors.delete()
78
+ # @param [Hash] options ({})
79
+ # @return [EmptyStructure]
80
+ def delete(options = {})
81
+ options = options.merge(bucket: @bucket_name)
82
+ resp = @client.delete_bucket_cors(options)
83
+ resp.data
84
+ end
86
85
 
87
- # @example Request syntax with placeholder values
88
- #
89
- # bucket_cors.put({
90
- # cors_configuration: { # required
91
- # cors_rules: [ # required
92
- # {
93
- # allowed_headers: ["AllowedHeader"],
94
- # allowed_methods: ["AllowedMethod"], # required
95
- # allowed_origins: ["AllowedOrigin"], # required
96
- # expose_headers: ["ExposeHeader"],
97
- # max_age_seconds: 1,
98
- # },
99
- # ],
100
- # },
101
- # content_md5: "ContentMD5",
102
- # })
103
- # @param [Hash] options ({})
104
- # @option options [required, Types::CORSConfiguration] :cors_configuration
105
- # @option options [String] :content_md5
106
- # @return [EmptyStructure]
107
- def put(options = {})
108
- options = options.merge(bucket: @bucket_name)
109
- resp = @client.put_bucket_cors(options)
110
- resp.data
111
- end
86
+ # @example Request syntax with placeholder values
87
+ #
88
+ # bucket_cors.put({
89
+ # cors_configuration: { # required
90
+ # cors_rules: [ # required
91
+ # {
92
+ # allowed_headers: ["AllowedHeader"],
93
+ # allowed_methods: ["AllowedMethod"], # required
94
+ # allowed_origins: ["AllowedOrigin"], # required
95
+ # expose_headers: ["ExposeHeader"],
96
+ # max_age_seconds: 1,
97
+ # },
98
+ # ],
99
+ # },
100
+ # content_md5: "ContentMD5",
101
+ # })
102
+ # @param [Hash] options ({})
103
+ # @option options [required, Types::CORSConfiguration] :cors_configuration
104
+ # @option options [String] :content_md5
105
+ # @return [EmptyStructure]
106
+ def put(options = {})
107
+ options = options.merge(bucket: @bucket_name)
108
+ resp = @client.put_bucket_cors(options)
109
+ resp.data
110
+ end
112
111
 
113
- # @!group Associations
112
+ # @!group Associations
114
113
 
115
- # @return [Bucket]
116
- def bucket
117
- Bucket.new(
118
- name: @bucket_name,
119
- client: @client
120
- )
121
- end
114
+ # @return [Bucket]
115
+ def bucket
116
+ Bucket.new(
117
+ name: @bucket_name,
118
+ client: @client
119
+ )
120
+ end
122
121
 
123
- # @deprecated
124
- # @api private
125
- def identifiers
126
- { bucket_name: @bucket_name }
127
- end
128
- deprecated(:identifiers)
129
-
130
- private
131
-
132
- def extract_bucket_name(args, options)
133
- value = args[0] || options.delete(:bucket_name)
134
- case value
135
- when String then value
136
- when nil then raise ArgumentError, "missing required option :bucket_name"
137
- else
138
- msg = "expected :bucket_name to be a String, got #{value.class}"
139
- raise ArgumentError, msg
140
- end
122
+ # @deprecated
123
+ # @api private
124
+ def identifiers
125
+ { bucket_name: @bucket_name }
126
+ end
127
+ deprecated(:identifiers)
128
+
129
+ private
130
+
131
+ def extract_bucket_name(args, options)
132
+ value = args[0] || options.delete(:bucket_name)
133
+ case value
134
+ when String then value
135
+ when nil then raise ArgumentError, "missing required option :bucket_name"
136
+ else
137
+ msg = "expected :bucket_name to be a String, got #{value.class}"
138
+ raise ArgumentError, msg
141
139
  end
142
-
143
- class Collection < Aws::Resources::Collection; end
144
140
  end
141
+
142
+ class Collection < Aws::Resources::Collection; end
145
143
  end
146
144
  end