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, AppVersionState, ReleaseType, ReviewType

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_clip_default_experienceObject

Returns the value of attribute app_clip_default_experience.



30
31
32
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 30

def app_clip_default_experience
  @app_clip_default_experience
end

#app_store_review_detailObject

Returns the value of attribute app_store_review_detail.



27
28
29
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 27

def app_store_review_detail
  @app_store_review_detail
end

#app_store_stateObject

Returns the value of attribute app_store_state.



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

def app_store_state
  @app_store_state
end

#app_store_version_localizationsObject

Returns the value of attribute app_store_version_localizations.



28
29
30
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 28

def app_store_version_localizations
  @app_store_version_localizations
end

#app_store_version_phased_releaseObject

Returns the value of attribute app_store_version_phased_release.



26
27
28
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 26

def app_store_version_phased_release
  @app_store_version_phased_release
end

#app_store_version_submissionObject

Returns the value of attribute app_store_version_submission.



25
26
27
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 25

def app_store_version_submission
  @app_store_version_submission
end

#app_version_stateObject

Returns the value of attribute app_version_state.



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

def app_version_state
  @app_version_state
end

Returns the value of attribute copyright.



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

def copyright
  @copyright
end

#created_dateObject

Returns the value of attribute created_date.



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

def created_date
  @created_date
end

#downloadableObject

Returns the value of attribute downloadable.



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

def downloadable
  @downloadable
end

#earliest_release_dateObject

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



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

def earliest_release_date
  @earliest_release_date
end

#is_watch_onlyObject

Returns the value of attribute is_watch_only.



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

def is_watch_only
  @is_watch_only
end

#platformObject

Returns the value of attribute platform.



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

def platform
  @platform
end

#release_typeObject

Returns the value of attribute release_type.



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

def release_type
  @release_type
end

#review_typeObject

Returns the value of attribute review_type.



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

def review_type
  @review_type
end

#store_iconObject

Returns the value of attribute store_icon.



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

def store_icon
  @store_icon
end

#version_stringObject

Returns the value of attribute version_string.



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

def version_string
  @version_string
end

#watch_store_iconObject

Returns the value of attribute watch_store_icon.



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

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,gameCenterConfiguration



134
135
136
137
138
139
140
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 134

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



114
115
116
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 114

def self.type
  return "appStoreVersions"
end

Instance Method Details

#can_reject?Boolean

Returns:

  • (Boolean)


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

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



176
177
178
179
180
181
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 176

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



161
162
163
164
165
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 161

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



199
200
201
202
203
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 199

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



225
226
227
228
229
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 225

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



215
216
217
218
219
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 215

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_reset_ratings_request(client: nil) ⇒ Object



272
273
274
275
276
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 272

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

Deprecated.


153
154
155
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 153

def fetch_age_rating_declaration(client: nil)
  raise 'AppStoreVersion no longer has AgeRatingDeclaration as of App Store Connect API 1.3 - Use AppInfo instead'
end

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



183
184
185
186
187
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 183

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



193
194
195
196
197
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 193

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



209
210
211
212
213
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 209

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_reset_ratings_request(client: nil) ⇒ Object

Reset Ratings Requests



266
267
268
269
270
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 266

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

#fetch_routing_app_coverage(client: nil) ⇒ Object

Routing App Coverages



251
252
253
254
255
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 251

def fetch_routing_app_coverage(client: nil)
  client ||= Spaceship::ConnectAPI
  resp = client.get_routing_app_coverage(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



167
168
169
170
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 167

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



235
236
237
238
239
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 235

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



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

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

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



241
242
243
244
245
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 241

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



142
143
144
145
146
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 142

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

#upload_routing_app_coverage(client: nil, path: nil) ⇒ Object



257
258
259
260
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 257

def upload_routing_app_coverage(client: nil, path: nil)
  client ||= Spaceship::ConnectAPI
  return Spaceship::ConnectAPI::RoutingAppCoverage.create(client: client, app_store_version_id: id, path: path)
end