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.
- checksums.yaml +4 -4
- data/lib/aws-sdk-s3.rb +1 -1
- data/lib/aws-sdk-s3/bucket.rb +540 -542
- data/lib/aws-sdk-s3/bucket_acl.rb +144 -146
- data/lib/aws-sdk-s3/bucket_cors.rb +122 -124
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +140 -142
- data/lib/aws-sdk-s3/bucket_logging.rb +119 -121
- data/lib/aws-sdk-s3/bucket_notification.rb +162 -164
- data/lib/aws-sdk-s3/bucket_policy.rb +114 -116
- data/lib/aws-sdk-s3/bucket_request_payment.rb +105 -107
- data/lib/aws-sdk-s3/bucket_tagging.rb +119 -121
- data/lib/aws-sdk-s3/bucket_versioning.rb +162 -164
- data/lib/aws-sdk-s3/bucket_website.rb +150 -152
- data/lib/aws-sdk-s3/client.rb +4380 -3611
- data/lib/aws-sdk-s3/client_api.rb +2343 -2345
- data/lib/aws-sdk-s3/customizations/object.rb +3 -2
- data/lib/aws-sdk-s3/errors.rb +4 -13
- data/lib/aws-sdk-s3/multipart_upload.rb +240 -242
- data/lib/aws-sdk-s3/multipart_upload_part.rb +273 -275
- data/lib/aws-sdk-s3/object.rb +879 -881
- data/lib/aws-sdk-s3/object_acl.rb +186 -188
- data/lib/aws-sdk-s3/object_summary.rb +751 -753
- data/lib/aws-sdk-s3/object_version.rb +356 -358
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +1 -1
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +1 -1
- data/lib/aws-sdk-s3/presigner.rb +6 -2
- data/lib/aws-sdk-s3/resource.rb +79 -78
- data/lib/aws-sdk-s3/types.rb +7678 -6939
- data/lib/aws-sdk-s3/waiters.rb +150 -151
- metadata +4 -4
@@ -1,187 +1,185 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::S3
|
9
|
+
class BucketNotification
|
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
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @return [String]
|
29
|
+
def bucket_name
|
30
|
+
@bucket_name
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
# @return [Array<Types::TopicConfiguration>]
|
34
|
+
def topic_configurations
|
35
|
+
data.topic_configurations
|
36
|
+
end
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
# @return [Array<Types::QueueConfiguration>]
|
39
|
+
def queue_configurations
|
40
|
+
data.queue_configurations
|
41
|
+
end
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
# @return [Array<Types::LambdaFunctionConfiguration>]
|
44
|
+
def lambda_function_configurations
|
45
|
+
data.lambda_function_configurations
|
46
|
+
end
|
48
47
|
|
49
|
-
|
48
|
+
# @!endgroup
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
# @return [Client]
|
51
|
+
def client
|
52
|
+
@client
|
53
|
+
end
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
55
|
+
# Loads, or reloads {#data} for the current {BucketNotification}.
|
56
|
+
# Returns `self` making it possible to chain methods.
|
57
|
+
#
|
58
|
+
# bucket_notification.reload.data
|
59
|
+
#
|
60
|
+
# @return [self]
|
61
|
+
def load
|
62
|
+
resp = @client.get_bucket_notification_configuration(bucket: @bucket_name)
|
63
|
+
@data = resp.data
|
64
|
+
self
|
65
|
+
end
|
66
|
+
alias :reload :load
|
67
|
+
|
68
|
+
# @return [Types::NotificationConfiguration]
|
69
|
+
# Returns the data for this {BucketNotification}. Calls
|
70
|
+
# {Client#get_bucket_notification_configuration} if {#data_loaded?} is `false`.
|
71
|
+
def data
|
72
|
+
load unless @data
|
73
|
+
@data
|
74
|
+
end
|
76
75
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
# @return [Boolean]
|
77
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
78
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
79
|
+
def data_loaded?
|
80
|
+
!!@data
|
81
|
+
end
|
83
82
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
83
|
+
# @!group Actions
|
84
|
+
|
85
|
+
# @example Request syntax with placeholder values
|
86
|
+
#
|
87
|
+
# bucket_notification.put({
|
88
|
+
# notification_configuration: { # required
|
89
|
+
# topic_configurations: [
|
90
|
+
# {
|
91
|
+
# id: "NotificationId",
|
92
|
+
# topic_arn: "TopicArn", # required
|
93
|
+
# events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
|
94
|
+
# filter: {
|
95
|
+
# key: {
|
96
|
+
# filter_rules: [
|
97
|
+
# {
|
98
|
+
# name: "prefix", # accepts prefix, suffix
|
99
|
+
# value: "FilterRuleValue",
|
100
|
+
# },
|
101
|
+
# ],
|
102
|
+
# },
|
103
|
+
# },
|
104
|
+
# },
|
105
|
+
# ],
|
106
|
+
# queue_configurations: [
|
107
|
+
# {
|
108
|
+
# id: "NotificationId",
|
109
|
+
# queue_arn: "QueueArn", # required
|
110
|
+
# events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
|
111
|
+
# filter: {
|
112
|
+
# key: {
|
113
|
+
# filter_rules: [
|
114
|
+
# {
|
115
|
+
# name: "prefix", # accepts prefix, suffix
|
116
|
+
# value: "FilterRuleValue",
|
117
|
+
# },
|
118
|
+
# ],
|
119
|
+
# },
|
120
|
+
# },
|
121
|
+
# },
|
122
|
+
# ],
|
123
|
+
# lambda_function_configurations: [
|
124
|
+
# {
|
125
|
+
# id: "NotificationId",
|
126
|
+
# lambda_function_arn: "LambdaFunctionArn", # required
|
127
|
+
# events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
|
128
|
+
# filter: {
|
129
|
+
# key: {
|
130
|
+
# filter_rules: [
|
131
|
+
# {
|
132
|
+
# name: "prefix", # accepts prefix, suffix
|
133
|
+
# value: "FilterRuleValue",
|
134
|
+
# },
|
135
|
+
# ],
|
136
|
+
# },
|
137
|
+
# },
|
138
|
+
# },
|
139
|
+
# ],
|
140
|
+
# },
|
141
|
+
# })
|
142
|
+
# @param [Hash] options ({})
|
143
|
+
# @option options [required, Types::NotificationConfiguration] :notification_configuration
|
144
|
+
# Container for specifying the notification configuration of the bucket.
|
145
|
+
# If this element is empty, notifications are turned off on the bucket.
|
146
|
+
# @return [EmptyStructure]
|
147
|
+
def put(options = {})
|
148
|
+
options = options.merge(bucket: @bucket_name)
|
149
|
+
resp = @client.put_bucket_notification_configuration(options)
|
150
|
+
resp.data
|
151
|
+
end
|
153
152
|
|
154
|
-
|
153
|
+
# @!group Associations
|
155
154
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
155
|
+
# @return [Bucket]
|
156
|
+
def bucket
|
157
|
+
Bucket.new(
|
158
|
+
name: @bucket_name,
|
159
|
+
client: @client
|
160
|
+
)
|
161
|
+
end
|
163
162
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
end
|
163
|
+
# @deprecated
|
164
|
+
# @api private
|
165
|
+
def identifiers
|
166
|
+
{ bucket_name: @bucket_name }
|
167
|
+
end
|
168
|
+
deprecated(:identifiers)
|
169
|
+
|
170
|
+
private
|
171
|
+
|
172
|
+
def extract_bucket_name(args, options)
|
173
|
+
value = args[0] || options.delete(:bucket_name)
|
174
|
+
case value
|
175
|
+
when String then value
|
176
|
+
when nil then raise ArgumentError, "missing required option :bucket_name"
|
177
|
+
else
|
178
|
+
msg = "expected :bucket_name to be a String, got #{value.class}"
|
179
|
+
raise ArgumentError, msg
|
182
180
|
end
|
183
|
-
|
184
|
-
class Collection < Aws::Resources::Collection; end
|
185
181
|
end
|
182
|
+
|
183
|
+
class Collection < Aws::Resources::Collection; end
|
186
184
|
end
|
187
185
|
end
|
@@ -1,138 +1,136 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::S3
|
9
|
+
class BucketPolicy
|
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
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @return [String]
|
29
|
+
def bucket_name
|
30
|
+
@bucket_name
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
# The bucket policy as a JSON document.
|
34
|
+
# @return [String]
|
35
|
+
def policy
|
36
|
+
data.policy
|
37
|
+
end
|
39
38
|
|
40
|
-
|
39
|
+
# @!endgroup
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
# @return [Client]
|
42
|
+
def client
|
43
|
+
@client
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
46
|
+
# Loads, or reloads {#data} for the current {BucketPolicy}.
|
47
|
+
# Returns `self` making it possible to chain methods.
|
48
|
+
#
|
49
|
+
# bucket_policy.reload.data
|
50
|
+
#
|
51
|
+
# @return [self]
|
52
|
+
def load
|
53
|
+
resp = @client.get_bucket_policy(bucket: @bucket_name)
|
54
|
+
@data = resp.data
|
55
|
+
self
|
56
|
+
end
|
57
|
+
alias :reload :load
|
58
|
+
|
59
|
+
# @return [Types::GetBucketPolicyOutput]
|
60
|
+
# Returns the data for this {BucketPolicy}. Calls
|
61
|
+
# {Client#get_bucket_policy} if {#data_loaded?} is `false`.
|
62
|
+
def data
|
63
|
+
load unless @data
|
64
|
+
@data
|
65
|
+
end
|
67
66
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
74
73
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
74
|
+
# @!group Actions
|
75
|
+
|
76
|
+
# @example Request syntax with placeholder values
|
77
|
+
#
|
78
|
+
# bucket_policy.delete()
|
79
|
+
# @param [Hash] options ({})
|
80
|
+
# @return [EmptyStructure]
|
81
|
+
def delete(options = {})
|
82
|
+
options = options.merge(bucket: @bucket_name)
|
83
|
+
resp = @client.delete_bucket_policy(options)
|
84
|
+
resp.data
|
85
|
+
end
|
87
86
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
87
|
+
# @example Request syntax with placeholder values
|
88
|
+
#
|
89
|
+
# bucket_policy.put({
|
90
|
+
# content_md5: "ContentMD5",
|
91
|
+
# policy: "Policy", # required
|
92
|
+
# })
|
93
|
+
# @param [Hash] options ({})
|
94
|
+
# @option options [String] :content_md5
|
95
|
+
# @option options [required, String] :policy
|
96
|
+
# The bucket policy as a JSON document.
|
97
|
+
# @return [EmptyStructure]
|
98
|
+
def put(options = {})
|
99
|
+
options = options.merge(bucket: @bucket_name)
|
100
|
+
resp = @client.put_bucket_policy(options)
|
101
|
+
resp.data
|
102
|
+
end
|
104
103
|
|
105
|
-
|
104
|
+
# @!group Associations
|
106
105
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
106
|
+
# @return [Bucket]
|
107
|
+
def bucket
|
108
|
+
Bucket.new(
|
109
|
+
name: @bucket_name,
|
110
|
+
client: @client
|
111
|
+
)
|
112
|
+
end
|
114
113
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
114
|
+
# @deprecated
|
115
|
+
# @api private
|
116
|
+
def identifiers
|
117
|
+
{ bucket_name: @bucket_name }
|
118
|
+
end
|
119
|
+
deprecated(:identifiers)
|
120
|
+
|
121
|
+
private
|
122
|
+
|
123
|
+
def extract_bucket_name(args, options)
|
124
|
+
value = args[0] || options.delete(:bucket_name)
|
125
|
+
case value
|
126
|
+
when String then value
|
127
|
+
when nil then raise ArgumentError, "missing required option :bucket_name"
|
128
|
+
else
|
129
|
+
msg = "expected :bucket_name to be a String, got #{value.class}"
|
130
|
+
raise ArgumentError, msg
|
133
131
|
end
|
134
|
-
|
135
|
-
class Collection < Aws::Resources::Collection; end
|
136
132
|
end
|
133
|
+
|
134
|
+
class Collection < Aws::Resources::Collection; end
|
137
135
|
end
|
138
136
|
end
|