fastlane 2.149.1 → 2.150.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/deliver/lib/deliver.rb +0 -1
  3. data/deliver/lib/deliver/app_screenshot.rb +26 -25
  4. data/deliver/lib/deliver/options.rb +6 -11
  5. data/deliver/lib/deliver/runner.rb +7 -4
  6. data/deliver/lib/deliver/setup.rb +5 -30
  7. data/deliver/lib/deliver/submit_for_review.rb +124 -87
  8. data/deliver/lib/deliver/upload_metadata.rb +284 -143
  9. data/deliver/lib/deliver/upload_price_tier.rb +15 -8
  10. data/deliver/lib/deliver/upload_screenshots.rb +86 -37
  11. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  12. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +3 -11
  13. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +3 -2
  14. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  15. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  16. data/fastlane/lib/fastlane/actions/slack.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  18. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -32
  19. data/fastlane/lib/fastlane/lane.rb +3 -3
  20. data/fastlane/lib/fastlane/swift_fastlane_function.rb +8 -4
  21. data/fastlane/lib/fastlane/version.rb +1 -1
  22. data/fastlane/swift/ControlCommand.swift +1 -0
  23. data/fastlane/swift/Fastlane.swift +48 -12
  24. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  25. data/fastlane/swift/LaneFileProtocol.swift +2 -5
  26. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  27. data/fastlane/swift/RubyCommand.swift +29 -6
  28. data/fastlane/swift/RubyCommandable.swift +1 -0
  29. data/fastlane/swift/Runner.swift +85 -13
  30. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  31. data/fastlane/swift/SnapshotfileProtocol.swift +3 -3
  32. data/fastlane/swift/SocketClient.swift +76 -45
  33. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  34. data/fastlane/swift/SocketResponse.swift +1 -0
  35. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  36. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  37. data/frameit/lib/frameit/device_types.rb +100 -100
  38. data/produce/lib/produce/itunes_connect.rb +20 -20
  39. data/produce/lib/produce/options.rb +3 -3
  40. data/sigh/lib/assets/resign.sh +7 -7
  41. data/snapshot/lib/assets/SnapshotHelper.swift +5 -5
  42. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  43. data/snapshot/lib/snapshot/options.rb +0 -1
  44. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  45. data/spaceship/lib/spaceship/.DS_Store +0 -0
  46. data/spaceship/lib/spaceship/connect_api.rb +21 -2
  47. data/spaceship/lib/spaceship/connect_api/client.rb +47 -11
  48. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  49. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +109 -0
  50. data/spaceship/lib/spaceship/connect_api/models/app.rb +113 -3
  51. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  52. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +74 -0
  53. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  54. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  55. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  56. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  57. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +117 -0
  58. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  59. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  60. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  61. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +70 -0
  62. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  63. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  64. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  65. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  66. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  67. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  68. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  69. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +703 -0
  70. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  71. data/supply/lib/supply/client.rb +19 -0
  72. data/supply/lib/supply/reader.rb +16 -0
  73. metadata +27 -24
  74. data/deliver/lib/deliver/upload_assets.rb +0 -27
  75. data/scan/lib/scan/.test_command_generator.rb.swp +0 -0
  76. data/snapshot/lib/snapshot/.test_command_generator_base.rb.swp +0 -0
