Class: Aws::S3::BucketLogging
- Inherits:
-
Object
- Object
- Aws::S3::BucketLogging
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-s3/bucket_logging.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
Actions collapse
Associations collapse
- #bucket ⇒ Bucket
- #identifiers ⇒ Object deprecated private Deprecated.
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::GetBucketLoggingOutput
Returns the data for this BucketLogging.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ BucketLogging
constructor
A new instance of BucketLogging.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current BucketLogging.
Constructor Details
#initialize(bucket_name, options = {}) ⇒ BucketLogging #initialize(options = {}) ⇒ BucketLogging
Returns a new instance of BucketLogging.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#bucket ⇒ Bucket
111 112 113 114 115 116 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 111 def bucket Bucket.new( name: @bucket_name, client: @client ) end |
#bucket_name ⇒ String
29 30 31 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 29 def bucket_name @bucket_name end |
#data ⇒ Types::GetBucketLoggingOutput
Returns the data for this Aws::S3::BucketLogging. Calls Client#get_bucket_logging if #data_loaded? is ‘false`.
61 62 63 64 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 61 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
69 70 71 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 69 def data_loaded? !!@data end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deprecated.
120 121 122 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 120 def identifiers { bucket_name: @bucket_name } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::S3::BucketLogging. Returns ‘self` making it possible to chain methods.
bucket_logging.reload.data
51 52 53 54 55 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 51 def load resp = @client.get_bucket_logging(bucket: @bucket_name) @data = resp.data self end |
#logging_enabled ⇒ Types::LoggingEnabled
34 35 36 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 34 def logging_enabled data.logging_enabled end |
#put(options = {}) ⇒ EmptyStructure
102 103 104 105 106 |
# File 'lib/aws-sdk-s3/bucket_logging.rb', line 102 def put( = {}) = .merge(bucket: @bucket_name) resp = @client.put_bucket_logging() resp.data end |