Class: Aws::S3::ObjectAcl
- Inherits:
-
Object
- Object
- Aws::S3::ObjectAcl
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-s3/object_acl.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #bucket_name ⇒ String
-
#grants ⇒ Array<Types::Grant>
A list of grants.
- #object_key ⇒ String
- #owner ⇒ Types::Owner
-
#request_charged ⇒ String
If present, indicates that the requester was successfully charged for the request.
Actions collapse
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #object ⇒ Object
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::GetObjectAclOutput
Returns the data for this ObjectAcl.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ ObjectAcl
constructor
A new instance of ObjectAcl.
- #load ⇒ self (also: #reload)
Constructor Details
#initialize(bucket_name, object_key, options = {}) ⇒ ObjectAcl #initialize(options = {}) ⇒ ObjectAcl
Returns a new instance of ObjectAcl.
21 22 23 24 25 26 27 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 21 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, ) @object_key = extract_object_key(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#bucket_name ⇒ String
32 33 34 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 32 def bucket_name @bucket_name end |
#client ⇒ Client
62 63 64 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 62 def client @client end |
#data ⇒ Types::GetObjectAclOutput
85 86 87 88 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 85 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
93 94 95 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 93 def data_loaded? !!@data end |
#grants ⇒ Array<Types::Grant>
A list of grants.
48 49 50 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 48 def grants data.grants 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.
178 179 180 181 182 183 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 178 def identifiers { bucket_name: @bucket_name, object_key: @object_key } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::S3::ObjectAcl. Returns ‘self` making it possible to chain methods.
object_acl.reload.data
72 73 74 75 76 77 78 79 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 72 def load resp = @client.get_object_acl( bucket: @bucket_name, key: @object_key ) @data = resp.data self end |
#object ⇒ Object
168 169 170 171 172 173 174 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 168 def object Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end |
#object_key ⇒ String
37 38 39 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 37 def object_key @object_key end |
#owner ⇒ Types::Owner
42 43 44 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 42 def owner data.owner end |
#put(options = {}) ⇒ Types::PutObjectAclOutput
156 157 158 159 160 161 162 163 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 156 def put( = {}) = .merge( bucket: @bucket_name, key: @object_key ) resp = @client.put_object_acl() resp.data end |
#request_charged ⇒ String
If present, indicates that the requester was successfully charged for the request.
55 56 57 |
# File 'lib/aws-sdk-s3/object_acl.rb', line 55 def request_charged data.request_charged end |