@@ -0,0 +1,70 @@
1
+ require_relative '../model'
2
+ require_relative './app_screenshot_set'
3
+
4
+ module Spaceship
5
+ class ConnectAPI
6
+ class AppStoreVersionLocalization
7
+ include Spaceship::ConnectAPI::Model
8
+
9
+ attr_accessor :description
10
+ attr_accessor :locale
11
+ attr_accessor :keywords
12
+ attr_accessor :marketing_url
13
+ attr_accessor :promotional_text
14
+ attr_accessor :support_url
15
+ attr_accessor :whats_new
16
+
17
+ attr_accessor :app_screenshot_sets
18
+ attr_accessor :app_preview_sets
19
+
20
+ attr_mapping({
21
+ "description" => "description",
22
+ "locale" => "locale",
23
+ "keywords" => "keywords",
24
+ "marketingUrl" => "marketing_url",
25
+ "promotionalText" => "promotional_text",
26
+ "supportUrl" => "support_url",
27
+ "whatsNew" => "whats_new",
28
+
29
+ "appScreenshotSets" => "app_screenshot_sets",
30
+ "appPreviewSets" => "app_preview_sets"
31
+ })
32
+
33
+ def self.type
34
+ return "appStoreVersionLocalizations"
35
+ end
36
+
37
+ #
38
+ # API
39
+ #
40
+
41
+ def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
42
+ resp = Spaceship::ConnectAPI.get_app_store_version_localizations(filter: filter, includes: includes, limit: limit, sort: sort)
43
+ return resp.to_models
44
+ end
45
+
46
+ def update(attributes: nil)
47
+ Spaceship::ConnectAPI.patch_app_store_version_localization(app_store_version_localization_id: id, attributes: attributes)
48
+ end
49
+
50
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
51
+ Spaceship::ConnectAPI.delete_app_store_version_localization(app_store_version_localization_id: id)
52
+ end
53
+
54
+ #
55
+ # App Screenshot Sets
56
+ #
57
+
58
+ def get_app_screenshot_sets(filter: {}, includes: "appScreenshots", limit: nil, sort: nil)
59
+ filter ||= {}
60
+ filter["appStoreVersionLocalization"] = id
61
+ return Spaceship::ConnectAPI::AppScreenshotSet.all(filter: filter, includes: includes, limit: limit, sort: sort)
62
+ end
63
+
64
+ def create_app_screenshot_set(attributes: nil)
65
+ resp = Spaceship::ConnectAPI.post_app_screenshot_set(app_store_version_localization_id: id, attributes: attributes)
66
+ return resp.to_models.first
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,36 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppStoreVersionPhasedRelease
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :phased_release_state
8
+ attr_accessor :start_date
9
+ attr_accessor :total_pause_duration
10
+ attr_accessor :current_day_number
11
+
12
+ module PhasedReleaseState
13
+ INACTIVE = "INACTIVE"
14
+ end
15
+
16
+ attr_mapping({
17
+ "phasedReleaseState" => "phased_release_state",
18
+ "startDate" => "start_date",
19
+ "totalPauseDuration" => "total_pause_duration",
20
+ "currentDayNumber" => "current_day_number"
21
+ })
22
+
23
+ def self.type
24
+ return "appStoreVersionPhasedReleases"
25
+ end
26
+
27
+ #
28
+ # API
29
+ #
30
+
31
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
32
+ Spaceship::ConnectAPI.delete_app_store_version_phased_release(app_store_version_phased_release_id: id)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class AppStoreVersionSubmission
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :can_reject
8
+
9
+ attr_mapping({
10
+ "canReject" => "can_reject"
11
+ })
12
+
13
+ def self.type
14
+ return "appStoreVersionSubmissions"
15
+ end
16
+
17
+ #
18
+ # API
19
+ #
20
+
21
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
22
+ Spaceship::ConnectAPI.delete_app_store_version_submission(app_store_version_submission_id: id)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -129,6 +129,10 @@ module Spaceship
129
129
  return Spaceship::ConnectAPI.get_build(build_id: build_id, includes: includes).first
130
130
  end
131
131
 
132
+ def update(attributes: nil)
133
+ return Spaceship::ConnectAPI.patch_builds(build_id: id, attributes: attributes).first
134
+ end
135
+
132
136
  def add_beta_groups(beta_groups: nil)
133
137
  beta_groups ||= []
134
138
  beta_group_ids = beta_groups.map(&:id)
