app_store_connect_api_client 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +41 -0
  4. data/CHANGELOG.md +9 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/Gemfile +5 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +94 -0
  9. data/Rakefile +10 -0
  10. data/app_store_connect_api.gemspec +41 -0
  11. data/lib/app_store_connect_api/authorization.rb +36 -0
  12. data/lib/app_store_connect_api/client.rb +92 -0
  13. data/lib/app_store_connect_api/domain/age_rating_declarations.rb +14 -0
  14. data/lib/app_store_connect_api/domain/app_availabilities.rb +24 -0
  15. data/lib/app_store_connect_api/domain/app_categories.rb +27 -0
  16. data/lib/app_store_connect_api/domain/app_info_localizations.rb +31 -0
  17. data/lib/app_store_connect_api/domain/app_infos.rb +59 -0
  18. data/lib/app_store_connect_api/domain/app_price_points.rb +17 -0
  19. data/lib/app_store_connect_api/domain/app_price_schedules.rb +35 -0
  20. data/lib/app_store_connect_api/domain/app_store_version_localizations.rb +31 -0
  21. data/lib/app_store_connect_api/domain/app_store_version_phased_releases.rb +26 -0
  22. data/lib/app_store_connect_api/domain/app_store_version_release_requests.rb +13 -0
  23. data/lib/app_store_connect_api/domain/app_store_versions.rb +77 -0
  24. data/lib/app_store_connect_api/domain/apps.rb +125 -0
  25. data/lib/app_store_connect_api/domain/beta_app_localizations.rb +41 -0
  26. data/lib/app_store_connect_api/domain/beta_app_review_details.rb +29 -0
  27. data/lib/app_store_connect_api/domain/beta_app_review_submissions.rb +28 -0
  28. data/lib/app_store_connect_api/domain/beta_build_localizations.rb +41 -0
  29. data/lib/app_store_connect_api/domain/beta_groups.rb +81 -0
  30. data/lib/app_store_connect_api/domain/beta_license_agreements.rb +29 -0
  31. data/lib/app_store_connect_api/domain/beta_tester_invitations.rb +14 -0
  32. data/lib/app_store_connect_api/domain/beta_testers.rb +84 -0
  33. data/lib/app_store_connect_api/domain/build_beta_details.rb +29 -0
  34. data/lib/app_store_connect_api/domain/build_beta_notifications.rb +13 -0
  35. data/lib/app_store_connect_api/domain/builds.rb +105 -0
  36. data/lib/app_store_connect_api/domain/bundle_id_capabilities.rb +28 -0
  37. data/lib/app_store_connect_api/domain/bundle_ids.rb +50 -0
  38. data/lib/app_store_connect_api/domain/certificates.rb +29 -0
  39. data/lib/app_store_connect_api/domain/customer_reviews.rb +12 -0
  40. data/lib/app_store_connect_api/domain/devices.rb +31 -0
  41. data/lib/app_store_connect_api/domain/prerelease_versions.rb +27 -0
  42. data/lib/app_store_connect_api/domain/profiles.rb +44 -0
  43. data/lib/app_store_connect_api/domain/review_submission_items.rb +25 -0
  44. data/lib/app_store_connect_api/domain/review_submissions.rb +36 -0
  45. data/lib/app_store_connect_api/domain/sandbox_testers.rb +25 -0
  46. data/lib/app_store_connect_api/domain/user_invitations.rb +36 -0
  47. data/lib/app_store_connect_api/domain/users.rb +55 -0
  48. data/lib/app_store_connect_api/domain.rb +77 -0
  49. data/lib/app_store_connect_api/utils/hash_utils.rb +22 -0
  50. data/lib/app_store_connect_api/utils/relationship_mapper.rb +47 -0
  51. data/lib/app_store_connect_api/utils/string_utils.rb +31 -0
  52. data/lib/app_store_connect_api/version.rb +5 -0
  53. data/lib/app_store_connect_api.rb +28 -0
  54. metadata +198 -0
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module BetaTesters
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_beta_testers
7
+ def beta_testers(options = {})
8
+ get '/v1/betaTesters', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_beta_tester_information
12
+ def beta_tester(beta_tester_id, options = {})
13
+ get "/v1/betaTesters/#{beta_tester_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/create_a_beta_tester
17
+ def create_beta_tester(attributes, relationships)
18
+ post '/v1/betaTesters', data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships),
20
+ type: 'betaTesters' }
21
+ end
22
+
23
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/delete_a_beta_tester
24
+ def delete_beta_tester(beta_tester_id)
25
+ delete "/v1/betaTesters/#{beta_tester_id}"
26
+ end
27
+
28
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_apps_for_a_beta_tester
29
+ def beta_tester_apps(beta_tester_id, options = {})
30
+ get "/v1/betaTesters/#{beta_tester_id}/apps", options
31
+ end
32
+
33
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_all_app_resource_ids_for_a_beta_tester
34
+ def beta_tester_app_ids(beta_tester_id, options = {})
35
+ get "/v1/betaTesters/#{beta_tester_id}/relationships/apps", options
36
+ end
37
+
38
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_a_beta_tester_s_access_to_apps
39
+ def remove_beta_tester_apps(beta_tester_id, app_ids)
40
+ delete "/v1/betaTesters/#{beta_tester_id}/relationships/apps", data: Utils::RelationshipMapper.resource_keys(app_ids, 'apps')
41
+ end
42
+
43
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_beta_groups_to_which_a_beta_tester_belongs
44
+ def beta_tester_beta_groups(beta_tester_id, options = {})
45
+ get "/v1/betaTesters/#{beta_tester_id}/betaGroups", options
46
+ end
47
+
48
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_all_beta_group_ids_of_a_beta_tester_s_groups
49
+ def beta_tester_beta_group_ids(beta_tester_id, options = {})
50
+ get "/v1/betaTesters/#{beta_tester_id}/relationships/betaGroups", options
51
+ end
52
+
53
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/add_a_beta_tester_to_beta_groups
54
+ def add_beta_tester_beta_groups(beta_tester_id, beta_group_ids)
55
+ post "/v1/betaTesters/#{beta_tester_id}/relationships/betaGroups", data: Utils::RelationshipMapper.resource_keys(beta_group_ids, 'betaGroups')
56
+ end
57
+
58
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_a_beta_tester_from_beta_groups
59
+ def remove_beta_tester_beta_groups(beta_tester_id, beta_group_ids)
60
+ delete "/v1/betaTesters/#{beta_tester_id}/relationships/betaGroups", data: Utils::RelationshipMapper.resource_keys(beta_group_ids, 'betaGroups')
61
+ end
62
+
63
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_builds_individually_assigned_to_a_beta_tester
64
+ def beta_tester_builds(beta_tester_id, options = {})
65
+ get "/v1/betaTesters/#{beta_tester_id}/builds", options
66
+ end
67
+
68
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_all_ids_of_builds_individually_assigned_to_a_beta_tester
69
+ def beta_tester_build_ids(beta_tester_id, options = {})
70
+ get "/v1/betaTesters/#{beta_tester_id}/relationships/builds", options
71
+ end
72
+
73
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/individually_assign_a_beta_tester_to_builds
74
+ def add_beta_tester_builds(beta_tester_id, build_ids)
75
+ post "/v1/betaTesters/#{beta_tester_id}/relationships/builds", data: Utils::RelationshipMapper.resource_keys(build_ids, 'builds')
76
+ end
77
+
78
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/individually_unassign_a_beta_tester_from_builds
79
+ def remove_beta_tester_builds(beta_tester_id, build_ids)
80
+ delete "/v1/betaTesters/#{beta_tester_id}/relationships/builds", data: Utils::RelationshipMapper.resource_keys(build_ids, 'builds')
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module BuildBetaDetails
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_build_beta_details
7
+ def build_beta_details(options = {})
8
+ get '/v1/buildBetaDetails', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_build_beta_detail_information
12
+ def build_beta_detail(build_beta_detail_id, options = {})
13
+ get "/v1/buildBetaDetails/#{build_beta_detail_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_build_beta_detail
17
+ def update_build_beta_detail(build_beta_detail_id, attributes)
18
+ patch "/v1/buildBetaDetails/#{build_beta_detail_id}", data: { attributes: attributes,
19
+ id: build_beta_detail_id,
20
+ type: 'buildBetaDetails' }
21
+ end
22
+
23
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_build_information_of_a_build_beta_detail
24
+ def build_beta_detail_build(build_beta_detail_id, options = {})
25
+ get "/v1/buildBetaDetails/#{build_beta_detail_id}/build", options
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module BuildBetaNotifications
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/send_notification_of_an_available_build
7
+ def create_build_beta_notification(relationships)
8
+ post '/v1/buildBetaNotifications', data: { relationships: Utils::RelationshipMapper.expand(relationships),
9
+ type: 'buildBetaNotifications' }
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module Builds
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_builds
7
+ def builds(options = {})
8
+ get '/v1/builds', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_build_information
12
+ def build(build_id, options = {})
13
+ get "/v1/builds/#{build_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_build
17
+ def update_build(build_id, attributes = {}, relationships = {})
18
+ patch "/v1/builds/#{build_id}", data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships),
20
+ id: build_id,
21
+ type: 'builds' }
22
+ end
23
+
24
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_information_of_a_build
25
+ def build_app(build_id, options = {})
26
+ get "/v1/builds/#{build_id}/app", options
27
+ end
28
+
29
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_encryption_declaration_of_a_build
30
+ def build_app_encryption_declaration(build_id, options = {})
31
+ get "/v1/builds/#{build_id}/appEncryptionDeclaration", options
32
+ end
33
+
34
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_the_app_encryption_declaration_id_for_a_build
35
+ def build_app_encryption_declaration_id(build_id)
36
+ get "/v1/builds/#{build_id}/relationships/appEncryptionDeclaration"
37
+ end
38
+
39
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/assign_the_app_encryption_declaration_for_a_build
40
+ def update_build_app_encryption_declaration(build_id, app_encryption_declaration_id)
41
+ patch "/v1/builds/#{build_id}/relationships/appEncryptionDeclaration", data: { id: app_encryption_declaration_id, type: 'appEncryptionDeclarations' }
42
+ end
43
+
44
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_store_version_information_of_a_build
45
+ def build_app_store_version(build_id, options = {})
46
+ get "/v1/builds/#{build_id}/appStoreVersion", options
47
+ end
48
+
49
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_beta_app_review_submission_of_a_build
50
+ def build_beta_app_review_submission(build_id, options = {})
51
+ get "/v1/builds/#{build_id}/betaAppReviewSubmission", options
52
+ end
53
+
54
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_beta_build_localizations_of_a_build
55
+ def build_beta_build_localizations(build_id, options = {})
56
+ get "/v1/builds/#{build_id}/betaBuildLocalizations", options
57
+ end
58
+
59
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_build_beta_details_information_of_a_build
60
+ def build_build_beta_detail(build_id, options = {})
61
+ get "/v1/builds/#{build_id}/buildBetaDetail", options
62
+ end
63
+
64
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/add_access_for_beta_groups_to_a_build
65
+ def add_build_beta_groups(build_id, beta_group_ids)
66
+ post "/v1/builds/#{build_id}/relationships/betaGroups", data: Utils::RelationshipMapper.resource_keys(beta_group_ids, 'betaGroups')
67
+ end
68
+
69
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_access_for_beta_groups_to_a_build
70
+ def remove_build_beta_groups(build_id, beta_group_ids)
71
+ delete "/v1/builds/#{build_id}/relationships/betaGroups", data: Utils::RelationshipMapper.resource_keys(beta_group_ids, 'betaGroups')
72
+ end
73
+
74
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_individual_testers_for_a_build
75
+ def build_individual_testers(build_id, options = {})
76
+ get "/v1/builds/#{build_id}/individualTesters", options
77
+ end
78
+
79
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_all_resource_ids_of_individual_testers_for_a_build
80
+ def build_individual_tester_ids(build_id, options = {})
81
+ get "/v1/builds/#{build_id}/relationships/individualTesters", options
82
+ end
83
+
84
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/assign_individual_testers_to_a_build
85
+ def add_build_individual_testers(build_id, beta_tester_ids)
86
+ post "/v1/builds/#{build_id}/relationships/individualTesters", data: Utils::RelationshipMapper.resource_keys(beta_tester_ids, 'betaTesters')
87
+ end
88
+
89
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_individual_testers_from_a_build
90
+ def remove_build_individual_testers(build_id, beta_tester_ids)
91
+ delete "/v1/builds/#{build_id}/relationships/individualTesters", data: Utils::RelationshipMapper.resource_keys(beta_tester_ids, 'betaTesters')
92
+ end
93
+
94
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_prerelease_version_of_a_build
95
+ def build_prerelease_version(build_id, options = {})
96
+ get "/v1/builds/#{build_id}/preReleaseVersion", options
97
+ end
98
+
99
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_icons_for_a_build
100
+ def build_icons(build_id, options = {})
101
+ get "/v1/builds/#{build_id}/icons", options
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module BundleIdCapabilities
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/enable_a_capability
7
+ def create_bundle_id_capability(attributes, relationships)
8
+ post '/v1/bundleIdCapabilities', data: { attributes: attributes,
9
+ relationships: Utils::RelationshipMapper.expand(relationships),
10
+ type: 'bundleIdCapabilities' }
11
+ end
12
+ alias enable_bundle_id_capability create_bundle_id_capability
13
+
14
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_capability_configuration
15
+ def update_bundle_id_capability(bundle_id_capability_id, attributes)
16
+ patch "/v1/bundleIdCapabilities/#{bundle_id_capability_id}", data: { attributes: attributes,
17
+ id: bundle_id_capability_id,
18
+ type: 'bundleIdCapabilities' }
19
+ end
20
+
21
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/disable_a_capability
22
+ def delete_bundle_id_capability(bundle_id_capability_id)
23
+ delete "/v1/bundleIdCapabilities/#{bundle_id_capability_id}"
24
+ end
25
+ alias disable_bundle_id_capability delete_bundle_id_capability
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module BundleIds
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_bundle_ids
7
+ def bundle_ids(options = {})
8
+ get '/v1/bundleIds', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_bundle_id_information
12
+ def bundle_id(bundle_id_id, options = {})
13
+ get "/v1/bundleIds/#{bundle_id_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_bundle_id
17
+ def create_bundle_id(attributes)
18
+ post '/v1/bundleIds', data: { attributes: attributes,
19
+ type: 'bundleIds' }
20
+ end
21
+
22
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_bundle_id
23
+ def update_bundle_id(bundle_id_id, attributes)
24
+ patch "/v1/bundleIds/#{bundle_id_id}", data: { attributes: attributes,
25
+ id: bundle_id_id,
26
+ type: 'bundleIds' }
27
+ end
28
+
29
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/delete_a_bundle_id
30
+ def delete_bundle_id(bundle_id_id)
31
+ delete "/v1/bundleIds/#{bundle_id_id}"
32
+ end
33
+
34
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_information_of_a_bundle_id
35
+ def bundle_id_app(bundle_id_id, options = {})
36
+ get "/v1/bundleIds/#{bundle_id_id}/app", options
37
+ end
38
+
39
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_profiles_for_a_bundle_id
40
+ def bundle_id_profiles(bundle_id_id, options = {})
41
+ get "/v1/bundleIds/#{bundle_id_id}/profiles", options
42
+ end
43
+
44
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_capabilities_for_a_bundle_id
45
+ def bundle_id_bundle_id_capabilities(bundle_id_id, options = {})
46
+ get "/v1/bundleIds/#{bundle_id_id}/bundleIdCapabilities", options
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module Certificates
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_and_download_certificates
7
+ def certificates(options = {})
8
+ get '/v1/certificates', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_and_download_certificate_information
12
+ def certificate(certificate_id, options = {})
13
+ get "/v1/certificates/#{certificate_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/create_a_certificate
17
+ def create_certificate(attributes)
18
+ post '/v1/certificates', data: { attributes: attributes,
19
+ type: 'certificates' }
20
+ end
21
+
22
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/revoke_a_certificate
23
+ def delete_certificate(certificate_id)
24
+ delete "/v1/certificates/#{certificate_id}"
25
+ end
26
+ alias revoke_certificate delete_certificate
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module CustomerReviews
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_customer_review_information
7
+ def customer_review(customer_review_id, options = {})
8
+ get "/v1/customerReviews/#{customer_review_id}", options
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module Devices
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_devices
7
+ def devices(options = {})
8
+ get '/v1/devices', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_device_information
12
+ def device(device_id, options = {})
13
+ get "/v1/devices/#{device_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_device
17
+ def create_device(attributes)
18
+ post '/v1/devices', data: { attributes: attributes,
19
+ type: 'devices' }
20
+ end
21
+ alias register_device create_device
22
+
23
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_registered_device
24
+ def update_device(device_id, attributes)
25
+ patch "/v1/devices/#{device_id}", data: { attributes: attributes,
26
+ id: device_id,
27
+ type: 'devices' }
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module PrereleaseVersions
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_prerelease_versions
7
+ def prerelease_versions(options = {})
8
+ get '/v1/preReleaseVersions', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_prerelease_version_information
12
+ def prerelease_version(prerelease_version_id, options = {})
13
+ get "/v1/preReleaseVersions/#{prerelease_version_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_app_information_of_a_prerelease_version
17
+ def prerelease_version_app(prerelease_version_id, options = {})
18
+ get "/v1/preReleaseVersions/#{prerelease_version_id}/app", options
19
+ end
20
+
21
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_builds_of_a_prerelease_version
22
+ def prerelease_version_builds(prerelease_version_id, options = {})
23
+ get "/v1/preReleaseVersions/#{prerelease_version_id}/builds", options
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module Profiles
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_and_download_profiles
7
+ def profiles(options = {})
8
+ get '/v1/profiles', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_and_download_profile_information
12
+ def profile(profile_id, options = {})
13
+ get "/v1/profiles/#{profile_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/create_a_profile
17
+ def create_profile(attributes, relationships)
18
+ post '/v1/profiles', data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships),
20
+ type: 'profiles' }
21
+ end
22
+
23
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/delete_a_profile
24
+ def delete_profile(profile_id)
25
+ delete "/v1/profiles/#{profile_id}"
26
+ end
27
+
28
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_the_bundle_id_in_a_profile
29
+ def profile_bundle_id(profile_id, options = {})
30
+ get "/v1/profiles/#{profile_id}/bundleId", options
31
+ end
32
+
33
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_certificates_in_a_profile
34
+ def profile_certificates(profile_id, options = {})
35
+ get "/v1/profiles/#{profile_id}/certificates", options
36
+ end
37
+
38
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_devices_in_a_profile
39
+ def profile_devices(profile_id, options = {})
40
+ get "/v1/profiles/#{profile_id}/devices", options
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module ReviewSubmissionItems
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/post_v1_reviewsubmissionitems
7
+ def create_review_submission_item(relationships)
8
+ post '/v1/reviewSubmissionItems', data: { relationships: Utils::RelationshipMapper.expand(relationships),
9
+ type: 'reviewSubmissionItems' }
10
+ end
11
+
12
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/patch_v1_reviewsubmissionitems_id
13
+ def update_review_submission_item(review_submission_item_id, attributes)
14
+ patch "/v1/reviewSubmissionItems/#{review_submission_item_id}", data: { attributes: attributes,
15
+ id: review_submission_item_id,
16
+ type: 'reviewSubmissionItems' }
17
+ end
18
+
19
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_a_review_submission_item
20
+ def delete_review_submission_item(review_submission_item_id)
21
+ delete "/v1/reviewSubmissionItems/#{review_submission_item_id}"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module ReviewSubmissions
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_review_submissions_for_an_app
7
+ def review_submissions(options = {})
8
+ get '/v1/reviewSubmissions', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_review_submission_information
12
+ def review_submission(review_submission_id, options = {})
13
+ get "/v1/reviewSubmissions/#{review_submission_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/create_a_review_submission
17
+ def create_review_submission(attributes, relationships)
18
+ post '/v1/reviewSubmissions', data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships),
20
+ type: 'reviewSubmissions' }
21
+ end
22
+
23
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_review_submission
24
+ def update_review_submission(review_submission_id, attributes)
25
+ patch "/v1/reviewSubmissions/#{review_submission_id}", data: { attributes: attributes,
26
+ id: review_submission_id,
27
+ type: 'reviewSubmissions' }
28
+ end
29
+
30
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_the_items_in_a_review_submission
31
+ def review_submission_items(review_submission_id, options = {})
32
+ get "/v1/reviewSubmissions/#{review_submission_id}/items", options
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module SandboxTesters
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_sandbox_testers
7
+ def sandbox_testers(options = {})
8
+ get '/v2/sandboxTesters', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_sandbox_tester
12
+ def update_sandbox_tester(sandbox_tester_id, attributes)
13
+ patch "/v2/sandboxTesters/#{sandbox_tester_id}", data: { attributes: attributes,
14
+ id: sandbox_tester_id,
15
+ type: 'sandboxTesters' }
16
+ end
17
+
18
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/clear_purchase_history_for_a_sandbox_tester
19
+ def clear_sandbox_tester_purchase_history(sandbox_tester_ids)
20
+ post '/v2/sandboxTestersClearPurchaseHistoryRequest', data: { relationships: Utils::RelationshipMapper.expand(sandbox_testers: sandbox_tester_ids),
21
+ type: 'sandboxTestersClearPurchaseHistoryRequest' }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module UserInvitations
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_invited_users
7
+ def user_invitations(options = {})
8
+ get '/v1/userInvitations', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_user_invitation_information
12
+ def user_invitation(user_invitation_id, options = {})
13
+ get "/v1/userInvitations/#{user_invitation_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/invite_a_user
17
+ def create_user_invitation(attributes, relationships = {})
18
+ post '/v1/userInvitations', data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships, 'visibleApps' => 'apps'),
20
+ type: 'user_invitations' }
21
+ end
22
+ alias invite_user create_user_invitation
23
+
24
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/cancel_a_user_invitation
25
+ def delete_user_invitation(user_invitation_id)
26
+ delete "/v1/userInvitations/#{user_invitation_id}"
27
+ end
28
+ alias cancel_user_invitation delete_user_invitation
29
+
30
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_apps_visible_to_an_invited_user
31
+ def user_invitation_visible_apps(user_invitation_id, options = {})
32
+ get "/v1/userInvitations/#{user_invitation_id}/visibleApps", options
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreConnectApi
4
+ module Domain
5
+ module Users
6
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_users
7
+ def users(options = {})
8
+ get '/v1/users', options
9
+ end
10
+
11
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/read_user_information
12
+ def user(user_id, options = {})
13
+ get "/v1/users/#{user_id}", options
14
+ end
15
+
16
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/modify_a_user_account
17
+ def update_user(user_id, attributes = {}, relationships = {})
18
+ patch "/v1/users/#{user_id}", data: { attributes: attributes,
19
+ relationships: Utils::RelationshipMapper.expand(relationships, 'visibleApps' => 'apps'),
20
+ id: user_id,
21
+ type: 'users' }
22
+ end
23
+
24
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_a_user_account
25
+ def delete_user(user_id)
26
+ delete "/v1/users/#{user_id}"
27
+ end
28
+
29
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/list_all_apps_visible_to_a_user
30
+ def user_visible_apps(user_id, options = {})
31
+ get "/v1/users/#{user_id}/visibleApps", options
32
+ end
33
+
34
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/get_all_visible_app_resource_ids_for_a_user
35
+ def user_visible_app_ids(user_id, options = {})
36
+ get "/v1/users/#{user_id}/relationships/visibleApps", options
37
+ end
38
+
39
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/add_visible_apps_to_a_user
40
+ def add_user_visible_apps(user_id, visible_app_ids)
41
+ post "/v1/users/#{user_id}/relationships/visibleApps", data: Utils::RelationshipMapper.resource_keys(visible_app_ids, 'apps')
42
+ end
43
+
44
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/replace_the_list_of_visible_apps_for_a_user
45
+ def replace_user_visible_apps(user_id, visible_app_ids)
46
+ patch "/v1/users/#{user_id}/relationships/visibleApps", data: Utils::RelationshipMapper.resource_keys(visible_app_ids, 'apps')
47
+ end
48
+
49
+ # @see https://developer.apple.com/documentation/appstoreconnectapi/remove_visible_apps_from_a_user
50
+ def remove_user_visible_apps(user_id, visible_app_ids)
51
+ delete "/v1/users/#{user_id}/relationships/visibleApps", data: Utils::RelationshipMapper.resource_keys(visible_app_ids, 'apps')
52
+ end
53
+ end
54
+ end
55
+ end