Class: Spaceship::ConnectAPI::AppReviewAttachment
- Inherits:
-
Object
- Object
- Spaceship::ConnectAPI::AppReviewAttachment
- Includes:
- Model
- Defined in:
- spaceship/lib/spaceship/connect_api/models/app_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, #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_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_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_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_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_review_attachment.rb', line 14 def uploaded @uploaded end |
Class Method Details
.create(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 |
# File 'spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb', line 32 def self.create(app_store_review_detail_id: nil, path: nil) require 'faraday' filename = File.basename(path) filesize = File.size(path) bytes = File.binread(path) post_attributes = { fileSize: filesize, fileName: filename } # Create placeholder = Spaceship::ConnectAPI.( 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) } Spaceship::ConnectAPI.( app_review_attachment_id: .id, attributes: patch_attributes ).to_models.first end |
.type ⇒ Object
24 25 26 |
# File 'spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb', line 24 def self.type return "appReviewAttachments" end |
Instance Method Details
#delete!(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object
66 67 68 |
# File 'spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb', line 66 def delete!(filter: {}, includes: nil, limit: nil, sort: nil) Spaceship::ConnectAPI.(app_review_attachment_id: id) end |