@@ -0,0 +1,40 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class IdfaDeclaration
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :serves_ads
8
+ attr_accessor :attributes_app_installation_to_previous_ad
9
+ attr_accessor :attributes_action_with_previous_ad
10
+ attr_accessor :honors_limited_ad_tracking
11
+
12
+ module AppStoreAgeRating
13
+ FOUR_PLUS = "FOUR_PLUS"
14
+ end
15
+
16
+ attr_mapping({
17
+ "servesAds" => "serves_ads",
18
+ "attributesAppInstallationToPreviousAd" => "attributes_app_installation_to_previous_ad",
19
+ "attributesActionWithPreviousAd" => "attributes_action_with_previous_ad",
20
+ "honorsLimitedAdTracking" => "honors_limited_ad_tracking"
21
+ })
22
+
23
+ def self.type
24
+ return "idfaDeclarations"
25
+ end
26
+
27
+ #
28
+ # API
29
+ #
30
+
31
+ def update(attributes: nil)
32
+ Spaceship::ConnectAPI.patch_idfa_declaration(idfa_declaration_id: id, attributes: attributes)
33
+ end
34
+
35
+ def delete!
36
+ Spaceship::ConnectAPI.delete_idfa_declaration(idfa_declaration_id: id)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../model'
2
+ module Spaceship
3
+ class ConnectAPI
4
+ class ResetRatingsRequest
5
+ include Spaceship::ConnectAPI::Model
6
+
7
+ attr_accessor :reset_date
8
+
9
+ attr_mapping({
10
+ "resetDate" => "reset_date"
11
+ })
12
+
13
+ def self.type
14
+ return "resetRatingsRequests"
15
+ end
16
+
17
+ #
18
+ # API
19
+ #
20
+
21
+ def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
22
+ Spaceship::ConnectAPI.delete_reset_ratings_request(reset_ratings_request_id: id)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -285,9 +285,16 @@ module Spaceship
285
285
  Client.instance.get("builds", params)
286
286
  end
287
287
 
288
- def get_build(build_id: nil, includes: nil)
289
- params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
290
- Client.instance.get("builds/#{build_id}", params)
288
+ def get_build(build_id: nil, app_store_version_id: nil, includes: nil)
289
+ if build_id
290
+ params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
291
+ return Client.instance.get("builds/#{build_id}", params)
292
+ elsif app_store_version_id
293
+ params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil, cursor: nil)
294
+ return Client.instance.get("appStoreVersions/#{app_store_version_id}/build", params)
295
+ else
296
+ return nil
297
+ end
291
298
  end
292
299
 
293
300
  def patch_builds(build_id: nil, attributes: {})
