Class: Spaceship::ConnectAPI::AppStoreReviewAttachment
- Inherits:
-
Object
- Object
- Spaceship::ConnectAPI::AppStoreReviewAttachment
- Includes:
- Model
- Defined in:
- spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb
Instance Attribute Summary collapse
-
#asset_delivery_state ⇒ Object
Returns the value of attribute asset_delivery_state.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#source_file_checksum ⇒ Object
Returns the value of attribute source_file_checksum.
-
#upload_operations ⇒ Object
Returns the value of attribute upload_operations.
-
#uploaded ⇒ Object
Returns the value of attribute uploaded.
Attributes included from Model
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes
Instance Attribute Details
#asset_delivery_state ⇒ Object
Returns the value of attribute asset_delivery_state.
13 14 15 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 13 def asset_delivery_state @asset_delivery_state end |
#file_name ⇒ Object
Returns the value of attribute file_name.
10 11 12 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 10 def file_name @file_name end |
#source_file_checksum ⇒ Object
Returns the value of attribute source_file_checksum.
11 12 13 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 11 def source_file_checksum @source_file_checksum end |
#upload_operations ⇒ Object
Returns the value of attribute upload_operations.
12 13 14 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 12 def upload_operations @upload_operations end |
#uploaded ⇒ Object
Returns the value of attribute uploaded.
14 15 16 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 14 def uploaded @uploaded end |
Class Method Details
.create(client: nil, app_store_review_detail_id: nil, path: nil) ⇒ Object
API
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 32 def self.create(client: nil, app_store_review_detail_id: nil, path: nil) client ||= Spaceship::ConnectAPI require 'faraday' filename = File.basename(path) filesize = File.size(path) bytes = File.binread(path) post_attributes = { fileSize: filesize, fileName: filename } # Create placeholder = client.( app_store_review_detail_id: app_store_review_detail_id, attributes: post_attributes ).to_models.first # Upload the file upload_operations = .upload_operations Spaceship::ConnectAPI::FileUploader.upload(upload_operations, bytes) # Update file uploading complete patch_attributes = { uploaded: true, sourceFileChecksum: Digest::MD5.hexdigest(bytes) } client.( app_store_review_attachment_id: .id, attributes: patch_attributes ).to_models.first end |
.type ⇒ Object
24 25 26 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 24 def self.type return "appStoreReviewAttachments" end |
Instance Method Details
#delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object
67 68 69 70 |
# File 'spaceship/lib/spaceship/connect_api/models/app_store_review_attachment.rb', line 67 def delete!(client: nil, filter: {}, includes: nil, limit: nil, sort: nil) client ||= Spaceship::ConnectAPI client.(app_store_review_attachment_id: id) end |