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

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,164 +1,162 @@
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 BucketLifecycle
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 BucketLifecycle
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::Rule>]
35
- def rules
36
- data.rules
37
- end
33
+ # @return [Array<Types::Rule>]
34
+ def rules
35
+ data.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 {BucketLifecycle}.
47
- # Returns `self` making it possible to chain methods.
48
- #
49
- # bucket_lifecycle.reload.data
50
- #
51
- # @return [self]
52
- def load
53
- resp = @client.get_bucket_lifecycle(bucket: @bucket_name)
54
- @data = resp.data
55
- self
56
- end
57
- alias :reload :load
58
-
59
- # @return [Types::GetBucketLifecycleOutput]
60
- # Returns the data for this {BucketLifecycle}. Calls
61
- # {Client#get_bucket_lifecycle} if {#data_loaded?} is `false`.
62
- def data
63
- load unless @data
64
- @data
65
- end
45
+ # Loads, or reloads {#data} for the current {BucketLifecycle}.
46
+ # Returns `self` making it possible to chain methods.
47
+ #
48
+ # bucket_lifecycle.reload.data
49
+ #
50
+ # @return [self]
51
+ def load
52
+ resp = @client.get_bucket_lifecycle(bucket: @bucket_name)
53
+ @data = resp.data
54
+ self
55
+ end
56
+ alias :reload :load
57
+
58
+ # @return [Types::GetBucketLifecycleOutput]
59
+ # Returns the data for this {BucketLifecycle}. Calls
60
+ # {Client#get_bucket_lifecycle} 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_lifecycle.delete()
79
- # @param [Hash] options ({})
80
- # @return [EmptyStructure]
81
- def delete(options = {})
82
- options = options.merge(bucket: @bucket_name)
83
- resp = @client.delete_bucket_lifecycle(options)
84
- resp.data
85
- end
73
+ # @!group Actions
74
+
75
+ # @example Request syntax with placeholder values
76
+ #
77
+ # bucket_lifecycle.delete()
78
+ # @param [Hash] options ({})
79
+ # @return [EmptyStructure]
80
+ def delete(options = {})
81
+ options = options.merge(bucket: @bucket_name)
82
+ resp = @client.delete_bucket_lifecycle(options)
83
+ resp.data
84
+ end
86
85
 
87
- # @example Request syntax with placeholder values
88
- #
89
- # bucket_lifecycle.put({
90
- # content_md5: "ContentMD5",
91
- # lifecycle_configuration: {
92
- # rules: [ # required
93
- # {
94
- # expiration: {
95
- # date: Time.now,
96
- # days: 1,
97
- # expired_object_delete_marker: false,
98
- # },
99
- # id: "ID",
100
- # prefix: "Prefix", # required
101
- # status: "Enabled", # required, accepts Enabled, Disabled
102
- # transition: {
103
- # date: Time.now,
104
- # days: 1,
105
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
106
- # },
107
- # noncurrent_version_transition: {
108
- # noncurrent_days: 1,
109
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
110
- # },
111
- # noncurrent_version_expiration: {
112
- # noncurrent_days: 1,
113
- # },
114
- # abort_incomplete_multipart_upload: {
115
- # days_after_initiation: 1,
116
- # },
117
- # },
118
- # ],
119
- # },
120
- # })
121
- # @param [Hash] options ({})
122
- # @option options [String] :content_md5
123
- # @option options [Types::LifecycleConfiguration] :lifecycle_configuration
124
- # @return [EmptyStructure]
125
- def put(options = {})
126
- options = options.merge(bucket: @bucket_name)
127
- resp = @client.put_bucket_lifecycle(options)
128
- resp.data
129
- end
86
+ # @example Request syntax with placeholder values
87
+ #
88
+ # bucket_lifecycle.put({
89
+ # content_md5: "ContentMD5",
90
+ # lifecycle_configuration: {
91
+ # rules: [ # required
92
+ # {
93
+ # expiration: {
94
+ # date: Time.now,
95
+ # days: 1,
96
+ # expired_object_delete_marker: false,
97
+ # },
98
+ # id: "ID",
99
+ # prefix: "Prefix", # required
100
+ # status: "Enabled", # required, accepts Enabled, Disabled
101
+ # transition: {
102
+ # date: Time.now,
103
+ # days: 1,
104
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
105
+ # },
106
+ # noncurrent_version_transition: {
107
+ # noncurrent_days: 1,
108
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA
109
+ # },
110
+ # noncurrent_version_expiration: {
111
+ # noncurrent_days: 1,
112
+ # },
113
+ # abort_incomplete_multipart_upload: {
114
+ # days_after_initiation: 1,
115
+ # },
116
+ # },
117
+ # ],
118
+ # },
119
+ # })
120
+ # @param [Hash] options ({})
121
+ # @option options [String] :content_md5
122
+ # @option options [Types::LifecycleConfiguration] :lifecycle_configuration
123
+ # @return [EmptyStructure]
124
+ def put(options = {})
125
+ options = options.merge(bucket: @bucket_name)
126
+ resp = @client.put_bucket_lifecycle(options)
127
+ resp.data
128
+ end
130
129
 
