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



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

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



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

def self.type
  return "appStoreVersions"
end

Instance Method Details

#can_reject?Boolean

Returns:

  • (Boolean)


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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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.


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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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

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



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

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



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

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