Class: Spaceship::ConnectAPI::AppStoreVersion

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

Defined Under Namespace

Modules: AppStoreState, ReleaseType

Constant Summary collapse

ESSENTIAL_INCLUDES =
[
  "appStoreVersionSubmission",
  "build"
].join(",")

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_stateObject

Returns the value of attribute app_store_state.



12
13
14
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 12

def app_store_state
  @app_store_state
end

#app_store_version_submissionObject

Returns the value of attribute app_store_version_submission.



23
24
25
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 23

def app_store_version_submission
  @app_store_version_submission
end

Returns the value of attribute copyright.



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

def copyright
  @copyright
end

#created_dateObject

Returns the value of attribute created_date.



21
22
23
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 21

def created_date
  @created_date
end

#downloadableObject

Returns the value of attribute downloadable.



20
21
22
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 20

def downloadable
  @downloadable
end

#earliest_release_dateObject

2020-06-17T12:00:00-07:00



17
18
19
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 17

def earliest_release_date
  @earliest_release_date
end

#is_watch_onlyObject

Returns the value of attribute is_watch_only.



19
20
21
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 19

def is_watch_only
  @is_watch_only
end

#platformObject

Returns the value of attribute platform.



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

def platform
  @platform
end

#release_typeObject

Returns the value of attribute release_type.



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

def release_type
  @release_type
end

#store_iconObject

Returns the value of attribute store_icon.



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

def store_icon
  @store_icon
end

#uses_idfaObject

Returns the value of attribute uses_idfa.



18
19
20
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 18

def uses_idfa
  @uses_idfa
end

#version_stringObject

Returns the value of attribute version_string.



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

def version_string
  @version_string
end

#watch_store_iconObject

Returns the value of attribute watch_store_icon.



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

def watch_store_icon
  @watch_store_icon
end

Class Method Details

.get(client: nil, app_store_version_id: nil, includes: nil, limit: nil, sort: nil) ⇒ Object

app,routingAppCoverage,resetRatingsRequest,appStoreVersionSubmission,appStoreVersionPhasedRelease,ageRatingDeclaration,appStoreReviewDetail,idfaDeclaration,gameCenterConfiguration



88
89
90
91
92
93
94
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 88

def self.get(client: nil, app_store_version_id: nil, includes: nil, limit: nil, sort: nil)
  client ||= Spaceship::ConnectAPI
  return client.get_app_store_version(
    app_store_version_id: app_store_version_id,
    includes: includes
  ).first
end

.typeObject



68
69
70
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 68

def self.type
  return "appStoreVersions"
end

Instance Method Details

#can_reject?Boolean

Returns:

  • (Boolean)


72
73
74
75
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 72

def can_reject?
  raise "No app_store_version_submission included" unless app_store_version_submission
  return app_store_version_submission.can_reject
end

#create_app_store_review_detail(client: nil, attributes: nil) ⇒ Object

App Store Review Detail



131
132
133
134
135
136
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 131

def create_app_store_review_detail(client: nil, attributes: nil)
  client ||= Spaceship::ConnectAPI
  attributes = Spaceship::ConnectAPI::AppStoreReviewDetail.reverse_attr_mapping(attributes)
  resp = client.post_app_store_review_detail(app_store_version_id: id, attributes: attributes)
  return resp.to_models.first
end

#create_app_store_version_localization(client: nil, attributes: nil) ⇒ Object

App Store Version Localizations



116
117
118
119
120
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 116

def create_app_store_version_localization(client: nil, attributes: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_app_store_version_localization(app_store_version_id: id, attributes: attributes)
  return resp.to_models.first
end

#create_app_store_version_phased_release(client: nil, attributes: nil) ⇒ Object



154
155
156
157
158
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 154

def create_app_store_version_phased_release(client: nil, attributes: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_app_store_version_phased_release(app_store_version_id: id, attributes: attributes)
  return resp.to_models.first
end

#create_app_store_version_release_request(client: nil) ⇒ Object

App Store Version Release Requests



180
181
182
183
184
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 180

def create_app_store_version_release_request(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_app_store_version_release_request(app_store_version_id: id)
  return resp.to_models.first
end

#create_app_store_version_submission(client: nil) ⇒ Object



170
171
172
173
174
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 170

def create_app_store_version_submission(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_app_store_version_submission(app_store_version_id: id)
  return resp.to_models.first
end

#create_idfa_declaration(client: nil, attributes: nil) ⇒ Object



212
213
214
215
216
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 212

def create_idfa_declaration(client: nil, attributes: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_idfa_declaration(app_store_version_id: id, attributes: attributes)
  return resp.to_models.first
end

#create_reset_ratings_request(client: nil) ⇒ Object



228
229
230
231
232
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 228

def create_reset_ratings_request(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.post_reset_ratings_request(app_store_version_id: id)
  return resp.to_models.first
end

#fetch_age_rating_declaration(client: nil) ⇒ Object

Age Rating Declaration



106
107
108
109
110
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 106

def fetch_age_rating_declaration(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_age_rating_declaration(app_store_version_id: id)
  return resp.to_models.first
end

#fetch_app_store_review_detail(client: nil, includes: "appStoreReviewAttachments") ⇒ Object



138
139
140
141
142
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 138

def fetch_app_store_review_detail(client: nil, includes: "appStoreReviewAttachments")
  client ||= Spaceship::ConnectAPI
  resp = client.get_app_store_review_detail(app_store_version_id: id, includes: includes)
  return resp.to_models.first
end

#fetch_app_store_version_phased_release(client: nil) ⇒ Object

App Store Version Phased Releases



148
149
150
151
152
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 148

def fetch_app_store_version_phased_release(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_app_store_version_phased_release(app_store_version_id: id)
  return resp.to_models.first
end

#fetch_app_store_version_submission(client: nil) ⇒ Object

App Store Version Submissions



164
165
166
167
168
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 164

def fetch_app_store_version_submission(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_app_store_version_submission(app_store_version_id: id)
  return resp.to_models.first
end

#fetch_idfa_declaration(client: nil) ⇒ Object

IDFA Declarations



206
207
208
209
210
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 206

def fetch_idfa_declaration(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_idfa_declaration(app_store_version_id: id)
  return resp.to_models.first
end

#fetch_reset_ratings_request(client: nil) ⇒ Object

Reset Ratings Requests



222
223
224
225
226
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 222

def fetch_reset_ratings_request(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_reset_ratings_request(app_store_version_id: id)
  return resp.to_models.first
end

#get_app_store_version_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object



122
123
124
125
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 122

def get_app_store_version_localizations(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  client ||= Spaceship::ConnectAPI
  return Spaceship::ConnectAPI::AppStoreVersionLocalization.all(client: client, app_store_version_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
end

#get_build(client: nil, build_id: nil) ⇒ Object

Build



190
191
192
193
194
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 190

def get_build(client: nil, build_id: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_build(app_store_version_id: id, build_id: build_id)
  return resp.to_models.first
end

#reject!Object



77
78
79
80
81
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 77

def reject!
  return false unless can_reject?
  app_store_version_submission.delete!
  return true
end

#select_build(client: nil, build_id: nil) ⇒ Object



196
197
198
199
200
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 196

def select_build(client: nil, build_id: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.patch_app_store_version_with_build(app_store_version_id: id, build_id: build_id)
  return resp.to_models.first
end

#update(client: nil, attributes: nil) ⇒ Object



96
97
98
99
100
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 96

def update(client: nil, attributes: nil)
  client ||= Spaceship::ConnectAPI
  attributes = reverse_attr_mapping(attributes)
  return client.patch_app_store_version(app_store_version_id: id, attributes: attributes).first
end