@@ -0,0 +1,33 @@
1
+ require_relative '../client'
2
+ require_relative '../../tunes/tunes_client'
3
+
4
+ module Spaceship
5
+ class ConnectAPI
6
+ module Tunes
7
+ class Client < Spaceship::ConnectAPI::Client
8
+ def self.instance
9
+ # Verify there is a token or a client that can be used
10
+ if Spaceship::ConnectAPI.token
11
+ if @client.nil? || @client.token != Spaceship::ConnectAPI.token
12
+ @client = Client.new(token: Spaceship::ConnectAPI.token)
13
+ end
14
+ elsif Spaceship::Tunes.client
15
+ # Initialize new client if new or if team changed
16
+ if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
17
+ @client = Client.client_with_authorization_from(Spaceship::Tunes.client)
18
+ end
19
+ end
20
+
21
+ # Need to handle not having a client but this shouldn't ever happen
22
+ raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client
23
+
24
+ @client
25
+ end
26
+
27
+ def self.hostname
28
+ 'https://appstoreconnect.apple.com/iris/v1/'
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,703 @@
1
+ require 'spaceship/connect_api/tunes/client'
2
+
3
+ module Spaceship
4
+ class ConnectAPI
5
+ module Tunes
6
+ #
7
+ # ageRatingDeclarations
8
+ #
9
+
10
+ def get_age_rating_declaration(app_store_version_id: nil)
11
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
12
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/ageRatingDeclaration", params)
13
+ end
14
+
15
+ def patch_age_rating_declaration(age_rating_declaration_id: nil, attributes: nil)
16
+ body = {
17
+ data: {
18
+ type: "ageRatingDeclarations",
19
+ id: age_rating_declaration_id,
20
+ attributes: attributes
21
+ }
22
+ }
23
+
24
+ Client.instance.patch("ageRatingDeclarations/#{age_rating_declaration_id}", body)
25
+ end
26
+
27
+ #
28
+ # app
29
+ #
30
+
31
+ def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil)
32
+ included = []
33
+ included << {
34
+ type: "appInfos",
35
+ id: "${new-appInfo-id}",
36
+ relationships: {
37
+ appInfoLocalizations: {
38
+ data: [
39
+ {
40
+ type: "appInfoLocalizations",
41
+ id: "${new-appInfoLocalization-id}"
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ }
47
+ included << {
48
+ type: "appInfoLocalizations",
49
+ id: "${new-appInfoLocalization-id}",
50
+ attributes: {
51
+ locale: primary_locale,
52
+ name: name
53
+ }
54
+ }
55
+
56
+ platforms.each do |platform|
57
+ included << {
58
+ type: "appStoreVersions",
59
+ id: "${store-version-#{platform}}",
60
+ attributes: {
61
+ platform: platform,
62
+ versionString: version_string
63
+ },
64
+ relationships: {
65
+ appStoreVersionLocalizations: {
66
+ data: [
67
+ {
68
+ type: "appStoreVersionLocalizations",
69
+ id: "${new-#{platform}VersionLocalization-id}"
70
+ }
71
+ ]
72
+ }
73
+ }
74
+ }
75
+
76
+ included << {
77
+ type: "appStoreVersionLocalizations",
78
+ id: "${new-#{platform}VersionLocalization-id}",
79
+ attributes: {
80
+ locale: primary_locale
81
+ }
82
+ }
83
+ end
84
+
85
+ app_store_verions_data = platforms.map do |platform|
86
+ {
87
+ type: "appStoreVersions",
88
+ id: "${store-version-#{platform}}"
89
+ }
90
+ end
91
+
92
+ body = {
93
+ data: {
94
+ type: "apps",
95
+ attributes: {
96
+ sku: sku,
97
+ primaryLocale: primary_locale,
98
+ bundleId: bundle_id
99
+ },
100
+ relationships: {
101
+ appStoreVersions: {
102
+ data: app_store_verions_data
103
+ },
104
+ appInfos: {
105
+ data: [
106
+ {
107
+ type: "appInfos",
108
+ id: "${new-appInfo-id}"
109
+ }
110
+ ]
111
+ }
112
+ }
113
+ },
114
+ included: included
115
+ }
116
+
117
+ Client.instance.post("apps", body)
118
+ end
119
+
120
+ def patch_app(app_id: nil, attributes: {})
121
+ body = {
122
+ data: {
123
+ type: "apps",
124
+ id: app_id,
125
+ attributes: attributes
126
+ }
127
+ }
128
+
129
+ Client.instance.patch("apps/#{app_id}", body)
130
+ end
131
+
132
+ def patch_app_app_prices(app_id: nil, app_price_tier_id: nil)
133
+ body = {
134
+ data: {
135
+ type: "apps",
136
+ id: app_id,
137
+ attributes: {
138
+ availableInNewTerritories: true
139
+ },
140
+ relationships: {
141
+ prices: {
142
+ data: [
143
+ {
144
+ type: "appPrices",
145
+ id: "${price1}"
146
+ }
147
+ ]
148
+ }
149
+ }
150
+ },
151
+ included: [
152
+ {
153
+ type: "appPrices",
154
+ id: "${price1}",
155
+ attributes: {
156
+ startDate: nil
157
+ },
158
+ relationships: {
159
+ app: {
160
+ data: {
161
+ type: "apps",
162
+ id: app_id
163
+ }
164
+ },
165
+ priceTier: {
166
+ data: {
167
+ type: "appPriceTiers",
168
+ id: app_price_tier_id.to_s
169
+ }
170
+ }
171
+ }
172
+ }
173
+ ]
174
+ }
175
+
176
+ Client.instance.patch("apps/#{app_id}", body)
177
+ end
178
+
179
+ #
180
+ # appPrices
181
+ #
182
+
183
+ def get_app_prices(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
184
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
185
+ Client.instance.get("appPrices", params)
186
+ end
187
+
188
+ #
189
+ # appReviewAttachments
190
+ #
191
+
192
+ def get_app_review_attachments(app_store_review_detail_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
193
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
194
+ Client.instance.get("appStoreReviewDetails/#{app_store_review_detail_id}/appReviewAttachments", params)
195
+ end
196
+
197
+ def post_app_review_attachment(app_store_review_detail_id: nil, attributes: {})
198
+ body = {
199
+ data: {
200
+ type: "appReviewAttachments",
201
+ attributes: attributes,
202
+ relationships: {
203
+ appStoreReviewDetail: {
204
+ data: {
205
+ type: "appStoreReviewDetails",
206
+ id: app_store_review_detail_id
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ Client.instance.post("appReviewAttachments", body)
214
+ end
215
+
216
+ def patch_app_review_attachment(app_review_attachment_id: nil, attributes: {})
217
+ body = {
218
+ data: {
219
+ type: "appReviewAttachments",
220
+ id: app_review_attachment_id,
221
+ attributes: attributes
222
+ }
223
+ }
224
+
225
+ Client.instance.patch("appReviewAttachments/#{app_review_attachment_id}", body)
226
+ end
227
+
228
+ def delete_app_review_attachment(app_review_attachment_id: nil)
229
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
230
+ Client.instance.delete("appReviewAttachments/#{app_review_attachment_id}", params)
231
+ end
232
+
233
+ #
234
+ # appScreenshotSets
235
+ #
236
+
237
+ def get_app_screenshot_sets(filter: {}, includes: nil, limit: nil, sort: nil)
238
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
239
+ Client.instance.get("appScreenshotSets", params)
240
+ end
241
+
242
+ def post_app_screenshot_set(app_store_version_localization_id: nil, attributes: {})
243
+ body = {
244
+ data: {
245
+ type: "appScreenshotSets",
246
+ attributes: attributes,
247
+ relationships: {
248
+ appStoreVersionLocalization: {
249
+ data: {
250
+ type: "appStoreVersionLocalizations",
251
+ id: app_store_version_localization_id
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ Client.instance.post("appScreenshotSets", body)
259
+ end
260
+
261
+ #
262
+ # appScreenshots
263
+ #
264
+
265
+ def post_app_screenshot(app_screenshot_set_id: nil, attributes: {})
266
+ body = {
267
+ data: {
268
+ type: "appScreenshots",
269
+ attributes: attributes,
270
+ relationships: {
271
+ appScreenshotSet: {
272
+ data: {
273
+ type: "appScreenshotSets",
274
+ id: app_screenshot_set_id
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+
281
+ Client.instance.post("appScreenshots", body)
282
+ end
283
+
284
+ def patch_app_screenshot(app_screenshot_id: nil, attributes: {})
285
+ body = {
286
+ data: {
287
+ type: "appScreenshots",
288
+ id: app_screenshot_id,
289
+ attributes: attributes
290
+ }
291
+ }
292
+
293
+ Client.instance.patch("appScreenshots/#{app_screenshot_id}", body)
294
+ end
295
+
296
+ def delete_app_screenshot(app_screenshot_id: nil)
297
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
298
+ Client.instance.delete("appScreenshots/#{app_screenshot_id}", params)
299
+ end
300
+
301
+ #
302
+ # appInfos
303
+ #
304
+
305
+ def get_app_infos(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
306
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
307
+ Client.instance.get("apps/#{app_id}/appInfos", params)
308
+ end
309
+
310
+ def patch_app_info(app_info_id: nil, attributes: {})
311
+ attributes ||= {}
312
+
313
+ data = {
314
+ type: "appInfos",
315
+ id: app_info_id
316
+ }
317
+ data[:attributes] = attributes unless attributes.empty?
318
+
319
+ body = {
320
+ data: data
321
+ }
322
+
323
+ Client.instance.patch("appInfos/#{app_info_id}", body)
324
+ end
325
+
326
+ def patch_app_info_categories(app_info_id: nil, primary_category_id: nil, secondary_category_id: nil, primary_subcategory_one_id: nil, primary_subcategory_two_id: nil, secondary_subcategory_one_id: nil, secondary_subcategory_two_id: nil)
327
+ relationships = {
328
+ primaryCategory: {
329
+ data: primary_category_id ? { type: "appCategories", id: primary_category_id } : nil
330
+ },
331
+ secondaryCategory: {
332
+ data: secondary_category_id ? { type: "appCategories", id: secondary_category_id } : nil
333
+ },
334
+ primarySubcategoryOne: {
335
+ data: primary_subcategory_one_id ? { type: "appCategories", id: primary_subcategory_one_id } : nil
336
+ },
337
+ primarySubcategoryTwo: {
338
+ data: primary_subcategory_two_id ? { type: "appCategories", id: primary_subcategory_two_id } : nil
339
+ },
340
+ secondarySubcategoryOne: {
341
+ data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
342
+ },
343
+ secondarySubcategoryTwo: {
344
+ data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
345
+ }
346
+ }
347
+
348
+ data = {
349
+ type: "appInfos",
350
+ id: app_info_id
351
+ }
352
+ data[:relationships] = relationships unless relationships.empty?
353
+
354
+ body = {
355
+ data: data
356
+ }
357
+
358
+ Client.instance.patch("appInfos/#{app_info_id}", body)
359
+ end
360
+
361
+ def delete_app_info(app_info_id: nil)
362
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
363
+ Client.instance.delete("appInfos/#{app_info_id}", params)
364
+ end
365
+
366
+ #
367
+ # appInfoLocalizations
368
+ #
369
+
370
+ def get_app_info_localizations(app_info_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
371
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
372
+ Client.instance.get("appInfos/#{app_info_id}/appInfoLocalizations", params)
373
+ end
374
+
375
+ def post_app_info_localization(app_info_id: nil, attributes: {})
376
+ body = {
377
+ data: {
378
+ type: "appInfoLocalizations",
379
+ attributes: attributes,
380
+ relationships: {
381
+ appStoreVersion: {
382
+ data: {
383
+ type: "appStoreVersions",
384
+ id: app_info_id
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ Client.instance.post("appInfoLocalizations", body)
392
+ end
393
+
394
+ def patch_app_info_localization(app_info_localization_id: nil, attributes: {})
395
+ body = {
396
+ data: {
397
+ type: "appInfoLocalizations",
398
+ id: app_info_localization_id,
399
+ attributes: attributes
400
+ }
401
+ }
402
+
403
+ Client.instance.patch("appInfoLocalizations/#{app_info_localization_id}", body)
404
+ end
405
+
406
+ #
407
+ # appStoreReviewDetails
408
+ #
409
+
410
+ def get_app_store_review_detail(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
411
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
412
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/appStoreReviewDetail", params)
413
+ end
414
+
415
+ def post_app_store_review_detail(app_store_version_id: nil, attributes: {})
416
+ body = {
417
+ data: {
418
+ type: "appStoreReviewDetails",
419
+ attributes: attributes,
420
+ relationships: {
421
+ appStoreVersion: {
422
+ data: {
423
+ type: "appStoreVersions",
424
+ id: app_store_version_id
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+
431
+ Client.instance.post("appStoreReviewDetails", body)
432
+ end
433
+
434
+ def patch_app_store_review_detail(app_store_review_detail_id: nil, attributes: {})
435
+ body = {
436
+ data: {
437
+ type: "appStoreReviewDetails",
438
+ id: app_store_review_detail_id,
439
+ attributes: attributes
440
+ }
441
+ }
442
+
443
+ Client.instance.patch("appStoreReviewDetails/#{app_store_review_detail_id}", body)
444
+ end
445
+
446
+ #
447
+ # appStoreVersionLocalizations
448
+ #
449
+
450
+ def get_app_store_version_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
451
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
452
+ Client.instance.get("appStoreVersionLocalizations", params)
453
+ end
454
+
455
+ def post_app_store_version_localization(app_store_version_id: nil, attributes: {})
456
+ body = {
457
+ data: {
458
+ type: "appStoreVersionLocalizations",
459
+ attributes: attributes,
460
+ relationships: {
461
+ appStoreVersion: {
462
+ data: {
463
+ type: "appStoreVersions",
464
+ id: app_store_version_id
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
470
+
471
+ Client.instance.post("appStoreVersionLocalizations", body)
472
+ end
473
+
474
+ def patch_app_store_version_localization(app_store_version_localization_id: nil, attributes: {})
475
+ body = {
476
+ data: {
477
+ type: "appStoreVersionLocalizations",
478
+ id: app_store_version_localization_id,
479
+ attributes: attributes
480
+ }
481
+ }
482
+
483
+ Client.instance.patch("appStoreVersionLocalizations/#{app_store_version_localization_id}", body)
484
+ end
485
+
486
+ def delete_app_store_version_localization(app_store_version_localization_id: nil)
487
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
488
+ Client.instance.delete("appStoreVersionLocalizations/#{app_store_version_localization_id}", params)
489
+ end
490
+
491
+ #
492
+ # appStoreVersionPhasedReleases
493
+ #
494
+
495
+ def get_app_store_version_phased_release(app_store_version_id: nil)
496
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
497
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/appStoreVersionPhasedRelease", params)
498
+ end
499
+
500
+ def post_app_store_version_phased_release(app_store_version_id: nil, attributes: {})
501
+ body = {
502
+ data: {
503
+ type: "appStoreVersionPhasedReleases",
504
+ attributes: attributes,
505
+ relationships: {
506
+ appStoreVersion: {
507
+ data: {
508
+ type: "appStoreVersions",
509
+ id: app_store_version_id
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+
516
+ Client.instance.post("appStoreVersionPhasedReleases", body)
517
+ end
518
+
519
+ def delete_app_store_version_phased_release(app_store_version_phased_release_id: nil)
520
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
521
+ Client.instance.delete("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", params)
522
+ end
523
+
524
+ #
525
+ # appStoreVersions
526
+ #
527
+
528
+ def get_app_store_versions(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
529
+ params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
530
+ Client.instance.get("apps/#{app_id}/appStoreVersions", params)
531
+ end
532
+
533
+ def get_app_store_version(app_store_version_id: nil, includes: nil)
534
+ params = Client.instance.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
535
+ Client.instance.get("appStoreVersions/#{app_store_version_id}", params)
536
+ end
537
+
538
+ def post_app_store_version(app_id: nil, attributes: {})
539
+ body = {
540
+ data: {
541
+ type: "appStoreVersions",
542
+ attributes: attributes,
543
+ relationships: {
544
+ app: {
545
+ data: {
546
+ type: "apps",
547
+ id: app_id
548
+ }
549
+ }
550
+ }
551
+ }
552
+ }
553
+
554
+ Client.instance.post("appStoreVersions", body)
555
+ end
556
+
557
+ def patch_app_store_version(app_store_version_id: nil, attributes: {})
558
+ body = {
559
+ data: {
560
+ type: "appStoreVersions",
561
+ id: app_store_version_id,
562
+ attributes: attributes
563
+ }
564
+ }
565
+
566
+ Client.instance.patch("appStoreVersions/#{app_store_version_id}", body)
567
+ end
568
+
569
+ def patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil)
570
+ data = nil
571
+ if build_id
572
+ data = {
573
+ type: "builds",
574
+ id: build_id
575
+ }
576
+ end
577
+
578
+ body = {
579
+ data: {
580
+ type: "appStoreVersions",
581
+ id: app_store_version_id,
582
+ relationships: {
583
+ build: {
584
+ data: data
585
+ }
586
+ }
587
+ }
588
+ }
589
+
590
+ Client.instance.patch("appStoreVersions/#{app_store_version_id}", body)
591
+ end
592
+
593
+ #
594
+ # appStoreVersionPhasedReleases
595
+ #
596
+
597
+ def get_reset_ratings_request(app_store_version_id: nil)
598
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
599
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/resetRatingsRequest", params)
600
+ end
601
+
602
+ def post_reset_ratings_request(app_store_version_id: nil)
603
+ body = {
604
+ data: {
605
+ type: "resetRatingsRequests",
606
+ relationships: {
607
+ appStoreVersion: {
608
+ data: {
609
+ type: "appStoreVersions",
610
+ id: app_store_version_id
611
+ }
612
+ }
613
+ }
614
+ }
615
+ }
616
+
617
+ Client.instance.post("resetRatingsRequests", body)
618
+ end
619
+
620
+ def delete_reset_ratings_request(reset_ratings_request_id: nil)
621
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
622
+ Client.instance.delete("resetRatingsRequests/#{reset_ratings_request_id}", params)
623
+ end
624
+
625
+ #
626
+ # appStoreVersionSubmissions
627
+ #
628
+
629
+ def get_app_store_version_submission(app_store_version_id: nil)
630
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
631
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/appStoreVersionSubmission", params)
632
+ end
633
+
634
+ def post_app_store_version_submission(app_store_version_id: nil)
635
+ body = {
636
+ data: {
637
+ type: "appStoreVersionSubmissions",
638
+ relationships: {
639
+ appStoreVersion: {
640
+ data: {
641
+ type: "appStoreVersions",
642
+ id: app_store_version_id
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+
649
+ Client.instance.post("appStoreVersionSubmissions", body)
650
+ end
651
+
652
+ def delete_app_store_version_submission(app_store_version_submission_id: nil)
653
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
654
+ Client.instance.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
655
+ end
656
+
657
+ #
658
+ # idfaDeclarations
659
+ #
660
+
661
+ def get_idfa_declaration(app_store_version_id: nil)
662
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
663
+ Client.instance.get("appStoreVersions/#{app_store_version_id}/idfaDeclaration", params)
664
+ end
665
+
666
+ def post_idfa_declaration(app_store_version_id: nil, attributes: nil)
667
+ body = {
668
+ data: {
669
+ type: "idfaDeclarations",
670
+ attributes: attributes,
671
+ relationships: {
672
+ appStoreVersion: {
673
+ data: {
674
+ type: "appStoreVersions",
675
+ id: app_store_version_id
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+
682
+ Client.instance.post("idfaDeclarations", body)
683
+ end
684
+
685
+ def patch_idfa_declaration(idfa_declaration_id: nil, attributes: nil)
686
+ body = {
687
+ data: {
688
+ type: "idfaDeclarations",
689
+ id: idfa_declaration_id,
690
+ attributes: attributes
691
+ }
692
+ }
693
+
694
+ Client.instance.patch("idfaDeclarations/#{idfa_declaration_id}", body)
695
+ end
696
+
697
+ def delete_idfa_declaration(idfa_declaration_id: nil)
698
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
699
+ Client.instance.delete("idfaDeclarations/#{idfa_declaration_id}", params)
700
+ end
701
+ end
702
+ end
703
+ end