Class: Spaceship::ConnectAPI::ReviewSubmission

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
spaceship/lib/spaceship/connect_api/models/review_submission.rb

Defined Under Namespace

Modules: ReviewSubmissionState

Instance Attribute Summary collapse

Attributes included from Model

#id, #reverse_attr_map

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

#app_store_version_for_reviewObject

Returns the value of attribute app_store_version_for_review.



13
14
15
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 13

def app_store_version_for_review
  @app_store_version_for_review
end

#itemsObject

Returns the value of attribute items.



14
15
16
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 14

def items
  @items
end

#last_updated_by_actorObject

Returns the value of attribute last_updated_by_actor.



15
16
17
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 15

def last_updated_by_actor
  @last_updated_by_actor
end

#platformObject

Returns the value of attribute platform.



9
10
11
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 9

def platform
  @platform
end

#stateObject

Returns the value of attribute state.



10
11
12
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 10

def state
  @state
end

#submitted_by_actorObject

Returns the value of attribute submitted_by_actor.



16
17
18
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 16

def 
  @submitted_by_actor
end

#submitted_dateObject

Returns the value of attribute submitted_date.



11
12
13
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 11

def 
  @submitted_date
end

Class Method Details

.get(client: nil, review_submission_id:, includes: nil) ⇒ Object

appStoreVersionForReview,items,submittedByActor,lastUpdatedByActor



47
48
49
50
51
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 47

def self.get(client: nil, review_submission_id:, includes: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_review_submission(review_submission_id: review_submission_id, includes: includes)
  return resp.to_models.first
end

.typeObject



38
39
40
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 38

def self.type
  return "reviewSubmissions"
end

Instance Method Details

#add_app_store_version_to_review_items(client: nil, app_store_version_id:) ⇒ Object



67
68
69
70
71
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 67

def add_app_store_version_to_review_items(client: nil, app_store_version_id:)
  client ||= Spaceship::ConnectAPI
  resp = client.post_review_submission_item(review_submission_id: id, app_store_version_id: app_store_version_id)
  return resp.to_models.first
end

#cancel_submission(client: nil) ⇒ Object



60
61
62
63
64
65
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 60

def cancel_submission(client: nil)
  client ||= Spaceship::ConnectAPI
  attributes = { canceled: true }
  resp = client.patch_review_submission(review_submission_id: id, attributes: attributes)
  return resp.to_models.first
end

#fetch_resolution_center_threads(client: nil) ⇒ Object



73
74
75
76
77
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 73

def fetch_resolution_center_threads(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_resolution_center_threads(filter: { reviewSubmission: id }, includes: 'reviewSubmission')
  return resp.to_models
end

#latest_resolution_center_messages(client: nil) ⇒ Object



79
80
81
82
83
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 79

def latest_resolution_center_messages(client: nil)
  client ||= Spaceship::ConnectAPI
  threads = fetch_resolution_center_threads(client: client)
  threads.first.fetch_messages(client: client)
end

#submit_for_review(client: nil) ⇒ Object



53
54
55
56
57
58
# File 'spaceship/lib/spaceship/connect_api/models/review_submission.rb', line 53

def submit_for_review(client: nil)
  client ||= Spaceship::ConnectAPI
  attributes = { submitted: true }
  resp = client.patch_review_submission(review_submission_id: id, attributes: attributes)
  return resp.to_models.first
end