Class: Aws::S3::MultipartUploadPart
- Inherits:
-
Object
- Object
- Aws::S3::MultipartUploadPart
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-s3/multipart_upload_part.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
- #bucket_name ⇒ String
-
#etag ⇒ String
Entity tag returned when the part was uploaded.
-
#last_modified ⇒ Time
Date and time at which the part was uploaded.
- #multipart_upload_id ⇒ String
- #object_key ⇒ String
- #part_number ⇒ Integer
-
#size ⇒ Integer
Size of the uploaded part data.
Actions collapse
- #copy_from(options = {}) ⇒ Types::UploadPartCopyOutput
- #upload(options = {}) ⇒ Types::UploadPartOutput
Associations collapse
- #identifiers ⇒ Object deprecated private Deprecated.
- #multipart_upload ⇒ MultipartUpload
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Part
Returns the data for this MultipartUploadPart.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ MultipartUploadPart
constructor
A new instance of MultipartUploadPart.
- #load ⇒ Object (also: #reload) private
Constructor Details
#initialize(bucket_name, object_key, multipart_upload_id, part_number, options = {}) ⇒ MultipartUploadPart #initialize(options = {}) ⇒ MultipartUploadPart
Returns a new instance of MultipartUploadPart.
25 26 27 28 29 30 31 32 33 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 25 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, ) @object_key = extract_object_key(args, ) @multipart_upload_id = extract_multipart_upload_id(args, ) @part_number = extract_part_number(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#bucket_name ⇒ String
38 39 40 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 38 def bucket_name @bucket_name end |
#client ⇒ Client
78 79 80 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 78 def client @client end |
#copy_from(options = {}) ⇒ Types::UploadPartCopyOutput
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 177 def copy_from( = {}) = .merge( bucket: @bucket_name, key: @object_key, upload_id: @multipart_upload_id, part_number: @part_number ) resp = @client.upload_part_copy() resp.data end |
#data ⇒ Types::Part
Returns the data for this Aws::S3::MultipartUploadPart.
93 94 95 96 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 93 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
101 102 103 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 101 def data_loaded? !!@data end |
#etag ⇒ String
Entity tag returned when the part was uploaded.
65 66 67 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 65 def etag data.etag 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.
254 255 256 257 258 259 260 261 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 254 def identifiers { bucket_name: @bucket_name, object_key: @object_key, multipart_upload_id: @multipart_upload_id, part_number: @part_number } end |
#last_modified ⇒ Time
Date and time at which the part was uploaded.
59 60 61 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 59 def last_modified data.last_modified end |
#load ⇒ Object Also known as: reload
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.
84 85 86 87 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 84 def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end |
#multipart_upload ⇒ MultipartUpload
243 244 245 246 247 248 249 250 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 243 def multipart_upload MultipartUpload.new( bucket_name: @bucket_name, object_key: @object_key, id: @multipart_upload_id, client: @client ) end |
#multipart_upload_id ⇒ String
48 49 50 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 48 def multipart_upload_id @multipart_upload_id end |
#object_key ⇒ String
43 44 45 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 43 def object_key @object_key end |
#part_number ⇒ Integer
53 54 55 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 53 def part_number @part_number end |
#size ⇒ Integer
Size of the uploaded part data.
71 72 73 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 71 def size data.size end |
#upload(options = {}) ⇒ Types::UploadPartOutput
229 230 231 232 233 234 235 236 237 238 |
# File 'lib/aws-sdk-s3/multipart_upload_part.rb', line 229 def upload( = {}) = .merge( bucket: @bucket_name, key: @object_key, upload_id: @multipart_upload_id, part_number: @part_number ) resp = @client.upload_part() resp.data end |