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_review_detailObject

Returns the value of attribute app_store_review_detail.



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

def app_store_review_detail
  @app_store_review_detail
end

#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_localizationsObject

Returns the value of attribute app_store_version_localizations.



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

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.



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

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.



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



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

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



75
76
77
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 75

def self.type
  return "appStoreVersions"
end

Instance Method Details

#can_reject?Boolean

Returns:

  • (Boolean)


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

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



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

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



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

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



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

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



186
187
188
189
190
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 186

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



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

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



218
219
220
221
222
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 218

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



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

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.


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

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



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

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



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

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



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

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



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

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



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

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



128
129
130
131
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 128

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



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

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



84
85
86
87
88
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 84

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

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



202
203
204
205
206
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 202

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



103
104
105
106
107
# File 'spaceship/lib/spaceship/connect_api/models/app_store_version.rb', line 103

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