aws-sdk-s3 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/lib/aws-sdk-s3.rb +66 -0
  3. data/lib/aws-sdk-s3/bucket.rb +595 -0
  4. data/lib/aws-sdk-s3/bucket_acl.rb +168 -0
  5. data/lib/aws-sdk-s3/bucket_cors.rb +146 -0
  6. data/lib/aws-sdk-s3/bucket_lifecycle.rb +164 -0
  7. data/lib/aws-sdk-s3/bucket_logging.rb +142 -0
  8. data/lib/aws-sdk-s3/bucket_notification.rb +187 -0
  9. data/lib/aws-sdk-s3/bucket_policy.rb +138 -0
  10. data/lib/aws-sdk-s3/bucket_region_cache.rb +79 -0
  11. data/lib/aws-sdk-s3/bucket_request_payment.rb +128 -0
  12. data/lib/aws-sdk-s3/bucket_tagging.rb +143 -0
  13. data/lib/aws-sdk-s3/bucket_versioning.rb +188 -0
  14. data/lib/aws-sdk-s3/bucket_website.rb +177 -0
  15. data/lib/aws-sdk-s3/client.rb +3171 -0
  16. data/lib/aws-sdk-s3/client_api.rb +1991 -0
  17. data/lib/aws-sdk-s3/customizations.rb +29 -0
  18. data/lib/aws-sdk-s3/customizations/bucket.rb +127 -0
  19. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +42 -0
  20. data/lib/aws-sdk-s3/customizations/object.rb +257 -0
  21. data/lib/aws-sdk-s3/customizations/object_summary.rb +65 -0
  22. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +11 -0
  23. data/lib/aws-sdk-s3/encryption.rb +19 -0
  24. data/lib/aws-sdk-s3/encryption/client.rb +369 -0
  25. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +178 -0
  26. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +63 -0
  27. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +38 -0
  28. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +50 -0
  29. data/lib/aws-sdk-s3/encryption/errors.rb +13 -0
  30. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +50 -0
  31. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +29 -0
  32. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +69 -0
  33. data/lib/aws-sdk-s3/encryption/key_provider.rb +29 -0
  34. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +71 -0
  35. data/lib/aws-sdk-s3/encryption/materials.rb +58 -0
  36. data/lib/aws-sdk-s3/encryption/utils.rb +79 -0
  37. data/lib/aws-sdk-s3/errors.rb +23 -0
  38. data/lib/aws-sdk-s3/file_part.rb +75 -0
  39. data/lib/aws-sdk-s3/file_uploader.rb +58 -0
  40. data/lib/aws-sdk-s3/legacy_signer.rb +186 -0
  41. data/lib/aws-sdk-s3/multipart_file_uploader.rb +187 -0
  42. data/lib/aws-sdk-s3/multipart_upload.rb +287 -0
  43. data/lib/aws-sdk-s3/multipart_upload_error.rb +16 -0
  44. data/lib/aws-sdk-s3/multipart_upload_part.rb +314 -0
  45. data/lib/aws-sdk-s3/object.rb +942 -0
  46. data/lib/aws-sdk-s3/object_acl.rb +214 -0
  47. data/lib/aws-sdk-s3/object_copier.rb +99 -0
  48. data/lib/aws-sdk-s3/object_multipart_copier.rb +179 -0
  49. data/lib/aws-sdk-s3/object_summary.rb +794 -0
  50. data/lib/aws-sdk-s3/object_version.rb +406 -0
  51. data/lib/aws-sdk-s3/plugins/accelerate.rb +92 -0
  52. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +89 -0
  53. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +23 -0
  54. data/lib/aws-sdk-s3/plugins/dualstack.rb +70 -0
  55. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +29 -0
  56. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +23 -0
  57. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +47 -0
  58. data/lib/aws-sdk-s3/plugins/location_constraint.rb +33 -0
  59. data/lib/aws-sdk-s3/plugins/md5s.rb +79 -0
  60. data/lib/aws-sdk-s3/plugins/redirects.rb +41 -0
  61. data/lib/aws-sdk-s3/plugins/s3_signer.rb +208 -0
  62. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +68 -0
  63. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +94 -0
  64. data/lib/aws-sdk-s3/presigned_post.rb +647 -0
  65. data/lib/aws-sdk-s3/presigner.rb +160 -0
  66. data/lib/aws-sdk-s3/resource.rb +96 -0
  67. data/lib/aws-sdk-s3/types.rb +5750 -0
  68. data/lib/aws-sdk-s3/waiters.rb +178 -0
  69. metadata +154 -0
