fastlane 2.155.2 → 2.157.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +74 -74
- data/deliver/lib/deliver.rb +1 -0
- data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
- data/deliver/lib/deliver/detect_values.rb +4 -1
- data/deliver/lib/deliver/languages.rb +7 -0
- data/deliver/lib/deliver/loader.rb +4 -5
- data/deliver/lib/deliver/queue_worker.rb +64 -0
- data/deliver/lib/deliver/runner.rb +7 -5
- data/deliver/lib/deliver/upload_screenshots.rb +143 -128
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +120 -0
- data/fastlane/lib/fastlane/actions/commit_version_bump.rb +1 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +17 -1
- data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -2
- data/fastlane/lib/fastlane/actions/sonar.rb +5 -0
- data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
- data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +4 -0
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +1 -1
- data/fastlane/swift/Fastlane.swift +67 -7
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +1 -1
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +1 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
- data/fastlane_core/lib/fastlane_core/command_executor.rb +1 -0
- data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +71 -42
- data/fastlane_core/lib/fastlane_core/project.rb +1 -0
- data/gym/lib/gym/error_handler.rb +1 -1
- data/gym/lib/gym/generators/build_command_generator.rb +0 -1
- data/pilot/lib/pilot/build_manager.rb +18 -4
- data/pilot/lib/pilot/manager.rb +16 -5
- data/pilot/lib/pilot/options.rb +16 -0
- data/produce/lib/produce/itunes_connect.rb +2 -2
- data/scan/lib/scan/test_command_generator.rb +3 -1
- data/screengrab/lib/screengrab/runner.rb +36 -17
- data/sigh/lib/sigh/runner.rb +6 -5
- data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
- data/spaceship/lib/spaceship.rb +4 -0
- data/spaceship/lib/spaceship/client.rb +2 -0
- data/spaceship/lib/spaceship/connect_api.rb +0 -15
- data/spaceship/lib/spaceship/connect_api/api_client.rb +270 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +144 -213
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +3 -2
- data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +75 -64
- data/spaceship/lib/spaceship/connect_api/spaceship.rb +98 -0
- data/spaceship/lib/spaceship/connect_api/testflight/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +288 -277
- data/spaceship/lib/spaceship/connect_api/token.rb +46 -5
- data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
- data/spaceship/lib/spaceship/connect_api/tunes/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +717 -706
- data/spaceship/lib/spaceship/connect_api/users/client.rb +8 -17
- data/spaceship/lib/spaceship/connect_api/users/users.rb +28 -17
- data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
- metadata +25 -19
- data/sigh/lib/sigh/.module.rb.swp +0 -0
- data/sigh/lib/sigh/.options.rb.swp +0 -0
- data/sigh/lib/sigh/.runner.rb.swp +0 -0
@@ -16,24 +16,65 @@ module Spaceship
|
|
16
16
|
attr_reader :key_id
|
17
17
|
attr_reader :issuer_id
|
18
18
|
attr_reader :text
|
19
|
+
attr_reader :duration
|
20
|
+
attr_reader :expiration
|
19
21
|
|
20
|
-
|
22
|
+
# Temporary attribute not needed to create the JWT text
|
23
|
+
# There is no way to determine if the team associated with this
|
24
|
+
# key is for App Store or Enterprise so this is the temporary workaround
|
25
|
+
attr_accessor :in_house
|
26
|
+
|
27
|
+
def self.from_json_file(filepath)
|
28
|
+
json = JSON.parse(File.read(filepath), { symbolize_names: true })
|
29
|
+
|
30
|
+
missing_keys = []
|
31
|
+
missing_keys << 'key_id' unless json.key?(:key_id)
|
32
|
+
missing_keys << 'issuer_id' unless json.key?(:issuer_id)
|
33
|
+
missing_keys << 'key' unless json.key?(:key)
|
34
|
+
|
35
|
+
unless missing_keys.empty?
|
36
|
+
raise "App Store Connect API key JSON is missing field(s): #{missing_keys.join(', ')}"
|
37
|
+
end
|
38
|
+
|
39
|
+
self.create(json)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.create(key_id: nil, issuer_id: nil, filepath: nil, key: nil, duration: nil, in_house: nil)
|
21
43
|
key_id ||= ENV['SPACESHIP_CONNECT_API_KEY_ID']
|
22
44
|
issuer_id ||= ENV['SPACESHIP_CONNECT_API_ISSUER_ID']
|
23
45
|
filepath ||= ENV['SPACESHIP_CONNECT_API_KEY_FILEPATH']
|
46
|
+
duration ||= ENV['SPACESHIP_CONNECT_API_TOKEN_DURATION']
|
47
|
+
|
48
|
+
in_house_env = ENV['SPACESHIP_CONNECT_API_IN_HOUSE']
|
49
|
+
in_house ||= !["", "no", "false", "off", "0"].include?(in_house_env) if in_house_env
|
50
|
+
|
51
|
+
key ||= ENV['SPACESHIP_CONNECT_API_KEY']
|
52
|
+
key ||= File.binread(filepath)
|
24
53
|
|
25
54
|
self.new(
|
26
55
|
key_id: key_id,
|
27
56
|
issuer_id: issuer_id,
|
28
|
-
key: OpenSSL::PKey::EC.new(
|
57
|
+
key: OpenSSL::PKey::EC.new(key),
|
58
|
+
duration: duration,
|
59
|
+
in_house: in_house
|
29
60
|
)
|
30
61
|
end
|
31
62
|
|
32
|
-
def initialize(key_id: nil, issuer_id: nil, key: nil)
|
33
|
-
@expiration = Time.now + MAX_TOKEN_DURATION
|
63
|
+
def initialize(key_id: nil, issuer_id: nil, key: nil, duration: nil, in_house: nil)
|
34
64
|
@key_id = key_id
|
35
65
|
@key = key
|
36
66
|
@issuer_id = issuer_id
|
67
|
+
@duration = duration
|
68
|
+
@in_house = in_house
|
69
|
+
|
70
|
+
@duration ||= MAX_TOKEN_DURATION
|
71
|
+
@duration = @duration.to_i if @duration
|
72
|
+
|
73
|
+
refresh!
|
74
|
+
end
|
75
|
+
|
76
|
+
def refresh!
|
77
|
+
@expiration = Time.now + @duration
|
37
78
|
|
38
79
|
header = {
|
39
80
|
kid: key_id
|
@@ -45,7 +86,7 @@ module Spaceship
|
|
45
86
|
aud: 'appstoreconnect-v1'
|
46
87
|
}
|
47
88
|
|
48
|
-
@text = JWT.encode(payload, key, 'ES256', header)
|
89
|
+
@text = JWT.encode(payload, @key, 'ES256', header)
|
49
90
|
end
|
50
91
|
|
51
92
|
def expired?
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
require_relative 'token'
|
4
|
+
require_relative '../globals'
|
5
|
+
|
6
|
+
module Spaceship
|
7
|
+
class TokenRefreshMiddleware < Faraday::Middleware
|
8
|
+
def initialize(app, token)
|
9
|
+
@token = token
|
10
|
+
super(app)
|
11
|
+
end
|
12
|
+
|
13
|
+
def call(env)
|
14
|
+
if @token.expired?
|
15
|
+
puts("App Store Connect API token expired at #{@token.expiration}... refreshing") if Spaceship::Globals.verbose?
|
16
|
+
@token.refresh!
|
17
|
+
end
|
18
|
+
|
19
|
+
env.request_headers["Authorization"] = "Bearer #{@token.text}"
|
20
|
+
|
21
|
+
@app.call(env)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,27 +1,18 @@
|
|
1
|
-
require_relative '../
|
1
|
+
require_relative '../api_client'
|
2
|
+
require_relative './tunes'
|
2
3
|
require_relative '../../tunes/tunes_client'
|
3
4
|
|
4
5
|
module Spaceship
|
5
6
|
class ConnectAPI
|
6
7
|
module Tunes
|
7
|
-
class Client < Spaceship::ConnectAPI::
|
8
|
-
def
|
9
|
-
|
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
|
8
|
+
class Client < Spaceship::ConnectAPI::APIClient
|
9
|
+
def initialize(cookie: nil, current_team_id: nil, token: nil, another_client: nil)
|
10
|
+
another_client ||= Spaceship::Tunes.client if cookie.nil? && token.nil?
|
20
11
|
|
21
|
-
|
22
|
-
raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client
|
12
|
+
super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
|
23
13
|
|
24
|
-
|
14
|
+
self.extend(Spaceship::ConnectAPI::Tunes::API)
|
15
|
+
self.tunes_request_client = self
|
25
16
|
end
|
26
17
|
|
27
18
|
def self.hostname
|
@@ -3,932 +3,943 @@ require 'spaceship/connect_api/tunes/client'
|
|
3
3
|
module Spaceship
|
4
4
|
class ConnectAPI
|
5
5
|
module Tunes
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
module API
|
7
|
+
def tunes_request_client=(tunes_request_client)
|
8
|
+
@tunes_request_client = tunes_request_client
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
def tunes_request_client
|
12
|
+
return @tunes_request_client if @tunes_request_client
|
13
|
+
raise TypeError, "You need to instantiate this module with tunes_request_client"
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
type: "ageRatingDeclarations",
|
19
|
-
id: age_rating_declaration_id,
|
20
|
-
attributes: attributes
|
21
|
-
}
|
22
|
-
}
|
16
|
+
#
|
17
|
+
# ageRatingDeclarations
|
18
|
+
#
|
23
19
|
|
24
|
-
|
25
|
-
|
20
|
+
def get_age_rating_declaration(app_store_version_id: nil)
|
21
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
22
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/ageRatingDeclaration", params)
|
23
|
+
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
]
|
25
|
+
def patch_age_rating_declaration(age_rating_declaration_id: nil, attributes: nil)
|
26
|
+
body = {
|
27
|
+
data: {
|
28
|
+
type: "ageRatingDeclarations",
|
29
|
+
id: age_rating_declaration_id,
|
30
|
+
attributes: attributes
|
44
31
|
}
|
45
32
|
}
|
46
|
-
}
|
47
|
-
included << {
|
48
|
-
type: "appInfoLocalizations",
|
49
|
-
id: "${new-appInfoLocalization-id}",
|
50
|
-
attributes: {
|
51
|
-
locale: primary_locale,
|
52
|
-
name: name
|
53
|
-
}
|
54
|
-
}
|
55
33
|
|
56
|
-
|
34
|
+
tunes_request_client.patch("ageRatingDeclarations/#{age_rating_declaration_id}", body)
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# app
|
39
|
+
#
|
40
|
+
|
41
|
+
def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
|
42
|
+
included = []
|
57
43
|
included << {
|
58
|
-
type: "
|
59
|
-
id: "${
|
60
|
-
attributes: {
|
61
|
-
platform: platform,
|
62
|
-
versionString: version_string
|
63
|
-
},
|
44
|
+
type: "appInfos",
|
45
|
+
id: "${new-appInfo-id}",
|
64
46
|
relationships: {
|
65
|
-
|
47
|
+
appInfoLocalizations: {
|
66
48
|
data: [
|
67
49
|
{
|
68
|
-
type: "
|
69
|
-
id: "${new
|
50
|
+
type: "appInfoLocalizations",
|
51
|
+
id: "${new-appInfoLocalization-id}"
|
70
52
|
}
|
71
53
|
]
|
72
54
|
}
|
73
55
|
}
|
74
56
|
}
|
75
|
-
|
76
57
|
included << {
|
77
|
-
type: "
|
78
|
-
id: "${new
|
58
|
+
type: "appInfoLocalizations",
|
59
|
+
id: "${new-appInfoLocalization-id}",
|
79
60
|
attributes: {
|
80
|
-
locale: primary_locale
|
61
|
+
locale: primary_locale,
|
62
|
+
name: name
|
81
63
|
}
|
82
64
|
}
|
83
|
-
end
|
84
65
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
66
|
+
platforms.each do |platform|
|
67
|
+
included << {
|
68
|
+
type: "appStoreVersions",
|
69
|
+
id: "${store-version-#{platform}}",
|
70
|
+
attributes: {
|
71
|
+
platform: platform,
|
72
|
+
versionString: version_string
|
73
|
+
},
|
74
|
+
relationships: {
|
75
|
+
appStoreVersionLocalizations: {
|
76
|
+
data: [
|
77
|
+
{
|
78
|
+
type: "appStoreVersionLocalizations",
|
79
|
+
id: "${new-#{platform}VersionLocalization-id}"
|
80
|
+
}
|
81
|
+
]
|
82
|
+
}
|
101
83
|
}
|
102
|
-
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
app_attributes = {
|
107
|
-
sku: sku,
|
108
|
-
primaryLocale: primary_locale,
|
109
|
-
bundleId: bundle_id
|
110
|
-
}
|
111
|
-
app_attributes[:companyName] = company_name if company_name
|
84
|
+
}
|
112
85
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
86
|
+
included << {
|
87
|
+
type: "appStoreVersionLocalizations",
|
88
|
+
id: "${new-#{platform}VersionLocalization-id}",
|
89
|
+
attributes: {
|
90
|
+
locale: primary_locale
|
91
|
+
}
|
92
|
+
}
|
93
|
+
end
|
121
94
|
|
122
|
-
|
123
|
-
|
95
|
+
app_store_verions_data = platforms.map do |platform|
|
96
|
+
{
|
97
|
+
type: "appStoreVersions",
|
98
|
+
id: "${store-version-#{platform}}"
|
99
|
+
}
|
100
|
+
end
|
124
101
|
|
125
|
-
|
126
|
-
|
127
|
-
|
102
|
+
relationships = {
|
103
|
+
appStoreVersions: {
|
104
|
+
data: app_store_verions_data
|
105
|
+
},
|
106
|
+
appInfos: {
|
107
|
+
data: [
|
108
|
+
{
|
109
|
+
type: "appInfos",
|
110
|
+
id: "${new-appInfo-id}"
|
111
|
+
}
|
112
|
+
]
|
113
|
+
}
|
114
|
+
}
|
128
115
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
{
|
134
|
-
type: "appPrices",
|
135
|
-
id: "${price1}"
|
136
|
-
}
|
137
|
-
]
|
116
|
+
app_attributes = {
|
117
|
+
sku: sku,
|
118
|
+
primaryLocale: primary_locale,
|
119
|
+
bundleId: bundle_id
|
138
120
|
}
|
121
|
+
app_attributes[:companyName] = company_name if company_name
|
139
122
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
123
|
+
body = {
|
124
|
+
data: {
|
125
|
+
type: "apps",
|
126
|
+
attributes: app_attributes,
|
127
|
+
relationships: relationships
|
145
128
|
},
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
129
|
+
included: included
|
130
|
+
}
|
131
|
+
|
132
|
+
tunes_request_client.post("apps", body)
|
133
|
+
end
|
134
|
+
|
135
|
+
def patch_app(app_id: nil, attributes: {}, app_price_tier_id: nil, territory_ids: nil)
|
136
|
+
relationships = {}
|
137
|
+
included = []
|
138
|
+
|
139
|
+
# Price tier
|
140
|
+
unless app_price_tier_id.nil?
|
141
|
+
relationships[:prices] = {
|
142
|
+
data: [
|
143
|
+
{
|
144
|
+
type: "appPrices",
|
145
|
+
id: "${price1}"
|
151
146
|
}
|
147
|
+
]
|
148
|
+
}
|
149
|
+
|
150
|
+
included << {
|
151
|
+
type: "appPrices",
|
152
|
+
id: "${price1}",
|
153
|
+
attributes: {
|
154
|
+
startDate: nil
|
152
155
|
},
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
156
|
+
relationships: {
|
157
|
+
app: {
|
158
|
+
data: {
|
159
|
+
type: "apps",
|
160
|
+
id: app_id
|
161
|
+
}
|
162
|
+
},
|
163
|
+
priceTier: {
|
164
|
+
data: {
|
165
|
+
type: "appPriceTiers",
|
166
|
+
id: app_price_tier_id.to_s
|
167
|
+
}
|
157
168
|
}
|
158
169
|
}
|
159
170
|
}
|
160
|
-
|
161
|
-
end
|
171
|
+
end
|
162
172
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
173
|
+
# Territories
|
174
|
+
territories_data = (territory_ids || []).map do |id|
|
175
|
+
{ type: "territories", id: id }
|
176
|
+
end
|
177
|
+
unless territories_data.empty?
|
178
|
+
relationships[:availableTerritories] = {
|
179
|
+
data: territories_data
|
180
|
+
}
|
181
|
+
end
|
172
182
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
183
|
+
# Data
|
184
|
+
data = {
|
185
|
+
type: "apps",
|
186
|
+
id: app_id
|
187
|
+
}
|
188
|
+
data[:attributes] = attributes unless attributes.empty?
|
189
|
+
data[:relationships] = relationships unless relationships.empty?
|
180
190
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
191
|
+
# Body
|
192
|
+
body = {
|
193
|
+
data: data
|
194
|
+
}
|
195
|
+
body[:included] = included unless included.empty?
|
186
196
|
|
187
|
-
|
188
|
-
|
197
|
+
tunes_request_client.patch("apps/#{app_id}", body)
|
198
|
+
end
|
189
199
|
|
190
|
-
|
191
|
-
|
192
|
-
|
200
|
+
#
|
201
|
+
# appPreview
|
202
|
+
#
|
193
203
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
204
|
+
def get_app_preview(app_preview_id: nil)
|
205
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
206
|
+
tunes_request_client.get("appPreviews/#{app_preview_id}", params)
|
207
|
+
end
|
198
208
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
+
def post_app_preview(app_preview_set_id: nil, attributes: {})
|
210
|
+
body = {
|
211
|
+
data: {
|
212
|
+
type: "appPreviews",
|
213
|
+
attributes: attributes,
|
214
|
+
relationships: {
|
215
|
+
appPreviewSet: {
|
216
|
+
data: {
|
217
|
+
type: "appPreviewSets",
|
218
|
+
id: app_preview_set_id
|
219
|
+
}
|
209
220
|
}
|
210
221
|
}
|
211
222
|
}
|
212
223
|
}
|
213
|
-
}
|
214
224
|
|
215
|
-
|
216
|
-
|
225
|
+
tunes_request_client.post("appPreviews", body)
|
226
|
+
end
|
217
227
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
228
|
+
def patch_app_preview(app_preview_id: nil, attributes: {})
|
229
|
+
body = {
|
230
|
+
data: {
|
231
|
+
type: "appPreviews",
|
232
|
+
id: app_preview_id,
|
233
|
+
attributes: attributes
|
234
|
+
}
|
224
235
|
}
|
225
|
-
}
|
226
236
|
|
227
|
-
|
228
|
-
|
237
|
+
tunes_request_client.patch("appPreviews/#{app_preview_id}", body)
|
238
|
+
end
|
229
239
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
240
|
+
def delete_app_preview(app_preview_id: nil)
|
241
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
242
|
+
tunes_request_client.delete("appPreviews/#{app_preview_id}", params)
|
243
|
+
end
|
234
244
|
|
235
|
-
|
236
|
-
|
237
|
-
|
245
|
+
#
|
246
|
+
# appPreviewSets
|
247
|
+
#
|
238
248
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
249
|
+
def get_app_preview_sets(filter: {}, includes: nil, limit: nil, sort: nil)
|
250
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
251
|
+
tunes_request_client.get("appPreviewSets", params)
|
252
|
+
end
|
243
253
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
254
|
+
def get_app_preview_set(app_preview_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
255
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
256
|
+
tunes_request_client.get("appPreviewSets/#{app_preview_set_id}", params)
|
257
|
+
end
|
248
258
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
+
def post_app_preview_set(app_store_version_localization_id: nil, attributes: {})
|
260
|
+
body = {
|
261
|
+
data: {
|
262
|
+
type: "appPreviewSets",
|
263
|
+
attributes: attributes,
|
264
|
+
relationships: {
|
265
|
+
appStoreVersionLocalization: {
|
266
|
+
data: {
|
267
|
+
type: "appStoreVersionLocalizations",
|
268
|
+
id: app_store_version_localization_id
|
269
|
+
}
|
259
270
|
}
|
260
271
|
}
|
261
272
|
}
|
262
273
|
}
|
263
|
-
}
|
264
274
|
|
265
|
-
|
266
|
-
|
275
|
+
tunes_request_client.post("appPreviewSets", body)
|
276
|
+
end
|
267
277
|
|
268
|
-
|
269
|
-
|
278
|
+
def patch_app_preview_set_previews(app_preview_set_id: nil, app_preview_ids: nil)
|
279
|
+
app_preview_ids ||= []
|
270
280
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
281
|
+
body = {
|
282
|
+
data: app_preview_ids.map do |app_preview_id|
|
283
|
+
{
|
284
|
+
type: "appPreviews",
|
285
|
+
id: app_preview_id
|
286
|
+
}
|
287
|
+
end
|
288
|
+
}
|
279
289
|
|
280
|
-
|
281
|
-
|
290
|
+
tunes_request_client.patch("appPreviewSets/#{app_preview_set_id}/relationships/appPreviews", body)
|
291
|
+
end
|
282
292
|
|
283
|
-
|
284
|
-
|
285
|
-
|
293
|
+
#
|
294
|
+
# availableTerritories
|
295
|
+
#
|
286
296
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
297
|
+
def get_available_territories(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
298
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
299
|
+
tunes_request_client.get("apps/#{app_id}/availableTerritories", params)
|
300
|
+
end
|
291
301
|
|
292
|
-
|
293
|
-
|
294
|
-
|
302
|
+
#
|
303
|
+
# appPrices
|
304
|
+
#
|
295
305
|
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
306
|
+
def get_app_prices(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
307
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
308
|
+
tunes_request_client.get("appPrices", params)
|
309
|
+
end
|
300
310
|
|
301
|
-
|
302
|
-
|
303
|
-
|
311
|
+
#
|
312
|
+
# appReviewAttachments
|
313
|
+
#
|
304
314
|
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
+
def post_app_store_review_attachment(app_store_review_detail_id: nil, attributes: {})
|
316
|
+
body = {
|
317
|
+
data: {
|
318
|
+
type: "appStoreReviewAttachments",
|
319
|
+
attributes: attributes,
|
320
|
+
relationships: {
|
321
|
+
appStoreReviewDetail: {
|
322
|
+
data: {
|
323
|
+
type: "appStoreReviewDetails",
|
324
|
+
id: app_store_review_detail_id
|
325
|
+
}
|
315
326
|
}
|
316
327
|
}
|
317
328
|
}
|
318
329
|
}
|
319
|
-
}
|
320
330
|
|
321
|
-
|
322
|
-
|
331
|
+
tunes_request_client.post("appStoreReviewAttachments", body)
|
332
|
+
end
|
323
333
|
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
334
|
+
def patch_app_store_review_attachment(app_store_review_attachment_id: nil, attributes: {})
|
335
|
+
body = {
|
336
|
+
data: {
|
337
|
+
type: "appStoreReviewAttachments",
|
338
|
+
id: app_store_review_attachment_id,
|
339
|
+
attributes: attributes
|
340
|
+
}
|
330
341
|
}
|
331
|
-
}
|
332
342
|
|
333
|
-
|
334
|
-
|
343
|
+
tunes_request_client.patch("appStoreReviewAttachments/#{app_store_review_attachment_id}", body)
|
344
|
+
end
|
335
345
|
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
346
|
+
def delete_app_store_review_attachment(app_store_review_attachment_id: nil)
|
347
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
348
|
+
tunes_request_client.delete("appStoreReviewAttachments/#{app_store_review_attachment_id}", params)
|
349
|
+
end
|
340
350
|
|
341
|
-
|
342
|
-
|
343
|
-
|
351
|
+
#
|
352
|
+
# appScreenshotSets
|
353
|
+
#
|
344
354
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
355
|
+
def get_app_screenshot_sets(filter: {}, includes: nil, limit: nil, sort: nil)
|
356
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
357
|
+
tunes_request_client.get("appScreenshotSets", params)
|
358
|
+
end
|
349
359
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
360
|
+
def get_app_screenshot_set(app_screenshot_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
361
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
362
|
+
tunes_request_client.get("appScreenshotSets/#{app_screenshot_set_id}", params)
|
363
|
+
end
|
354
364
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
+
def post_app_screenshot_set(app_store_version_localization_id: nil, attributes: {})
|
366
|
+
body = {
|
367
|
+
data: {
|
368
|
+
type: "appScreenshotSets",
|
369
|
+
attributes: attributes,
|
370
|
+
relationships: {
|
371
|
+
appStoreVersionLocalization: {
|
372
|
+
data: {
|
373
|
+
type: "appStoreVersionLocalizations",
|
374
|
+
id: app_store_version_localization_id
|
375
|
+
}
|
365
376
|
}
|
366
377
|
}
|
367
378
|
}
|
368
379
|
}
|
369
|
-
}
|
370
380
|
|
371
|
-
|
372
|
-
|
381
|
+
tunes_request_client.post("appScreenshotSets", body)
|
382
|
+
end
|
373
383
|
|
374
|
-
|
375
|
-
|
384
|
+
def patch_app_screenshot_set_screenshots(app_screenshot_set_id: nil, app_screenshot_ids: nil)
|
385
|
+
app_screenshot_ids ||= []
|
376
386
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
387
|
+
body = {
|
388
|
+
data: app_screenshot_ids.map do |app_screenshot_id|
|
389
|
+
{
|
390
|
+
type: "appScreenshots",
|
391
|
+
id: app_screenshot_id
|
392
|
+
}
|
393
|
+
end
|
394
|
+
}
|
385
395
|
|
386
|
-
|
387
|
-
|
396
|
+
tunes_request_client.patch("appScreenshotSets/#{app_screenshot_set_id}/relationships/appScreenshots", body)
|
397
|
+
end
|
388
398
|
|
389
|
-
|
390
|
-
|
391
|
-
|
399
|
+
#
|
400
|
+
# appScreenshots
|
401
|
+
#
|
392
402
|
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
403
|
+
def get_app_screenshot(app_screenshot_id: nil)
|
404
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
405
|
+
tunes_request_client.get("appScreenshots/#{app_screenshot_id}", params)
|
406
|
+
end
|
397
407
|
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
+
def post_app_screenshot(app_screenshot_set_id: nil, attributes: {})
|
409
|
+
body = {
|
410
|
+
data: {
|
411
|
+
type: "appScreenshots",
|
412
|
+
attributes: attributes,
|
413
|
+
relationships: {
|
414
|
+
appScreenshotSet: {
|
415
|
+
data: {
|
416
|
+
type: "appScreenshotSets",
|
417
|
+
id: app_screenshot_set_id
|
418
|
+
}
|
408
419
|
}
|
409
420
|
}
|
410
421
|
}
|
411
422
|
}
|
412
|
-
}
|
413
423
|
|
414
|
-
|
415
|
-
|
424
|
+
tunes_request_client.post("appScreenshots", body, tries: 1)
|
425
|
+
end
|
416
426
|
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
427
|
+
def patch_app_screenshot(app_screenshot_id: nil, attributes: {})
|
428
|
+
body = {
|
429
|
+
data: {
|
430
|
+
type: "appScreenshots",
|
431
|
+
id: app_screenshot_id,
|
432
|
+
attributes: attributes
|
433
|
+
}
|
423
434
|
}
|
424
|
-
}
|
425
435
|
|
426
|
-
|
427
|
-
|
436
|
+
tunes_request_client.patch("appScreenshots/#{app_screenshot_id}", body)
|
437
|
+
end
|
428
438
|
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
439
|
+
def delete_app_screenshot(app_screenshot_id: nil)
|
440
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
441
|
+
tunes_request_client.delete("appScreenshots/#{app_screenshot_id}", params)
|
442
|
+
end
|
433
443
|
|
434
|
-
|
435
|
-
|
436
|
-
|
444
|
+
#
|
445
|
+
# appInfos
|
446
|
+
#
|
437
447
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
448
|
+
def get_app_infos(filter: {}, includes: nil, limit: nil, sort: nil)
|
449
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
450
|
+
tunes_request_client.get("appInfos", params)
|
451
|
+
end
|
442
452
|
|
443
|
-
|
444
|
-
|
453
|
+
def patch_app_info(app_info_id: nil, attributes: {})
|
454
|
+
attributes ||= {}
|
445
455
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
456
|
+
data = {
|
457
|
+
type: "appInfos",
|
458
|
+
id: app_info_id
|
459
|
+
}
|
460
|
+
data[:attributes] = attributes unless attributes.empty?
|
451
461
|
|
452
|
-
|
453
|
-
|
454
|
-
|
462
|
+
body = {
|
463
|
+
data: data
|
464
|
+
}
|
455
465
|
|
456
|
-
|
457
|
-
|
466
|
+
tunes_request_client.patch("appInfos/#{app_info_id}", body)
|
467
|
+
end
|
458
468
|
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
469
|
+
#
|
470
|
+
# Adding the key will create/update (if value) or delete if nil
|
471
|
+
# Not including a key will leave as is
|
472
|
+
# category_id_map: {
|
473
|
+
# primary_category_id: "GAMES",
|
474
|
+
# primary_subcategory_one_id: "PUZZLE",
|
475
|
+
# primary_subcategory_two_id: "STRATEGY",
|
476
|
+
# secondary_category_id: nil,
|
477
|
+
# secondary_subcategory_one_id: nil,
|
478
|
+
# secondary_subcategory_two_id: nil
|
479
|
+
# }
|
480
|
+
#
|
481
|
+
def patch_app_info_categories(app_info_id: nil, category_id_map: nil)
|
482
|
+
category_id_map ||= {}
|
483
|
+
primary_category_id = category_id_map[:primary_category_id]
|
484
|
+
primary_subcategory_one_id = category_id_map[:primary_subcategory_one_id]
|
485
|
+
primary_subcategory_two_id = category_id_map[:primary_subcategory_two_id]
|
486
|
+
secondary_category_id = category_id_map[:secondary_category_id]
|
487
|
+
secondary_subcategory_one_id = category_id_map[:secondary_subcategory_one_id]
|
488
|
+
secondary_subcategory_two_id = category_id_map[:secondary_subcategory_two_id]
|
489
|
+
|
490
|
+
relationships = {}
|
491
|
+
|
492
|
+
# Only update if key is included (otherwise category will be removed)
|
493
|
+
if category_id_map.include?(:primary_category_id)
|
494
|
+
relationships[:primaryCategory] = {
|
495
|
+
data: primary_category_id ? { type: "appCategories", id: primary_category_id } : nil
|
496
|
+
}
|
497
|
+
end
|
479
498
|
|
480
|
-
|
499
|
+
# Only update if key is included (otherwise category will be removed)
|
500
|
+
if category_id_map.include?(:primary_subcategory_one_id)
|
501
|
+
relationships[:primarySubcategoryOne] = {
|
502
|
+
data: primary_subcategory_one_id ? { type: "appCategories", id: primary_subcategory_one_id } : nil
|
503
|
+
}
|
504
|
+
end
|
481
505
|
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
506
|
+
# Only update if key is included (otherwise category will be removed)
|
507
|
+
if category_id_map.include?(:primary_subcategory_two_id)
|
508
|
+
relationships[:primarySubcategoryTwo] = {
|
509
|
+
data: primary_subcategory_two_id ? { type: "appCategories", id: primary_subcategory_two_id } : nil
|
510
|
+
}
|
511
|
+
end
|
488
512
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
513
|
+
# Only update if key is included (otherwise category will be removed)
|
514
|
+
if category_id_map.include?(:secondary_category_id)
|
515
|
+
relationships[:secondaryCategory] = {
|
516
|
+
data: secondary_category_id ? { type: "appCategories", id: secondary_category_id } : nil
|
517
|
+
}
|
518
|
+
end
|
495
519
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
520
|
+
# Only update if key is included (otherwise category will be removed)
|
521
|
+
if category_id_map.include?(:secondary_subcategory_one_id)
|
522
|
+
relationships[:secondarySubcategoryOne] = {
|
523
|
+
data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
|
524
|
+
}
|
525
|
+
end
|
502
526
|
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
527
|
+
# Only update if key is included (otherwise category will be removed)
|
528
|
+
if category_id_map.include?(:secondary_subcategory_two_id)
|
529
|
+
relationships[:secondarySubcategoryTwo] = {
|
530
|
+
data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
|
531
|
+
}
|
532
|
+
end
|
509
533
|
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
|
534
|
+
data = {
|
535
|
+
type: "appInfos",
|
536
|
+
id: app_info_id
|
514
537
|
}
|
515
|
-
|
538
|
+
data[:relationships] = relationships unless relationships.empty?
|
516
539
|
|
517
|
-
|
518
|
-
|
519
|
-
relationships[:secondarySubcategoryTwo] = {
|
520
|
-
data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
|
540
|
+
body = {
|
541
|
+
data: data
|
521
542
|
}
|
522
|
-
end
|
523
|
-
|
524
|
-
data = {
|
525
|
-
type: "appInfos",
|
526
|
-
id: app_info_id
|
527
|
-
}
|
528
|
-
data[:relationships] = relationships unless relationships.empty?
|
529
|
-
|
530
|
-
body = {
|
531
|
-
data: data
|
532
|
-
}
|
533
543
|
|
534
|
-
|
535
|
-
|
544
|
+
tunes_request_client.patch("appInfos/#{app_info_id}", body)
|
545
|
+
end
|
536
546
|
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
547
|
+
def delete_app_info(app_info_id: nil)
|
548
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
549
|
+
tunes_request_client.delete("appInfos/#{app_info_id}", params)
|
550
|
+
end
|
541
551
|
|
542
|
-
|
543
|
-
|
544
|
-
|
552
|
+
#
|
553
|
+
# appInfoLocalizations
|
554
|
+
#
|
545
555
|
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
556
|
+
def get_app_info_localizations(app_info_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
557
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
558
|
+
tunes_request_client.get("appInfos/#{app_info_id}/appInfoLocalizations", params)
|
559
|
+
end
|
550
560
|
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
+
def post_app_info_localization(app_info_id: nil, attributes: {})
|
562
|
+
body = {
|
563
|
+
data: {
|
564
|
+
type: "appInfoLocalizations",
|
565
|
+
attributes: attributes,
|
566
|
+
relationships: {
|
567
|
+
appStoreVersion: {
|
568
|
+
data: {
|
569
|
+
type: "appStoreVersions",
|
570
|
+
id: app_info_id
|
571
|
+
}
|
561
572
|
}
|
562
573
|
}
|
563
574
|
}
|
564
575
|
}
|
565
|
-
}
|
566
576
|
|
567
|
-
|
568
|
-
|
577
|
+
tunes_request_client.post("appInfoLocalizations", body)
|
578
|
+
end
|
569
579
|
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
580
|
+
def patch_app_info_localization(app_info_localization_id: nil, attributes: {})
|
581
|
+
body = {
|
582
|
+
data: {
|
583
|
+
type: "appInfoLocalizations",
|
584
|
+
id: app_info_localization_id,
|
585
|
+
attributes: attributes
|
586
|
+
}
|
576
587
|
}
|
577
|
-
}
|
578
588
|
|
579
|
-
|
580
|
-
|
589
|
+
tunes_request_client.patch("appInfoLocalizations/#{app_info_localization_id}", body)
|
590
|
+
end
|
581
591
|
|
582
|
-
|
583
|
-
|
584
|
-
|
592
|
+
#
|
593
|
+
# appStoreReviewDetails
|
594
|
+
#
|
585
595
|
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
596
|
+
def get_app_store_review_detail(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
597
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
598
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreReviewDetail", params)
|
599
|
+
end
|
590
600
|
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
+
def post_app_store_review_detail(app_store_version_id: nil, attributes: {})
|
602
|
+
body = {
|
603
|
+
data: {
|
604
|
+
type: "appStoreReviewDetails",
|
605
|
+
attributes: attributes,
|
606
|
+
relationships: {
|
607
|
+
appStoreVersion: {
|
608
|
+
data: {
|
609
|
+
type: "appStoreVersions",
|
610
|
+
id: app_store_version_id
|
611
|
+
}
|
601
612
|
}
|
602
613
|
}
|
603
614
|
}
|
604
615
|
}
|
605
|
-
}
|
606
616
|
|
607
|
-
|
608
|
-
|
617
|
+
tunes_request_client.post("appStoreReviewDetails", body)
|
618
|
+
end
|
609
619
|
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
620
|
+
def patch_app_store_review_detail(app_store_review_detail_id: nil, attributes: {})
|
621
|
+
body = {
|
622
|
+
data: {
|
623
|
+
type: "appStoreReviewDetails",
|
624
|
+
id: app_store_review_detail_id,
|
625
|
+
attributes: attributes
|
626
|
+
}
|
616
627
|
}
|
617
|
-
}
|
618
628
|
|
619
|
-
|
620
|
-
|
629
|
+
tunes_request_client.patch("appStoreReviewDetails/#{app_store_review_detail_id}", body)
|
630
|
+
end
|
621
631
|
|
622
|
-
|
623
|
-
|
624
|
-
|
632
|
+
#
|
633
|
+
# appStoreVersionLocalizations
|
634
|
+
#
|
625
635
|
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
636
|
+
def get_app_store_version_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
637
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
638
|
+
tunes_request_client.get("appStoreVersionLocalizations", params)
|
639
|
+
end
|
630
640
|
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
+
def post_app_store_version_localization(app_store_version_id: nil, attributes: {})
|
642
|
+
body = {
|
643
|
+
data: {
|
644
|
+
type: "appStoreVersionLocalizations",
|
645
|
+
attributes: attributes,
|
646
|
+
relationships: {
|
647
|
+
appStoreVersion: {
|
648
|
+
data: {
|
649
|
+
type: "appStoreVersions",
|
650
|
+
id: app_store_version_id
|
651
|
+
}
|
641
652
|
}
|
642
653
|
}
|
643
654
|
}
|
644
655
|
}
|
645
|
-
}
|
646
656
|
|
647
|
-
|
648
|
-
|
657
|
+
tunes_request_client.post("appStoreVersionLocalizations", body)
|
658
|
+
end
|
649
659
|
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
660
|
+
def patch_app_store_version_localization(app_store_version_localization_id: nil, attributes: {})
|
661
|
+
body = {
|
662
|
+
data: {
|
663
|
+
type: "appStoreVersionLocalizations",
|
664
|
+
id: app_store_version_localization_id,
|
665
|
+
attributes: attributes
|
666
|
+
}
|
656
667
|
}
|
657
|
-
}
|
658
668
|
|
659
|
-
|
660
|
-
|
669
|
+
tunes_request_client.patch("appStoreVersionLocalizations/#{app_store_version_localization_id}", body)
|
670
|
+
end
|
661
671
|
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
672
|
+
def delete_app_store_version_localization(app_store_version_localization_id: nil)
|
673
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
674
|
+
tunes_request_client.delete("appStoreVersionLocalizations/#{app_store_version_localization_id}", params)
|
675
|
+
end
|
666
676
|
|
667
|
-
|
668
|
-
|
669
|
-
|
677
|
+
#
|
678
|
+
# appStoreVersionPhasedReleases
|
679
|
+
#
|
670
680
|
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
681
|
+
def get_app_store_version_phased_release(app_store_version_id: nil)
|
682
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
683
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionPhasedRelease", params)
|
684
|
+
end
|
675
685
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
+
def post_app_store_version_phased_release(app_store_version_id: nil, attributes: {})
|
687
|
+
body = {
|
688
|
+
data: {
|
689
|
+
type: "appStoreVersionPhasedReleases",
|
690
|
+
attributes: attributes,
|
691
|
+
relationships: {
|
692
|
+
appStoreVersion: {
|
693
|
+
data: {
|
694
|
+
type: "appStoreVersions",
|
695
|
+
id: app_store_version_id
|
696
|
+
}
|
686
697
|
}
|
687
698
|
}
|
688
699
|
}
|
689
700
|
}
|
690
|
-
}
|
691
701
|
|
692
|
-
|
693
|
-
|
702
|
+
tunes_request_client.post("appStoreVersionPhasedReleases", body)
|
703
|
+
end
|
694
704
|
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
705
|
+
def delete_app_store_version_phased_release(app_store_version_phased_release_id: nil)
|
706
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
707
|
+
tunes_request_client.delete("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", params)
|
708
|
+
end
|
699
709
|
|
700
|
-
|
701
|
-
|
702
|
-
|
710
|
+
#
|
711
|
+
# appStoreVersions
|
712
|
+
#
|
703
713
|
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
714
|
+
def get_app_store_versions(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
715
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
716
|
+
tunes_request_client.get("apps/#{app_id}/appStoreVersions", params)
|
717
|
+
end
|
708
718
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
719
|
+
def get_app_store_version(app_store_version_id: nil, includes: nil)
|
720
|
+
params = tunes_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
|
721
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}", params)
|
722
|
+
end
|
713
723
|
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
+
def post_app_store_version(app_id: nil, attributes: {})
|
725
|
+
body = {
|
726
|
+
data: {
|
727
|
+
type: "appStoreVersions",
|
728
|
+
attributes: attributes,
|
729
|
+
relationships: {
|
730
|
+
app: {
|
731
|
+
data: {
|
732
|
+
type: "apps",
|
733
|
+
id: app_id
|
734
|
+
}
|
724
735
|
}
|
725
736
|
}
|
726
737
|
}
|
727
738
|
}
|
728
|
-
}
|
729
739
|
|
730
|
-
|
731
|
-
|
740
|
+
tunes_request_client.post("appStoreVersions", body)
|
741
|
+
end
|
732
742
|
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
743
|
+
def patch_app_store_version(app_store_version_id: nil, attributes: {})
|
744
|
+
body = {
|
745
|
+
data: {
|
746
|
+
type: "appStoreVersions",
|
747
|
+
id: app_store_version_id,
|
748
|
+
attributes: attributes
|
749
|
+
}
|
739
750
|
}
|
740
|
-
}
|
741
751
|
|
742
|
-
|
743
|
-
end
|
744
|
-
|
745
|
-
def patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil)
|
746
|
-
data = nil
|
747
|
-
if build_id
|
748
|
-
data = {
|
749
|
-
type: "builds",
|
750
|
-
id: build_id
|
751
|
-
}
|
752
|
+
tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
|
752
753
|
end
|
753
754
|
|
754
|
-
|
755
|
-
data
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
755
|
+
def patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil)
|
756
|
+
data = nil
|
757
|
+
if build_id
|
758
|
+
data = {
|
759
|
+
type: "builds",
|
760
|
+
id: build_id
|
761
|
+
}
|
762
|
+
end
|
763
|
+
|
764
|
+
body = {
|
765
|
+
data: {
|
766
|
+
type: "appStoreVersions",
|
767
|
+
id: app_store_version_id,
|
768
|
+
relationships: {
|
769
|
+
build: {
|
770
|
+
data: data
|
771
|
+
}
|
761
772
|
}
|
762
773
|
}
|
763
774
|
}
|
764
|
-
}
|
765
775
|
|
766
|
-
|
767
|
-
|
776
|
+
tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
|
777
|
+
end
|
768
778
|
|
769
|
-
|
770
|
-
|
771
|
-
|
779
|
+
#
|
780
|
+
# appStoreVersionPhasedReleases
|
781
|
+
#
|
772
782
|
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
783
|
+
def get_reset_ratings_request(app_store_version_id: nil)
|
784
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
785
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/resetRatingsRequest", params)
|
786
|
+
end
|
777
787
|
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
788
|
+
def post_reset_ratings_request(app_store_version_id: nil)
|
789
|
+
body = {
|
790
|
+
data: {
|
791
|
+
type: "resetRatingsRequests",
|
792
|
+
relationships: {
|
793
|
+
appStoreVersion: {
|
794
|
+
data: {
|
795
|
+
type: "appStoreVersions",
|
796
|
+
id: app_store_version_id
|
797
|
+
}
|
787
798
|
}
|
788
799
|
}
|
789
800
|
}
|
790
801
|
}
|
791
|
-
}
|
792
802
|
|
793
|
-
|
794
|
-
|
803
|
+
tunes_request_client.post("resetRatingsRequests", body)
|
804
|
+
end
|
795
805
|
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
806
|
+
def delete_reset_ratings_request(reset_ratings_request_id: nil)
|
807
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
808
|
+
tunes_request_client.delete("resetRatingsRequests/#{reset_ratings_request_id}", params)
|
809
|
+
end
|
800
810
|
|
801
|
-
|
802
|
-
|
803
|
-
|
811
|
+
#
|
812
|
+
# appStoreVersionSubmissions
|
813
|
+
#
|
804
814
|
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
815
|
+
def get_app_store_version_submission(app_store_version_id: nil)
|
816
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
817
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionSubmission", params)
|
818
|
+
end
|
809
819
|
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
820
|
+
def post_app_store_version_submission(app_store_version_id: nil)
|
821
|
+
body = {
|
822
|
+
data: {
|
823
|
+
type: "appStoreVersionSubmissions",
|
824
|
+
relationships: {
|
825
|
+
appStoreVersion: {
|
826
|
+
data: {
|
827
|
+
type: "appStoreVersions",
|
828
|
+
id: app_store_version_id
|
829
|
+
}
|
819
830
|
}
|
820
831
|
}
|
821
832
|
}
|
822
833
|
}
|
823
|
-
}
|
824
|
-
|
825
|
-
Client.instance.post("appStoreVersionSubmissions", body)
|
826
|
-
end
|
827
834
|
|
828
|
-
|
829
|
-
|
830
|
-
Client.instance.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
|
831
|
-
end
|
835
|
+
tunes_request_client.post("appStoreVersionSubmissions", body)
|
836
|
+
end
|
832
837
|
|
833
|
-
|
834
|
-
|
835
|
-
|
838
|
+
def delete_app_store_version_submission(app_store_version_submission_id: nil)
|
839
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
840
|
+
tunes_request_client.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
|
841
|
+
end
|
836
842
|
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
843
|
+
#
|
844
|
+
# appStoreVersionReleaseRequests
|
845
|
+
#
|
846
|
+
|
847
|
+
def post_app_store_version_release_request(app_store_version_id: nil)
|
848
|
+
body = {
|
849
|
+
data: {
|
850
|
+
type: "appStoreVersionReleaseRequests",
|
851
|
+
relationships: {
|
852
|
+
appStoreVersion: {
|
853
|
+
data: {
|
854
|
+
type: "appStoreVersions",
|
855
|
+
id: app_store_version_id
|
856
|
+
}
|
857
|
+
}
|
858
|
+
}
|
859
|
+
}
|
860
|
+
}
|
851
861
|
|
852
|
-
|
853
|
-
|
862
|
+
tunes_request_client.post("appStoreVersionReleaseRequests", body)
|
863
|
+
end
|
854
864
|
|
855
|
-
|
856
|
-
|
857
|
-
|
865
|
+
#
|
866
|
+
# idfaDeclarations
|
867
|
+
#
|
858
868
|
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
869
|
+
def get_idfa_declaration(app_store_version_id: nil)
|
870
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
871
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/idfaDeclaration", params)
|
872
|
+
end
|
863
873
|
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
+
def post_idfa_declaration(app_store_version_id: nil, attributes: nil)
|
875
|
+
body = {
|
876
|
+
data: {
|
877
|
+
type: "idfaDeclarations",
|
878
|
+
attributes: attributes,
|
879
|
+
relationships: {
|
880
|
+
appStoreVersion: {
|
881
|
+
data: {
|
882
|
+
type: "appStoreVersions",
|
883
|
+
id: app_store_version_id
|
884
|
+
}
|
874
885
|
}
|
875
886
|
}
|
876
887
|
}
|
877
888
|
}
|
878
|
-
}
|
879
889
|
|
880
|
-
|
881
|
-
|
890
|
+
tunes_request_client.post("idfaDeclarations", body)
|
891
|
+
end
|
882
892
|
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
893
|
+
def patch_idfa_declaration(idfa_declaration_id: nil, attributes: nil)
|
894
|
+
body = {
|
895
|
+
data: {
|
896
|
+
type: "idfaDeclarations",
|
897
|
+
id: idfa_declaration_id,
|
898
|
+
attributes: attributes
|
899
|
+
}
|
889
900
|
}
|
890
|
-
}
|
891
901
|
|
892
|
-
|
893
|
-
|
902
|
+
tunes_request_client.patch("idfaDeclarations/#{idfa_declaration_id}", body)
|
903
|
+
end
|
894
904
|
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
905
|
+
def delete_idfa_declaration(idfa_declaration_id: nil)
|
906
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
907
|
+
tunes_request_client.delete("idfaDeclarations/#{idfa_declaration_id}", params)
|
908
|
+
end
|
899
909
|
|
900
|
-
|
901
|
-
|
902
|
-
|
910
|
+
#
|
911
|
+
# sandboxTesters
|
912
|
+
#
|
903
913
|
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
914
|
+
def get_sandbox_testers(filter: nil, includes: nil, limit: nil, sort: nil)
|
915
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
916
|
+
tunes_request_client.get("sandboxTesters", params)
|
917
|
+
end
|
908
918
|
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
919
|
+
def post_sandbox_tester(attributes: {})
|
920
|
+
body = {
|
921
|
+
data: {
|
922
|
+
type: "sandboxTesters",
|
923
|
+
attributes: attributes
|
924
|
+
}
|
914
925
|
}
|
915
|
-
}
|
916
926
|
|
917
|
-
|
918
|
-
|
927
|
+
tunes_request_client.post("sandboxTesters", body)
|
928
|
+
end
|
919
929
|
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
930
|
+
def delete_sandbox_tester(sandbox_tester_id: nil)
|
931
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
932
|
+
tunes_request_client.delete("sandboxTesters/#{sandbox_tester_id}", params)
|
933
|
+
end
|
924
934
|
|
925
|
-
|
926
|
-
|
927
|
-
|
935
|
+
#
|
936
|
+
# territories
|
937
|
+
#
|
928
938
|
|
929
|
-
|
930
|
-
|
931
|
-
|
939
|
+
def get_territories(filter: {}, includes: nil, limit: nil, sort: nil)
|
940
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
941
|
+
tunes_request_client.get("territories", params)
|
942
|
+
end
|
932
943
|
end
|
933
944
|
end
|
934
945
|
end
|