Class: Aws::S3::BucketTagging
- Inherits:
-
Object
- Object
- Aws::S3::BucketTagging
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-s3/bucket_tagging.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::GetBucketTaggingOutput
Returns the data for this BucketTagging.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ BucketTagging
constructor
A new instance of BucketTagging.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current BucketTagging.
Constructor Details
#initialize(bucket_name, options = {}) ⇒ BucketTagging #initialize(options = {}) ⇒ BucketTagging
Returns a new instance of BucketTagging.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-s3/bucket_tagging.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
112 113 114 115 116 117 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 112 def bucket Bucket.new( name: @bucket_name, client: @client ) end |
#bucket_name ⇒ String
29 30 31 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 29 def bucket_name @bucket_name end |
#client ⇒ Client
41 42 43 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 41 def client @client end |
#data ⇒ Types::GetBucketTaggingOutput
61 62 63 64 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 61 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
69 70 71 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 69 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
80 81 82 83 84 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 80 def delete( = {}) = .merge(bucket: @bucket_name) resp = @client.delete_bucket_tagging() resp.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.
121 122 123 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 121 def identifiers { bucket_name: @bucket_name } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::S3::BucketTagging. Returns ‘self` making it possible to chain methods.
bucket_tagging.reload.data
51 52 53 54 55 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 51 def load resp = @client.get_bucket_tagging(bucket: @bucket_name) @data = resp.data self end |
#put(options = {}) ⇒ EmptyStructure
103 104 105 106 107 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 103 def put( = {}) = .merge(bucket: @bucket_name) resp = @client.put_bucket_tagging() resp.data end |
#tag_set ⇒ Array<Types::Tag>
34 35 36 |
# File 'lib/aws-sdk-s3/bucket_tagging.rb', line 34 def tag_set data.tag_set end |