@@ -0,0 +1,142 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module S3
10
+ class BucketLogging
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
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def bucket_name
31
+ @bucket_name
32
+ end
33
+
34
+ # @return [Types::LoggingEnabled]
35
+ def logging_enabled
36
+ data.logging_enabled
37
+ end
38
+
39
+ # @!endgroup
40
+
41
+ # @return [Client]
42
+ def client
43
+ @client
44
+ end
45
+
46
+ # Loads, or reloads {#data} for the current {BucketLogging}.
47
+ # Returns `self` making it possible to chain methods.
48
+ #
49
+ # bucket_logging.reload.data
50
+ #
51
+ # @return [self]
52
+ def load
53
+ resp = @client.get_bucket_logging(bucket: @bucket_name)
54
+ @data = resp.data
55
+ self
56
+ end
57
+ alias :reload :load
58
+
59
+ # @return [Types::GetBucketLoggingOutput]
60
+ # Returns the data for this {BucketLogging}. Calls
61
+ # {Client#get_bucket_logging} if {#data_loaded?} is `false`.
62
+ def data
63
+ load unless @data
64
+ @data
65
+ end
66
+
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
73
+
74
+ # @!group Actions
75
+
76
+ # @example Request syntax with placeholder values
77
+ #
78
+ # bucket_logging.put({
79
+ # bucket_logging_status: { # required
80
+ # logging_enabled: {
81
+ # target_bucket: "TargetBucket",
82
+ # target_grants: [
83
+ # {
84
+ # grantee: {
85
+ # display_name: "DisplayName",
86
+ # email_address: "EmailAddress",
87
+ # id: "ID",
88
+ # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
89
+ # uri: "URI",
90
+ # },
91
+ # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE
92
+ # },
93
+ # ],
94
+ # target_prefix: "TargetPrefix",
95
+ # },
96
+ # },
97
+ # content_md5: "ContentMD5",
98
+ # })
99
+ # @param [Hash] options ({})
100
+ # @option options [required, Types::BucketLoggingStatus] :bucket_logging_status
101
+ # @option options [String] :content_md5
102
+ # @return [EmptyStructure]
103
+ def put(options = {})
104
+ options = options.merge(bucket: @bucket_name)
105
+ resp = @client.put_bucket_logging(options)
106
+ resp.data
107
+ end
108
+
109
+ # @!group Associations
110
+
111
+ # @return [Bucket]
112
+ def bucket
113
+ Bucket.new(
114
+ name: @bucket_name,
115
+ client: @client
116
+ )
117
+ end
118
+
119
+ # @deprecated
120
+ # @api private
121
+ def identifiers
122
+ { bucket_name: @bucket_name }
123
+ end
124
+ deprecated(:identifiers)
125
+
126
+ private
127
+
128
+ def extract_bucket_name(args, options)
129
+ value = args[0] || options.delete(:bucket_name)
130
+ case value
131
+ when String then value
132
+ when nil then raise ArgumentError, "missing required option :bucket_name"
133
+ else
134
+ msg = "expected :bucket_name to be a String, got #{value.class}"
135
+ raise ArgumentError, msg
136
+ end
137
+ end
138
+
139
+ class Collection < Aws::Resources::Collection; end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,187 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module S3
10
+ class BucketNotification
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
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def bucket_name
31
+ @bucket_name
32
+ end
33
+
34
+ # @return [Array<Types::TopicConfiguration>]
35
+ def topic_configurations
36
+ data.topic_configurations
37
+ end
38
+
39
+ # @return [Array<Types::QueueConfiguration>]
40
+ def queue_configurations
41
+ data.queue_configurations
42
+ end
43
+
44
+ # @return [Array<Types::LambdaFunctionConfiguration>]
45
+ def lambda_function_configurations
46
+ data.lambda_function_configurations
47
+ end
48
+
49
+ # @!endgroup
50
+
51
+ # @return [Client]
52
+ def client
53
+ @client
54
+ end
55
+
56
+ # Loads, or reloads {#data} for the current {BucketNotification}.
57
+ # Returns `self` making it possible to chain methods.
58
+ #
59
+ # bucket_notification.reload.data
60
+ #
61
+ # @return [self]
62
+ def load
63
+ resp = @client.get_bucket_notification_configuration(bucket: @bucket_name)
64
+ @data = resp.data
65
+ self
66
+ end
67
+ alias :reload :load
68
+
69
+ # @return [Types::NotificationConfiguration]
70
+ # Returns the data for this {BucketNotification}. Calls
71
+ # {Client#get_bucket_notification_configuration} if {#data_loaded?} is `false`.
72
+ def data
73
+ load unless @data
74
+ @data
75
+ end
76
+
77
+ # @return [Boolean]
78
+ # Returns `true` if this resource is loaded. Accessing attributes or
79
+ # {#data} on an unloaded resource will trigger a call to {#load}.
80
+ def data_loaded?
81
+ !!@data
82
+ end
83
+
84
+ # @!group Actions
85
+
86
+ # @example Request syntax with placeholder values
87
+ #
88
+ # bucket_notification.put({
89
+ # notification_configuration: { # required
90
+ # topic_configurations: [
91
+ # {
92
+ # id: "NotificationId",
93
+ # topic_arn: "TopicArn", # required
94
+ # 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
95
+ # filter: {
96
+ # key: {
97
+ # filter_rules: [
98
+ # {
99
+ # name: "prefix", # accepts prefix, suffix
100
+ # value: "FilterRuleValue",
101
+ # },
102
+ # ],
103
+ # },
104
+ # },
105
+ # },
106
+ # ],
107
+ # queue_configurations: [
108
+ # {
109
+ # id: "NotificationId",
110
+ # queue_arn: "QueueArn", # required
111
+ # 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
112
+ # filter: {
113
+ # key: {
114
+ # filter_rules: [
115
+ # {
116
+ # name: "prefix", # accepts prefix, suffix
117
+ # value: "FilterRuleValue",
118
+ # },
119
+ # ],
120
+ # },
121
+ # },
122
+ # },
123
+ # ],
124
+ # lambda_function_configurations: [
125
+ # {
126
+ # id: "NotificationId",
127
+ # lambda_function_arn: "LambdaFunctionArn", # required
128
+ # 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
129
+ # filter: {
130
+ # key: {
131
+ # filter_rules: [
132
+ # {
133
+ # name: "prefix", # accepts prefix, suffix
134
+ # value: "FilterRuleValue",
135
+ # },
136
+ # ],
137
+ # },
138
+ # },
139
+ # },
140
+ # ],
141
+ # },
142
+ # })
143
+ # @param [Hash] options ({})
144
+ # @option options [required, Types::NotificationConfiguration] :notification_configuration
145
+ # Container for specifying the notification configuration of the bucket.
146
+ # If this element is empty, notifications are turned off on the bucket.
147
+ # @return [EmptyStructure]
148
+ def put(options = {})
149
+ options = options.merge(bucket: @bucket_name)
150
+ resp = @client.put_bucket_notification_configuration(options)
151
+ resp.data
152
+ end
153
+
154
+ # @!group Associations
155
+
156
+ # @return [Bucket]
157
+ def bucket
158
+ Bucket.new(
159
+ name: @bucket_name,
160
+ client: @client
161
+ )
162
+ end
163
+
164
+ # @deprecated
165
+ # @api private
166
+ def identifiers
167
+ { bucket_name: @bucket_name }
168
+ end
169
+ deprecated(:identifiers)
170
+
171
+ private
172
+
173
+ def extract_bucket_name(args, options)
174
+ value = args[0] || options.delete(:bucket_name)
175
+ case value
176
+ when String then value
177
+ when nil then raise ArgumentError, "missing required option :bucket_name"
178
+ else
179
+ msg = "expected :bucket_name to be a String, got #{value.class}"
180
+ raise ArgumentError, msg
181
+ end
182
+ end
183
+
184
+ class Collection < Aws::Resources::Collection; end
185
+ end
186
+ end
187
+ end
@@ -0,0 +1,138 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws
9
+ module S3
10
+ class BucketPolicy
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
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def bucket_name
31
+ @bucket_name
32
+ end
33
+
34
+ # The bucket policy as a JSON document.
35
+ # @return [String]
36
+ def policy
37
+ data.policy
38
+ end
39
+
40
+ # @!endgroup
41
+
42
+ # @return [Client]
43
+ def client
44
+ @client
45
+ end
46
+
47
+ # Loads, or reloads {#data} for the current {BucketPolicy}.
48
+ # Returns `self` making it possible to chain methods.
49
+ #
50
+ # bucket_policy.reload.data
51
+ #
52
+ # @return [self]
53
+ def load
54
+ resp = @client.get_bucket_policy(bucket: @bucket_name)
55
+ @data = resp.data
56
+ self
57
+ end
58
+ alias :reload :load
59
+
60
+ # @return [Types::GetBucketPolicyOutput]
61
+ # Returns the data for this {BucketPolicy}. Calls
62
+ # {Client#get_bucket_policy} if {#data_loaded?} is `false`.
63
+ def data
64
+ load unless @data
65
+ @data
66
+ end
67
+
68
+ # @return [Boolean]
69
+ # Returns `true` if this resource is loaded. Accessing attributes or
70
+ # {#data} on an unloaded resource will trigger a call to {#load}.
71
+ def data_loaded?
72
+ !!@data
73
+ end
74
+
75
+ # @!group Actions
76
+
77
+ # @example Request syntax with placeholder values
78
+ #
79
+ # bucket_policy.delete()
80
+ # @param [Hash] options ({})
81
+ # @return [EmptyStructure]
82
+ def delete(options = {})
83
+ options = options.merge(bucket: @bucket_name)
84
+ resp = @client.delete_bucket_policy(options)
85
+ resp.data
86
+ end
87
+
88
+ # @example Request syntax with placeholder values
89
+ #
90
+ # bucket_policy.put({
91
+ # content_md5: "ContentMD5",
92
+ # policy: "Policy", # required
93
+ # })
94
+ # @param [Hash] options ({})
95
+ # @option options [String] :content_md5
96
+ # @option options [required, String] :policy
97
+ # The bucket policy as a JSON document.
98
+ # @return [EmptyStructure]
99
+ def put(options = {})
100
+ options = options.merge(bucket: @bucket_name)
101
+ resp = @client.put_bucket_policy(options)
102
+ resp.data
103
+ end
104
+
105
+ # @!group Associations
106
+
107
+ # @return [Bucket]
108
+ def bucket
109
+ Bucket.new(
110
+ name: @bucket_name,
111
+ client: @client
112
+ )
113
+ end
114
+
115
+ # @deprecated
116
+ # @api private
117
+ def identifiers
118
+ { bucket_name: @bucket_name }
119
+ end
120
+ deprecated(:identifiers)
121
+
122
+ private
123
+
124
+ def extract_bucket_name(args, options)
125
+ value = args[0] || options.delete(:bucket_name)
126
+ case value
127
+ when String then value
128
+ when nil then raise ArgumentError, "missing required option :bucket_name"
129
+ else
130
+ msg = "expected :bucket_name to be a String, got #{value.class}"
131
+ raise ArgumentError, msg
132
+ end
133
+ end
134
+
135
+ class Collection < Aws::Resources::Collection; end
136
+ end
137
+ end
138
+ end