app_store_dev_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.gitignore +56 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +198 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +4 -0
- data/app_store_dev_api.gemspec +54 -0
- data/bin/.DS_Store +0 -0
- data/bin/console +10 -0
- data/bin/setup +10 -0
- data/lib/.DS_Store +0 -0
- data/lib/app_store_dev_api/.DS_Store +0 -0
- data/lib/app_store_dev_api/base.rb +83 -0
- data/lib/app_store_dev_api/bundle_id_capability_create_request.rb +13 -0
- data/lib/app_store_dev_api/bundle_id_create_request.rb +16 -0
- data/lib/app_store_dev_api/certificate_create_request.rb +14 -0
- data/lib/app_store_dev_api/client/authorization.rb +38 -0
- data/lib/app_store_dev_api/client/builder.rb +91 -0
- data/lib/app_store_dev_api/client/options.rb +48 -0
- data/lib/app_store_dev_api/client/registry.rb +15 -0
- data/lib/app_store_dev_api/client/utils.rb +32 -0
- data/lib/app_store_dev_api/client.rb +66 -0
- data/lib/app_store_dev_api/device_create_request.rb +15 -0
- data/lib/app_store_dev_api/object/attributes.rb +47 -0
- data/lib/app_store_dev_api/object/data.rb +45 -0
- data/lib/app_store_dev_api/object/id.rb +28 -0
- data/lib/app_store_dev_api/object/included.rb +27 -0
- data/lib/app_store_dev_api/object/properties.rb +23 -0
- data/lib/app_store_dev_api/object/type.rb +23 -0
- data/lib/app_store_dev_api/profile_create_request.rb +14 -0
- data/lib/app_store_dev_api/request/body.rb +26 -0
- data/lib/app_store_dev_api/request/builder/create.rb +69 -0
- data/lib/app_store_dev_api/request.rb +93 -0
- data/lib/app_store_dev_api/requests/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app/update.rb +27 -0
- data/lib/app_store_dev_api/requests/v1/app_availability/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_availability/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/app_info/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_info/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_info_localization/create.rb +24 -0
- data/lib/app_store_dev_api/requests/v1/app_info_localization/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_price_ schedule/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_price_ schedule/update.rb +17 -0
- data/lib/app_store_dev_api/requests/v1/app_promoted_purchases/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_promoted_purchases/update.rb +16 -0
- data/lib/app_store_dev_api/requests/v1/app_store_review_detail/create.rb +27 -0
- data/lib/app_store_dev_api/requests/v1/app_store_review_detail/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version/create.rb +23 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_build_linkage_request/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_build_linkage_request/update.rb +17 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_localization/create.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_localization/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_phased_releases/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_phased_releases/update.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_promotion/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_promotion/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_releases_request/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/app_store_version_releases_request/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/beta_build_localization/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/beta_build_localization/create.rb +14 -0
- data/lib/app_store_dev_api/requests/v1/beta_build_localization/update.rb +13 -0
- data/lib/app_store_dev_api/requests/v1/builds/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/builds/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/customer_review_response/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/customer_review_response/create.rb +19 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_ territory/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_ territory/create.rb +19 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_localization/create.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_localization/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_price_schedule/create.rb +17 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_review_screenshot/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_review_screenshot/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/in_app_purchase_submission/create.rb +17 -0
- data/lib/app_store_dev_api/requests/v1/promoted_purchases/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/promoted_purchases/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/promoted_purchases_image/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/promoted_purchases_image/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/review_submission/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/review_submission/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/review_submission/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/review_submission_item/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/review_submission_item/create.rb +15 -0
- data/lib/app_store_dev_api/requests/v1/subscription/create.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/subscription/update.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/subscription_availability/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/subscription_availability/create.rb +19 -0
- data/lib/app_store_dev_api/requests/v1/subscription_grace_period/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/subscription_grace_period/update.rb +23 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group_localization/create.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group_localization/update.rb +24 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group_submission/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/subscription_group_submission/create.rb +17 -0
- data/lib/app_store_dev_api/requests/v1/subscription_introductory_offer/create.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/subscription_introductory_offer/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_localization/create.rb +23 -0
- data/lib/app_store_dev_api/requests/v1/subscription_localization/update.rb +23 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code/create.rb +26 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code_cunstom_code/create.rb +23 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code_cunstom_code/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code_one_time_use_code/create.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_offer_code_one_time_use_code/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v1/subscription_price/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/subscription_price/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/subscription_promotional_offer/create.rb +25 -0
- data/lib/app_store_dev_api/requests/v1/subscription_promotional_offer/update.rb +19 -0
- data/lib/app_store_dev_api/requests/v1/subscription_review_screenshot/create.rb +20 -0
- data/lib/app_store_dev_api/requests/v1/subscription_review_screenshot/update.rb +21 -0
- data/lib/app_store_dev_api/requests/v1/subscription_submission/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v1/subscription_submission/create.rb +15 -0
- data/lib/app_store_dev_api/requests/v2/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v2/in_app_purchase/create.rb +25 -0
- data/lib/app_store_dev_api/requests/v2/in_app_purchase/update.rb +23 -0
- data/lib/app_store_dev_api/requests/v2/sandbox_tester/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v2/sandbox_tester/update.rb +22 -0
- data/lib/app_store_dev_api/requests/v2/sandbox_tester_clear_purchase_history/.DS_Store +0 -0
- data/lib/app_store_dev_api/requests/v2/sandbox_tester_clear_purchase_history/update.rb +16 -0
- data/lib/app_store_dev_api/schema/object.rb +14 -0
- data/lib/app_store_dev_api/schema/type.rb +15 -0
- data/lib/app_store_dev_api/schema/web_service_endpoint.rb +27 -0
- data/lib/app_store_dev_api/schema.rb +24 -0
- data/lib/app_store_dev_api/specification/component/schema.rb +25 -0
- data/lib/app_store_dev_api/specification.rb +54 -0
- data/lib/app_store_dev_api/user_invitation_create_request.rb +18 -0
- data/lib/app_store_dev_api/version.rb +5 -0
- data/lib/app_store_dev_api.rb +23 -0
- data/lib/config/schema.json +1650 -0
- data/lib/tasks/build.rake +8 -0
- data/lib/tasks/bundle.rake +7 -0
- data/lib/tasks/changelog.rake +17 -0
- data/lib/tasks/console.rake +9 -0
- data/lib/tasks/git.rake +19 -0
- data/lib/tasks/push.rake +18 -0
- data/lib/tasks/release.rake +17 -0
- data/lib/tasks/version.rake +28 -0
- data/sig/app_store_connect_api.rbs +4 -0
- metadata +429 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionOfferCodeOneTimeUseCode
|
7
|
+
class Create < Request::Body
|
8
|
+
|
9
|
+
data do
|
10
|
+
type 'subscriptionOfferCodeOneTimeUseCodes'
|
11
|
+
|
12
|
+
attributes do
|
13
|
+
property :expiration_date, required: true
|
14
|
+
property :number_of_codes, required: true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module AutoRenewableSubscriptionOfferCodeOneTimeUseCode
|
7
|
+
class Update < Request::Body
|
8
|
+
|
9
|
+
data do
|
10
|
+
id
|
11
|
+
type 'subscriptionOfferCodeOneTimeUseCodes'
|
12
|
+
|
13
|
+
attributes do
|
14
|
+
property :active
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionPrices
|
7
|
+
class Create < Request::Body
|
8
|
+
data do
|
9
|
+
type 'subscriptionPrices'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :preserve_current_price
|
13
|
+
property :start_date
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionPromotionalOffers
|
7
|
+
class Create < Request::Body
|
8
|
+
|
9
|
+
data do
|
10
|
+
type 'subscriptionPromotionalOffers'
|
11
|
+
|
12
|
+
attributes do
|
13
|
+
property :duration, required: true
|
14
|
+
property :name, required: true
|
15
|
+
property :number_of_periods, required: true
|
16
|
+
property :offer_code, required: true
|
17
|
+
property :offer_mode, required: true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionPromotionalOffers
|
7
|
+
class Update < Request::Body
|
8
|
+
|
9
|
+
data do
|
10
|
+
id
|
11
|
+
type 'subscriptionPromotionalOffers'
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionAppStoreReviewScreenshot
|
7
|
+
class Create < Request::Body
|
8
|
+
data do
|
9
|
+
type 'subscriptionAppStoreReviewScreenshots'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :file_name, required: true
|
13
|
+
property :file_size, required: true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V1
|
6
|
+
module SubscriptionAppStoreReviewScreenshot
|
7
|
+
class Update < Request::Body
|
8
|
+
data do
|
9
|
+
id
|
10
|
+
type 'subscriptionAppStoreReviewScreenshots'
|
11
|
+
|
12
|
+
attributes do
|
13
|
+
property :uploaded
|
14
|
+
property :source_file_checksum
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V2
|
6
|
+
module InAppPurchase
|
7
|
+
class Create < Request::Body
|
8
|
+
data do
|
9
|
+
type 'inAppPurchases'
|
10
|
+
|
11
|
+
attributes do
|
12
|
+
property :name, required: true
|
13
|
+
property :product_id, required: true
|
14
|
+
property :in_app_purchase_type, required: true
|
15
|
+
property :available_in_all_territories
|
16
|
+
property :family_sharable
|
17
|
+
property :review_note
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V2
|
6
|
+
module InAppPurchase
|
7
|
+
class Update < Request::Body
|
8
|
+
data do
|
9
|
+
id
|
10
|
+
type 'inAppPurchases'
|
11
|
+
|
12
|
+
attributes do
|
13
|
+
property :name
|
14
|
+
property :available_in_all_territories
|
15
|
+
property :family_sharable
|
16
|
+
property :review_note
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V2
|
6
|
+
module SandboxTester
|
7
|
+
class Update < Request::Body
|
8
|
+
data do
|
9
|
+
id
|
10
|
+
type 'sandboxTesters'
|
11
|
+
|
12
|
+
attributes do
|
13
|
+
property :interrupt_purchases
|
14
|
+
property :subscription_renewal_rate
|
15
|
+
property :territory
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
module Requests
|
5
|
+
module V2
|
6
|
+
module SandboxTestersClearPurchaseHistory
|
7
|
+
class Update < Request::Body
|
8
|
+
data do
|
9
|
+
|
10
|
+
type 'sandboxTestersClearPurchaseHistoryRequest'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
class Schema
|
5
|
+
class Type
|
6
|
+
attr_reader :type, :options, :values
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@type = options[:type]
|
10
|
+
@values = options[:values]
|
11
|
+
@options = options
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
class Schema
|
5
|
+
class WebServiceEndpoint
|
6
|
+
def initialize(options)
|
7
|
+
@options = options
|
8
|
+
end
|
9
|
+
|
10
|
+
def alias
|
11
|
+
@options.fetch(:alias).to_sym
|
12
|
+
end
|
13
|
+
|
14
|
+
def http_method
|
15
|
+
@options[:http_method].to_sym
|
16
|
+
end
|
17
|
+
|
18
|
+
def http_body_type
|
19
|
+
@options[:http_body_type]
|
20
|
+
end
|
21
|
+
|
22
|
+
def url
|
23
|
+
@options[:url]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'app_store_dev_api/schema/type'
|
4
|
+
require 'app_store_dev_api/schema/object'
|
5
|
+
require 'app_store_dev_api/schema/web_service_endpoint'
|
6
|
+
|
7
|
+
module AppStoreDevApi
|
8
|
+
class Schema
|
9
|
+
attr_reader :types, :web_service_endpoints, :objects
|
10
|
+
|
11
|
+
def initialize(path)
|
12
|
+
schema = JSON.parse(File.read(path)).deep_symbolize_keys
|
13
|
+
@types = schema[:types].map do |options|
|
14
|
+
Type.new(options)
|
15
|
+
end
|
16
|
+
@web_service_endpoints = schema[:web_service_endpoints].map do |options|
|
17
|
+
WebServiceEndpoint.new(options)
|
18
|
+
end
|
19
|
+
@objects = schema[:objects].map do |options|
|
20
|
+
Object.new(options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
class Specification
|
5
|
+
module Component
|
6
|
+
class Schema
|
7
|
+
def initialize(declaration)
|
8
|
+
@declaration = declaration
|
9
|
+
end
|
10
|
+
|
11
|
+
def properties
|
12
|
+
@declaration['properties']
|
13
|
+
end
|
14
|
+
|
15
|
+
def required
|
16
|
+
@declaration['required']
|
17
|
+
end
|
18
|
+
|
19
|
+
def title
|
20
|
+
@declaration['title']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'net/http'
|
4
|
+
require 'app_store_dev_api/specification/component/schema'
|
5
|
+
|
6
|
+
module AppStoreDevApi
|
7
|
+
class Specification
|
8
|
+
def initialize(hash)
|
9
|
+
@hash = hash
|
10
|
+
end
|
11
|
+
|
12
|
+
def find(version, type)
|
13
|
+
@hash['paths'].find do |path, _declaration|
|
14
|
+
path == "/#{version}/#{type}"
|
15
|
+
end&.[](-1)
|
16
|
+
end
|
17
|
+
|
18
|
+
def component_schema(ref)
|
19
|
+
Component::Schema.new(traverse(ref))
|
20
|
+
end
|
21
|
+
|
22
|
+
def traverse(ref)
|
23
|
+
_, *parts = ref.split('/')
|
24
|
+
|
25
|
+
@hash.dig(*parts)
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_request_schema_ref(version, type)
|
29
|
+
declarations = find(version, type)
|
30
|
+
declarations['post']['requestBody']['content']['application/json']['schema']['$ref']
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.read(path)
|
34
|
+
require 'zip'
|
35
|
+
|
36
|
+
Zip::File.open(path) do |zip_file|
|
37
|
+
entry, = zip_file.entries
|
38
|
+
content = entry.get_input_stream(&:read)
|
39
|
+
|
40
|
+
JSON.parse(content)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.download(path)
|
45
|
+
uri = URI('https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip')
|
46
|
+
|
47
|
+
Net::HTTP.start(uri.host, uri.port, { use_ssl: true }) do |http|
|
48
|
+
response = http.get(uri.path)
|
49
|
+
|
50
|
+
File.write(path, response.body)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppStoreDevApi
|
4
|
+
class UserInvitationCreateRequest < Request::Body
|
5
|
+
data do
|
6
|
+
type 'userInvitations'
|
7
|
+
|
8
|
+
attributes do
|
9
|
+
property :first_name, required: true
|
10
|
+
property :last_name, required: true
|
11
|
+
property :email, required: true
|
12
|
+
property :roles, required: true
|
13
|
+
property :all_apps_visible
|
14
|
+
property :provisioning_allowed
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'zeitwerk'
|
4
|
+
require 'active_support/all'
|
5
|
+
|
6
|
+
app_store_dev_api_LOADER = Zeitwerk::Loader.for_gem
|
7
|
+
app_store_dev_api_LOADER.setup
|
8
|
+
|
9
|
+
module AppStoreDevApi
|
10
|
+
@config = {}
|
11
|
+
|
12
|
+
class << self
|
13
|
+
attr_accessor :config
|
14
|
+
|
15
|
+
def rel(id, type, array: false)
|
16
|
+
if array
|
17
|
+
{ data: [{ id: id, type: type }] }.freeze
|
18
|
+
else
|
19
|
+
{ data: { id: id, type: type } }.freeze
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|