131
- # @!group Associations
130
+ # @!group Associations
132
131
 
133
- # @return [Bucket]
134
- def bucket
135
- Bucket.new(
136
- name: @bucket_name,
137
- client: @client
138
- )
139
- end
132
+ # @return [Bucket]
133
+ def bucket
134
+ Bucket.new(
135
+ name: @bucket_name,
136
+ client: @client
137
+ )
138
+ end
140
139
 
141
- # @deprecated
142
- # @api private
143
- def identifiers
144
- { bucket_name: @bucket_name }
145
- end
146
- deprecated(:identifiers)
147
-
148
- private
149
-
150
- def extract_bucket_name(args, options)
151
- value = args[0] || options.delete(:bucket_name)
152
- case value
153
- when String then value
154
- when nil then raise ArgumentError, "missing required option :bucket_name"
155
- else
156
- msg = "expected :bucket_name to be a String, got #{value.class}"
157
- raise ArgumentError, msg
158
- end
140
+ # @deprecated
141
+ # @api private
142
+ def identifiers
143
+ { bucket_name: @bucket_name }
144
+ end
145
+ deprecated(:identifiers)
146
+
147
+ private
148
+
149
+ def extract_bucket_name(args, options)
150
+ value = args[0] || options.delete(:bucket_name)
151
+ case value
152
+ when String then value
153
+ when nil then raise ArgumentError, "missing required option :bucket_name"
154
+ else
155
+ msg = "expected :bucket_name to be a String, got #{value.class}"
156
+ raise ArgumentError, msg
159
157
  end
160
-
161
- class Collection < Aws::Resources::Collection; end
162
158
  end
159
+
160
+ class Collection < Aws::Resources::Collection; end
163
161
  end
164
162
  end
@@ -1,142 +1,140 @@
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 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
8
+ module Aws::S3
9
+ class BucketLogging
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::LoggingEnabled]
35
- def logging_enabled
36
- data.logging_enabled
37
- end
33
+ # @return [Types::LoggingEnabled]
34
+ def logging_enabled
35
+ data.logging_enabled
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 {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
45
+ # Loads, or reloads {#data} for the current {BucketLogging}.
46
+ # Returns `self` making it possible to chain methods.
47
+ #
48
+ # bucket_logging.reload.data
49
+ #
50
+ # @return [self]
51
+ def load
52
+ resp = @client.get_bucket_logging(bucket: @bucket_name)
53
+ @data = resp.data
54
+ self
55
+ end
56
+ alias :reload :load
57
+
58
+ # @return [Types::GetBucketLoggingOutput]
59
+ # Returns the data for this {BucketLogging}. Calls
60
+ # {Client#get_bucket_logging} 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_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
73
+ # @!group Actions
74
+
75
+ # @example Request syntax with placeholder values
76
+ #
77
+ # bucket_logging.put({
78
+ # bucket_logging_status: { # required
79
+ # logging_enabled: {
80
+ # target_bucket: "TargetBucket",
81
+ # target_grants: [
82
+ # {
83
+ # grantee: {
84
+ # display_name: "DisplayName",
85
+ # email_address: "EmailAddress",
86
+ # id: "ID",
87
+ # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
88
+ # uri: "URI",
89
+ # },
90
+ # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE
91
+ # },
92
+ # ],
93
+ # target_prefix: "TargetPrefix",
94
+ # },
95
+ # },
96
+ # content_md5: "ContentMD5",
97
+ # })
98
+ # @param [Hash] options ({})
99
+ # @option options [required, Types::BucketLoggingStatus] :bucket_logging_status
100
+ # @option options [String] :content_md5
101
+ # @return [EmptyStructure]
102
+ def put(options = {})
103
+ options = options.merge(bucket: @bucket_name)
104
+ resp = @client.put_bucket_logging(options)
105
+ resp.data
106
+ end
108
107
 
109
- # @!group Associations
108
+ # @!group Associations
110
109
 
111
- # @return [Bucket]
112
- def bucket
113
- Bucket.new(
114
- name: @bucket_name,
115
- client: @client
116
- )
117
- end
110
+ # @return [Bucket]
111
+ def bucket
112
+ Bucket.new(
113
+ name: @bucket_name,
114
+ client: @client
115
+ )
116
+ end
118
117
 
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
118
+ # @deprecated
119
+ # @api private
120
+ def identifiers
121
+ { bucket_name: @bucket_name }
122
+ end
123
+ deprecated(:identifiers)
124
+
125
+ private
126
+
127
+ def extract_bucket_name(args, options)
128
+ value = args[0] || options.delete(:bucket_name)
129
+ case value
130
+ when String then value
131
+ when nil then raise ArgumentError, "missing required option :bucket_name"
132
+ else
133
+ msg = "expected :bucket_name to be a String, got #{value.class}"
134
+ raise ArgumentError, msg
137
135
  end
138
-
139
- class Collection < Aws::Resources::Collection; end
140
136
  end
137
+
138
+ class Collection < Aws::Resources::Collection; end
141
139
  end
142
140
  end