fastlane 2.156.1 → 2.157.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +82 -82
- data/deliver/lib/deliver.rb +1 -0
- data/deliver/lib/deliver/app_screenshot_iterator.rb +26 -29
- 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/runner.rb +8 -5
- data/deliver/lib/deliver/upload_screenshots.rb +34 -17
- data/fastlane/lib/fastlane/actions/{.git_commit.rb.swp → .ensure_git_status_clean.rb.swp} +0 -0
- data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +12 -8
- 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/download_dsyms.rb +89 -68
- data/fastlane/lib/fastlane/actions/set_changelog.rb +3 -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 +78 -18
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- 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/gym/lib/gym/error_handler.rb +1 -1
- data/match/lib/match/spaceship_ensure.rb +5 -5
- data/{fastlane/lib/fastlane/.erb_template_helper.rb.swp → pilot/lib/pilot/.manager.rb.swp} +0 -0
- data/pilot/lib/pilot/build_manager.rb +15 -4
- data/pilot/lib/pilot/manager.rb +15 -5
- data/pilot/lib/pilot/options.rb +16 -0
- data/produce/lib/produce/itunes_connect.rb +3 -2
- data/screengrab/lib/screengrab/runner.rb +29 -10
- data/sigh/lib/assets/resign.sh +9 -6
- data/sigh/lib/sigh/runner.rb +5 -4
- data/spaceship/lib/spaceship.rb +4 -0
- data/spaceship/lib/spaceship/client.rb +3 -0
- data/spaceship/lib/spaceship/connect_api.rb +1 -15
- data/spaceship/lib/spaceship/{.DS_Store → connect_api/.DS_Store} +0 -0
- data/spaceship/lib/spaceship/connect_api/api_client.rb +270 -0
- data/spaceship/lib/spaceship/connect_api/client.rb +155 -210
- data/spaceship/lib/spaceship/connect_api/file_uploader.rb +2 -0
- data/spaceship/lib/spaceship/connect_api/models/app.rb +5 -5
- data/spaceship/lib/spaceship/connect_api/models/app_price_point.rb +26 -0
- data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +7 -1
- 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 +725 -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 +33 -22
- data/spaceship/lib/spaceship/connect_api/.client.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,951 @@ 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
|
+
# appPricePoints
|
|
313
|
+
#
|
|
314
|
+
def get_app_price_points(filter: {}, includes: nil, limit: nil, sort: nil)
|
|
315
|
+
params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
316
|
+
Client.instance.get("appPricePoints", params)
|
|
317
|
+
end
|
|
304
318
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
319
|
+
#
|
|
320
|
+
# appReviewAttachments
|
|
321
|
+
#
|
|
322
|
+
|
|
323
|
+
def post_app_store_review_attachment(app_store_review_detail_id: nil, attributes: {})
|
|
324
|
+
body = {
|
|
325
|
+
data: {
|
|
326
|
+
type: "appStoreReviewAttachments",
|
|
327
|
+
attributes: attributes,
|
|
328
|
+
relationships: {
|
|
329
|
+
appStoreReviewDetail: {
|
|
330
|
+
data: {
|
|
331
|
+
type: "appStoreReviewDetails",
|
|
332
|
+
id: app_store_review_detail_id
|
|
333
|
+
}
|
|
315
334
|
}
|
|
316
335
|
}
|
|
317
336
|
}
|
|
318
337
|
}
|
|
319
|
-
}
|
|
320
338
|
|
|
321
|
-
|
|
322
|
-
|
|
339
|
+
tunes_request_client.post("appStoreReviewAttachments", body)
|
|
340
|
+
end
|
|
323
341
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
342
|
+
def patch_app_store_review_attachment(app_store_review_attachment_id: nil, attributes: {})
|
|
343
|
+
body = {
|
|
344
|
+
data: {
|
|
345
|
+
type: "appStoreReviewAttachments",
|
|
346
|
+
id: app_store_review_attachment_id,
|
|
347
|
+
attributes: attributes
|
|
348
|
+
}
|
|
330
349
|
}
|
|
331
|
-
}
|
|
332
350
|
|
|
333
|
-
|
|
334
|
-
|
|
351
|
+
tunes_request_client.patch("appStoreReviewAttachments/#{app_store_review_attachment_id}", body)
|
|
352
|
+
end
|
|
335
353
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
354
|
+
def delete_app_store_review_attachment(app_store_review_attachment_id: nil)
|
|
355
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
356
|
+
tunes_request_client.delete("appStoreReviewAttachments/#{app_store_review_attachment_id}", params)
|
|
357
|
+
end
|
|
340
358
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
359
|
+
#
|
|
360
|
+
# appScreenshotSets
|
|
361
|
+
#
|
|
344
362
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
363
|
+
def get_app_screenshot_sets(filter: {}, includes: nil, limit: nil, sort: nil)
|
|
364
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
365
|
+
tunes_request_client.get("appScreenshotSets", params)
|
|
366
|
+
end
|
|
349
367
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
368
|
+
def get_app_screenshot_set(app_screenshot_set_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
|
369
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
370
|
+
tunes_request_client.get("appScreenshotSets/#{app_screenshot_set_id}", params)
|
|
371
|
+
end
|
|
354
372
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
373
|
+
def post_app_screenshot_set(app_store_version_localization_id: nil, attributes: {})
|
|
374
|
+
body = {
|
|
375
|
+
data: {
|
|
376
|
+
type: "appScreenshotSets",
|
|
377
|
+
attributes: attributes,
|
|
378
|
+
relationships: {
|
|
379
|
+
appStoreVersionLocalization: {
|
|
380
|
+
data: {
|
|
381
|
+
type: "appStoreVersionLocalizations",
|
|
382
|
+
id: app_store_version_localization_id
|
|
383
|
+
}
|
|
365
384
|
}
|
|
366
385
|
}
|
|
367
386
|
}
|
|
368
387
|
}
|
|
369
|
-
}
|
|
370
388
|
|
|
371
|
-
|
|
372
|
-
|
|
389
|
+
tunes_request_client.post("appScreenshotSets", body)
|
|
390
|
+
end
|
|
373
391
|
|
|
374
|
-
|
|
375
|
-
|
|
392
|
+
def patch_app_screenshot_set_screenshots(app_screenshot_set_id: nil, app_screenshot_ids: nil)
|
|
393
|
+
app_screenshot_ids ||= []
|
|
376
394
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
395
|
+
body = {
|
|
396
|
+
data: app_screenshot_ids.map do |app_screenshot_id|
|
|
397
|
+
{
|
|
398
|
+
type: "appScreenshots",
|
|
399
|
+
id: app_screenshot_id
|
|
400
|
+
}
|
|
401
|
+
end
|
|
402
|
+
}
|
|
385
403
|
|
|
386
|
-
|
|
387
|
-
|
|
404
|
+
tunes_request_client.patch("appScreenshotSets/#{app_screenshot_set_id}/relationships/appScreenshots", body)
|
|
405
|
+
end
|
|
388
406
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
407
|
+
#
|
|
408
|
+
# appScreenshots
|
|
409
|
+
#
|
|
392
410
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
411
|
+
def get_app_screenshot(app_screenshot_id: nil)
|
|
412
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
413
|
+
tunes_request_client.get("appScreenshots/#{app_screenshot_id}", params)
|
|
414
|
+
end
|
|
397
415
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
416
|
+
def post_app_screenshot(app_screenshot_set_id: nil, attributes: {})
|
|
417
|
+
body = {
|
|
418
|
+
data: {
|
|
419
|
+
type: "appScreenshots",
|
|
420
|
+
attributes: attributes,
|
|
421
|
+
relationships: {
|
|
422
|
+
appScreenshotSet: {
|
|
423
|
+
data: {
|
|
424
|
+
type: "appScreenshotSets",
|
|
425
|
+
id: app_screenshot_set_id
|
|
426
|
+
}
|
|
408
427
|
}
|
|
409
428
|
}
|
|
410
429
|
}
|
|
411
430
|
}
|
|
412
|
-
}
|
|
413
431
|
|
|
414
|
-
|
|
415
|
-
|
|
432
|
+
tunes_request_client.post("appScreenshots", body, tries: 1)
|
|
433
|
+
end
|
|
416
434
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
435
|
+
def patch_app_screenshot(app_screenshot_id: nil, attributes: {})
|
|
436
|
+
body = {
|
|
437
|
+
data: {
|
|
438
|
+
type: "appScreenshots",
|
|
439
|
+
id: app_screenshot_id,
|
|
440
|
+
attributes: attributes
|
|
441
|
+
}
|
|
423
442
|
}
|
|
424
|
-
}
|
|
425
443
|
|
|
426
|
-
|
|
427
|
-
|
|
444
|
+
tunes_request_client.patch("appScreenshots/#{app_screenshot_id}", body)
|
|
445
|
+
end
|
|
428
446
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
447
|
+
def delete_app_screenshot(app_screenshot_id: nil)
|
|
448
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
449
|
+
tunes_request_client.delete("appScreenshots/#{app_screenshot_id}", params)
|
|
450
|
+
end
|
|
433
451
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
452
|
+
#
|
|
453
|
+
# appInfos
|
|
454
|
+
#
|
|
437
455
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
456
|
+
def get_app_infos(filter: {}, includes: nil, limit: nil, sort: nil)
|
|
457
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
458
|
+
tunes_request_client.get("appInfos", params)
|
|
459
|
+
end
|
|
442
460
|
|
|
443
|
-
|
|
444
|
-
|
|
461
|
+
def patch_app_info(app_info_id: nil, attributes: {})
|
|
462
|
+
attributes ||= {}
|
|
445
463
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
464
|
+
data = {
|
|
465
|
+
type: "appInfos",
|
|
466
|
+
id: app_info_id
|
|
467
|
+
}
|
|
468
|
+
data[:attributes] = attributes unless attributes.empty?
|
|
451
469
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
470
|
+
body = {
|
|
471
|
+
data: data
|
|
472
|
+
}
|
|
455
473
|
|
|
456
|
-
|
|
457
|
-
|
|
474
|
+
tunes_request_client.patch("appInfos/#{app_info_id}", body)
|
|
475
|
+
end
|
|
458
476
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
#
|
|
478
|
+
# Adding the key will create/update (if value) or delete if nil
|
|
479
|
+
# Not including a key will leave as is
|
|
480
|
+
# category_id_map: {
|
|
481
|
+
# primary_category_id: "GAMES",
|
|
482
|
+
# primary_subcategory_one_id: "PUZZLE",
|
|
483
|
+
# primary_subcategory_two_id: "STRATEGY",
|
|
484
|
+
# secondary_category_id: nil,
|
|
485
|
+
# secondary_subcategory_one_id: nil,
|
|
486
|
+
# secondary_subcategory_two_id: nil
|
|
487
|
+
# }
|
|
488
|
+
#
|
|
489
|
+
def patch_app_info_categories(app_info_id: nil, category_id_map: nil)
|
|
490
|
+
category_id_map ||= {}
|
|
491
|
+
primary_category_id = category_id_map[:primary_category_id]
|
|
492
|
+
primary_subcategory_one_id = category_id_map[:primary_subcategory_one_id]
|
|
493
|
+
primary_subcategory_two_id = category_id_map[:primary_subcategory_two_id]
|
|
494
|
+
secondary_category_id = category_id_map[:secondary_category_id]
|
|
495
|
+
secondary_subcategory_one_id = category_id_map[:secondary_subcategory_one_id]
|
|
496
|
+
secondary_subcategory_two_id = category_id_map[:secondary_subcategory_two_id]
|
|
497
|
+
|
|
498
|
+
relationships = {}
|
|
499
|
+
|
|
500
|
+
# Only update if key is included (otherwise category will be removed)
|
|
501
|
+
if category_id_map.include?(:primary_category_id)
|
|
502
|
+
relationships[:primaryCategory] = {
|
|
503
|
+
data: primary_category_id ? { type: "appCategories", id: primary_category_id } : nil
|
|
504
|
+
}
|
|
505
|
+
end
|
|
479
506
|
|
|
480
|
-
|
|
507
|
+
# Only update if key is included (otherwise category will be removed)
|
|
508
|
+
if category_id_map.include?(:primary_subcategory_one_id)
|
|
509
|
+
relationships[:primarySubcategoryOne] = {
|
|
510
|
+
data: primary_subcategory_one_id ? { type: "appCategories", id: primary_subcategory_one_id } : nil
|
|
511
|
+
}
|
|
512
|
+
end
|
|
481
513
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
514
|
+
# Only update if key is included (otherwise category will be removed)
|
|
515
|
+
if category_id_map.include?(:primary_subcategory_two_id)
|
|
516
|
+
relationships[:primarySubcategoryTwo] = {
|
|
517
|
+
data: primary_subcategory_two_id ? { type: "appCategories", id: primary_subcategory_two_id } : nil
|
|
518
|
+
}
|
|
519
|
+
end
|
|
488
520
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
521
|
+
# Only update if key is included (otherwise category will be removed)
|
|
522
|
+
if category_id_map.include?(:secondary_category_id)
|
|
523
|
+
relationships[:secondaryCategory] = {
|
|
524
|
+
data: secondary_category_id ? { type: "appCategories", id: secondary_category_id } : nil
|
|
525
|
+
}
|
|
526
|
+
end
|
|
495
527
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
528
|
+
# Only update if key is included (otherwise category will be removed)
|
|
529
|
+
if category_id_map.include?(:secondary_subcategory_one_id)
|
|
530
|
+
relationships[:secondarySubcategoryOne] = {
|
|
531
|
+
data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
|
|
532
|
+
}
|
|
533
|
+
end
|
|
502
534
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
535
|
+
# Only update if key is included (otherwise category will be removed)
|
|
536
|
+
if category_id_map.include?(:secondary_subcategory_two_id)
|
|
537
|
+
relationships[:secondarySubcategoryTwo] = {
|
|
538
|
+
data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
|
|
539
|
+
}
|
|
540
|
+
end
|
|
509
541
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
data: secondary_subcategory_one_id ? { type: "appCategories", id: secondary_subcategory_one_id } : nil
|
|
542
|
+
data = {
|
|
543
|
+
type: "appInfos",
|
|
544
|
+
id: app_info_id
|
|
514
545
|
}
|
|
515
|
-
|
|
546
|
+
data[:relationships] = relationships unless relationships.empty?
|
|
516
547
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
relationships[:secondarySubcategoryTwo] = {
|
|
520
|
-
data: secondary_subcategory_two_id ? { type: "appCategories", id: secondary_subcategory_two_id } : nil
|
|
548
|
+
body = {
|
|
549
|
+
data: data
|
|
521
550
|
}
|
|
522
|
-
end
|
|
523
|
-
|
|
524
|
-
data = {
|
|
525
|
-
type: "appInfos",
|
|
526
|
-
id: app_info_id
|
|
527
|
-
}
|
|
528
|
-
data[:relationships] = relationships unless relationships.empty?
|
|
529
551
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
Client.instance.patch("appInfos/#{app_info_id}", body)
|
|
535
|
-
end
|
|
552
|
+
tunes_request_client.patch("appInfos/#{app_info_id}", body)
|
|
553
|
+
end
|
|
536
554
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
555
|
+
def delete_app_info(app_info_id: nil)
|
|
556
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
557
|
+
tunes_request_client.delete("appInfos/#{app_info_id}", params)
|
|
558
|
+
end
|
|
541
559
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
560
|
+
#
|
|
561
|
+
# appInfoLocalizations
|
|
562
|
+
#
|
|
545
563
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
564
|
+
def get_app_info_localizations(app_info_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
|
565
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
566
|
+
tunes_request_client.get("appInfos/#{app_info_id}/appInfoLocalizations", params)
|
|
567
|
+
end
|
|
550
568
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
def post_app_info_localization(app_info_id: nil, attributes: {})
|
|
570
|
+
body = {
|
|
571
|
+
data: {
|
|
572
|
+
type: "appInfoLocalizations",
|
|
573
|
+
attributes: attributes,
|
|
574
|
+
relationships: {
|
|
575
|
+
appStoreVersion: {
|
|
576
|
+
data: {
|
|
577
|
+
type: "appStoreVersions",
|
|
578
|
+
id: app_info_id
|
|
579
|
+
}
|
|
561
580
|
}
|
|
562
581
|
}
|
|
563
582
|
}
|
|
564
583
|
}
|
|
565
|
-
}
|
|
566
584
|
|
|
567
|
-
|
|
568
|
-
|
|
585
|
+
tunes_request_client.post("appInfoLocalizations", body)
|
|
586
|
+
end
|
|
569
587
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
588
|
+
def patch_app_info_localization(app_info_localization_id: nil, attributes: {})
|
|
589
|
+
body = {
|
|
590
|
+
data: {
|
|
591
|
+
type: "appInfoLocalizations",
|
|
592
|
+
id: app_info_localization_id,
|
|
593
|
+
attributes: attributes
|
|
594
|
+
}
|
|
576
595
|
}
|
|
577
|
-
}
|
|
578
596
|
|
|
579
|
-
|
|
580
|
-
|
|
597
|
+
tunes_request_client.patch("appInfoLocalizations/#{app_info_localization_id}", body)
|
|
598
|
+
end
|
|
581
599
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
600
|
+
#
|
|
601
|
+
# appStoreReviewDetails
|
|
602
|
+
#
|
|
585
603
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
604
|
+
def get_app_store_review_detail(app_store_version_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
|
605
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
606
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreReviewDetail", params)
|
|
607
|
+
end
|
|
590
608
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
609
|
+
def post_app_store_review_detail(app_store_version_id: nil, attributes: {})
|
|
610
|
+
body = {
|
|
611
|
+
data: {
|
|
612
|
+
type: "appStoreReviewDetails",
|
|
613
|
+
attributes: attributes,
|
|
614
|
+
relationships: {
|
|
615
|
+
appStoreVersion: {
|
|
616
|
+
data: {
|
|
617
|
+
type: "appStoreVersions",
|
|
618
|
+
id: app_store_version_id
|
|
619
|
+
}
|
|
601
620
|
}
|
|
602
621
|
}
|
|
603
622
|
}
|
|
604
623
|
}
|
|
605
|
-
}
|
|
606
624
|
|
|
607
|
-
|
|
608
|
-
|
|
625
|
+
tunes_request_client.post("appStoreReviewDetails", body)
|
|
626
|
+
end
|
|
609
627
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
628
|
+
def patch_app_store_review_detail(app_store_review_detail_id: nil, attributes: {})
|
|
629
|
+
body = {
|
|
630
|
+
data: {
|
|
631
|
+
type: "appStoreReviewDetails",
|
|
632
|
+
id: app_store_review_detail_id,
|
|
633
|
+
attributes: attributes
|
|
634
|
+
}
|
|
616
635
|
}
|
|
617
|
-
}
|
|
618
636
|
|
|
619
|
-
|
|
620
|
-
|
|
637
|
+
tunes_request_client.patch("appStoreReviewDetails/#{app_store_review_detail_id}", body)
|
|
638
|
+
end
|
|
621
639
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
640
|
+
#
|
|
641
|
+
# appStoreVersionLocalizations
|
|
642
|
+
#
|
|
625
643
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
644
|
+
def get_app_store_version_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
|
|
645
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
646
|
+
tunes_request_client.get("appStoreVersionLocalizations", params)
|
|
647
|
+
end
|
|
630
648
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
649
|
+
def post_app_store_version_localization(app_store_version_id: nil, attributes: {})
|
|
650
|
+
body = {
|
|
651
|
+
data: {
|
|
652
|
+
type: "appStoreVersionLocalizations",
|
|
653
|
+
attributes: attributes,
|
|
654
|
+
relationships: {
|
|
655
|
+
appStoreVersion: {
|
|
656
|
+
data: {
|
|
657
|
+
type: "appStoreVersions",
|
|
658
|
+
id: app_store_version_id
|
|
659
|
+
}
|
|
641
660
|
}
|
|
642
661
|
}
|
|
643
662
|
}
|
|
644
663
|
}
|
|
645
|
-
}
|
|
646
664
|
|
|
647
|
-
|
|
648
|
-
|
|
665
|
+
tunes_request_client.post("appStoreVersionLocalizations", body)
|
|
666
|
+
end
|
|
649
667
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
668
|
+
def patch_app_store_version_localization(app_store_version_localization_id: nil, attributes: {})
|
|
669
|
+
body = {
|
|
670
|
+
data: {
|
|
671
|
+
type: "appStoreVersionLocalizations",
|
|
672
|
+
id: app_store_version_localization_id,
|
|
673
|
+
attributes: attributes
|
|
674
|
+
}
|
|
656
675
|
}
|
|
657
|
-
}
|
|
658
676
|
|
|
659
|
-
|
|
660
|
-
|
|
677
|
+
tunes_request_client.patch("appStoreVersionLocalizations/#{app_store_version_localization_id}", body)
|
|
678
|
+
end
|
|
661
679
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
680
|
+
def delete_app_store_version_localization(app_store_version_localization_id: nil)
|
|
681
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
682
|
+
tunes_request_client.delete("appStoreVersionLocalizations/#{app_store_version_localization_id}", params)
|
|
683
|
+
end
|
|
666
684
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
685
|
+
#
|
|
686
|
+
# appStoreVersionPhasedReleases
|
|
687
|
+
#
|
|
670
688
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
689
|
+
def get_app_store_version_phased_release(app_store_version_id: nil)
|
|
690
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
691
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionPhasedRelease", params)
|
|
692
|
+
end
|
|
675
693
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
694
|
+
def post_app_store_version_phased_release(app_store_version_id: nil, attributes: {})
|
|
695
|
+
body = {
|
|
696
|
+
data: {
|
|
697
|
+
type: "appStoreVersionPhasedReleases",
|
|
698
|
+
attributes: attributes,
|
|
699
|
+
relationships: {
|
|
700
|
+
appStoreVersion: {
|
|
701
|
+
data: {
|
|
702
|
+
type: "appStoreVersions",
|
|
703
|
+
id: app_store_version_id
|
|
704
|
+
}
|
|
686
705
|
}
|
|
687
706
|
}
|
|
688
707
|
}
|
|
689
708
|
}
|
|
690
|
-
}
|
|
691
709
|
|
|
692
|
-
|
|
693
|
-
|
|
710
|
+
tunes_request_client.post("appStoreVersionPhasedReleases", body)
|
|
711
|
+
end
|
|
694
712
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
713
|
+
def delete_app_store_version_phased_release(app_store_version_phased_release_id: nil)
|
|
714
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
715
|
+
tunes_request_client.delete("appStoreVersionPhasedReleases/#{app_store_version_phased_release_id}", params)
|
|
716
|
+
end
|
|
699
717
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
718
|
+
#
|
|
719
|
+
# appStoreVersions
|
|
720
|
+
#
|
|
703
721
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
722
|
+
def get_app_store_versions(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
|
|
723
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
724
|
+
tunes_request_client.get("apps/#{app_id}/appStoreVersions", params)
|
|
725
|
+
end
|
|
708
726
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
727
|
+
def get_app_store_version(app_store_version_id: nil, includes: nil)
|
|
728
|
+
params = tunes_request_client.build_params(filter: nil, includes: includes, limit: nil, sort: nil)
|
|
729
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}", params)
|
|
730
|
+
end
|
|
713
731
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
732
|
+
def post_app_store_version(app_id: nil, attributes: {})
|
|
733
|
+
body = {
|
|
734
|
+
data: {
|
|
735
|
+
type: "appStoreVersions",
|
|
736
|
+
attributes: attributes,
|
|
737
|
+
relationships: {
|
|
738
|
+
app: {
|
|
739
|
+
data: {
|
|
740
|
+
type: "apps",
|
|
741
|
+
id: app_id
|
|
742
|
+
}
|
|
724
743
|
}
|
|
725
744
|
}
|
|
726
745
|
}
|
|
727
746
|
}
|
|
728
|
-
}
|
|
729
747
|
|
|
730
|
-
|
|
731
|
-
|
|
748
|
+
tunes_request_client.post("appStoreVersions", body)
|
|
749
|
+
end
|
|
732
750
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
751
|
+
def patch_app_store_version(app_store_version_id: nil, attributes: {})
|
|
752
|
+
body = {
|
|
753
|
+
data: {
|
|
754
|
+
type: "appStoreVersions",
|
|
755
|
+
id: app_store_version_id,
|
|
756
|
+
attributes: attributes
|
|
757
|
+
}
|
|
739
758
|
}
|
|
740
|
-
}
|
|
741
759
|
|
|
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
|
-
}
|
|
760
|
+
tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
|
|
752
761
|
end
|
|
753
762
|
|
|
754
|
-
|
|
755
|
-
data
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
763
|
+
def patch_app_store_version_with_build(app_store_version_id: nil, build_id: nil)
|
|
764
|
+
data = nil
|
|
765
|
+
if build_id
|
|
766
|
+
data = {
|
|
767
|
+
type: "builds",
|
|
768
|
+
id: build_id
|
|
769
|
+
}
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
body = {
|
|
773
|
+
data: {
|
|
774
|
+
type: "appStoreVersions",
|
|
775
|
+
id: app_store_version_id,
|
|
776
|
+
relationships: {
|
|
777
|
+
build: {
|
|
778
|
+
data: data
|
|
779
|
+
}
|
|
761
780
|
}
|
|
762
781
|
}
|
|
763
782
|
}
|
|
764
|
-
}
|
|
765
783
|
|
|
766
|
-
|
|
767
|
-
|
|
784
|
+
tunes_request_client.patch("appStoreVersions/#{app_store_version_id}", body)
|
|
785
|
+
end
|
|
768
786
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
787
|
+
#
|
|
788
|
+
# appStoreVersionPhasedReleases
|
|
789
|
+
#
|
|
772
790
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
791
|
+
def get_reset_ratings_request(app_store_version_id: nil)
|
|
792
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
793
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/resetRatingsRequest", params)
|
|
794
|
+
end
|
|
777
795
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
796
|
+
def post_reset_ratings_request(app_store_version_id: nil)
|
|
797
|
+
body = {
|
|
798
|
+
data: {
|
|
799
|
+
type: "resetRatingsRequests",
|
|
800
|
+
relationships: {
|
|
801
|
+
appStoreVersion: {
|
|
802
|
+
data: {
|
|
803
|
+
type: "appStoreVersions",
|
|
804
|
+
id: app_store_version_id
|
|
805
|
+
}
|
|
787
806
|
}
|
|
788
807
|
}
|
|
789
808
|
}
|
|
790
809
|
}
|
|
791
|
-
}
|
|
792
810
|
|
|
793
|
-
|
|
794
|
-
|
|
811
|
+
tunes_request_client.post("resetRatingsRequests", body)
|
|
812
|
+
end
|
|
795
813
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
814
|
+
def delete_reset_ratings_request(reset_ratings_request_id: nil)
|
|
815
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
816
|
+
tunes_request_client.delete("resetRatingsRequests/#{reset_ratings_request_id}", params)
|
|
817
|
+
end
|
|
800
818
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
819
|
+
#
|
|
820
|
+
# appStoreVersionSubmissions
|
|
821
|
+
#
|
|
804
822
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
823
|
+
def get_app_store_version_submission(app_store_version_id: nil)
|
|
824
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
825
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/appStoreVersionSubmission", params)
|
|
826
|
+
end
|
|
809
827
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
828
|
+
def post_app_store_version_submission(app_store_version_id: nil)
|
|
829
|
+
body = {
|
|
830
|
+
data: {
|
|
831
|
+
type: "appStoreVersionSubmissions",
|
|
832
|
+
relationships: {
|
|
833
|
+
appStoreVersion: {
|
|
834
|
+
data: {
|
|
835
|
+
type: "appStoreVersions",
|
|
836
|
+
id: app_store_version_id
|
|
837
|
+
}
|
|
819
838
|
}
|
|
820
839
|
}
|
|
821
840
|
}
|
|
822
841
|
}
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
Client.instance.post("appStoreVersionSubmissions", body)
|
|
826
|
-
end
|
|
827
842
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
Client.instance.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
|
|
831
|
-
end
|
|
843
|
+
tunes_request_client.post("appStoreVersionSubmissions", body)
|
|
844
|
+
end
|
|
832
845
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
846
|
+
def delete_app_store_version_submission(app_store_version_submission_id: nil)
|
|
847
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
848
|
+
tunes_request_client.delete("appStoreVersionSubmissions/#{app_store_version_submission_id}", params)
|
|
849
|
+
end
|
|
836
850
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
+
#
|
|
852
|
+
# appStoreVersionReleaseRequests
|
|
853
|
+
#
|
|
854
|
+
|
|
855
|
+
def post_app_store_version_release_request(app_store_version_id: nil)
|
|
856
|
+
body = {
|
|
857
|
+
data: {
|
|
858
|
+
type: "appStoreVersionReleaseRequests",
|
|
859
|
+
relationships: {
|
|
860
|
+
appStoreVersion: {
|
|
861
|
+
data: {
|
|
862
|
+
type: "appStoreVersions",
|
|
863
|
+
id: app_store_version_id
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
851
869
|
|
|
852
|
-
|
|
853
|
-
|
|
870
|
+
tunes_request_client.post("appStoreVersionReleaseRequests", body)
|
|
871
|
+
end
|
|
854
872
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
873
|
+
#
|
|
874
|
+
# idfaDeclarations
|
|
875
|
+
#
|
|
858
876
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
877
|
+
def get_idfa_declaration(app_store_version_id: nil)
|
|
878
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
879
|
+
tunes_request_client.get("appStoreVersions/#{app_store_version_id}/idfaDeclaration", params)
|
|
880
|
+
end
|
|
863
881
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
882
|
+
def post_idfa_declaration(app_store_version_id: nil, attributes: nil)
|
|
883
|
+
body = {
|
|
884
|
+
data: {
|
|
885
|
+
type: "idfaDeclarations",
|
|
886
|
+
attributes: attributes,
|
|
887
|
+
relationships: {
|
|
888
|
+
appStoreVersion: {
|
|
889
|
+
data: {
|
|
890
|
+
type: "appStoreVersions",
|
|
891
|
+
id: app_store_version_id
|
|
892
|
+
}
|
|
874
893
|
}
|
|
875
894
|
}
|
|
876
895
|
}
|
|
877
896
|
}
|
|
878
|
-
}
|
|
879
897
|
|
|
880
|
-
|
|
881
|
-
|
|
898
|
+
tunes_request_client.post("idfaDeclarations", body)
|
|
899
|
+
end
|
|
882
900
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
901
|
+
def patch_idfa_declaration(idfa_declaration_id: nil, attributes: nil)
|
|
902
|
+
body = {
|
|
903
|
+
data: {
|
|
904
|
+
type: "idfaDeclarations",
|
|
905
|
+
id: idfa_declaration_id,
|
|
906
|
+
attributes: attributes
|
|
907
|
+
}
|
|
889
908
|
}
|
|
890
|
-
}
|
|
891
909
|
|
|
892
|
-
|
|
893
|
-
|
|
910
|
+
tunes_request_client.patch("idfaDeclarations/#{idfa_declaration_id}", body)
|
|
911
|
+
end
|
|
894
912
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
913
|
+
def delete_idfa_declaration(idfa_declaration_id: nil)
|
|
914
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
915
|
+
tunes_request_client.delete("idfaDeclarations/#{idfa_declaration_id}", params)
|
|
916
|
+
end
|
|
899
917
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
918
|
+
#
|
|
919
|
+
# sandboxTesters
|
|
920
|
+
#
|
|
903
921
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
922
|
+
def get_sandbox_testers(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
923
|
+
params = tunes_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
|
|
924
|
+
tunes_request_client.get("sandboxTesters", params)
|
|
925
|
+
end
|
|
908
926
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
927
|
+
def post_sandbox_tester(attributes: {})
|
|
928
|
+
body = {
|
|
929
|
+
data: {
|
|
930
|
+
type: "sandboxTesters",
|
|
931
|
+
attributes: attributes
|
|
932
|
+
}
|
|
914
933
|
}
|
|
915
|
-
}
|
|
916
934
|
|
|
917
|
-
|
|
918
|
-
|
|
935
|
+
tunes_request_client.post("sandboxTesters", body)
|
|
936
|
+
end
|
|
919
937
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
938
|
+
def delete_sandbox_tester(sandbox_tester_id: nil)
|
|
939
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
940
|
+
tunes_request_client.delete("sandboxTesters/#{sandbox_tester_id}", params)
|
|
941
|
+
end
|
|
924
942
|
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
943
|
+
#
|
|
944
|
+
# territories
|
|
945
|
+
#
|
|
928
946
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
947
|
+
def get_territories(filter: {}, includes: nil, limit: nil, sort: nil)
|
|
948
|
+
params = tunes_request_client.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
|
|
949
|
+
tunes_request_client.get("territories", params)
|
|
950
|
+
end
|
|
932
951
|
end
|
|
933
952
|
end
|
|
934
953
|
end
|