app_store_dev_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +56 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +198 -0
  8. data/LICENSE +21 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +39 -0
  11. data/Rakefile +4 -0
  12. data/app_store_dev_api.gemspec +54 -0
  13. data/bin/.DS_Store +0 -0
  14. data/bin/console +10 -0
  15. data/bin/setup +10 -0
  16. data/lib/.DS_Store +0 -0
  17. data/lib/app_store_dev_api/.DS_Store +0 -0
  18. data/lib/app_store_dev_api/base.rb +83 -0
  19. data/lib/app_store_dev_api/bundle_id_capability_create_request.rb +13 -0
  20. data/lib/app_store_dev_api/bundle_id_create_request.rb +16 -0
  21. data/lib/app_store_dev_api/certificate_create_request.rb +14 -0
  22. data/lib/app_store_dev_api/client/authorization.rb +38 -0
  23. data/lib/app_store_dev_api/client/builder.rb +91 -0
  24. data/lib/app_store_dev_api/client/options.rb +48 -0
  25. data/lib/app_store_dev_api/client/registry.rb +15 -0
  26. data/lib/app_store_dev_api/client/utils.rb +32 -0
  27. data/lib/app_store_dev_api/client.rb +66 -0
  28. data/lib/app_store_dev_api/device_create_request.rb +15 -0
  29. data/lib/app_store_dev_api/object/attributes.rb +47 -0
  30. data/lib/app_store_dev_api/object/data.rb +45 -0
  31. data/lib/app_store_dev_api/object/id.rb +28 -0
  32. data/lib/app_store_dev_api/object/included.rb +27 -0
  33. data/lib/app_store_dev_api/object/properties.rb +23 -0
  34. data/lib/app_store_dev_api/object/type.rb +23 -0
  35. data/lib/app_store_dev_api/profile_create_request.rb +14 -0
  36. data/lib/app_store_dev_api/request/body.rb +26 -0
  37. data/lib/app_store_dev_api/request/builder/create.rb +69 -0
  38. data/lib/app_store_dev_api/request.rb +93 -0
  39. data/lib/app_store_dev_api/requests/.DS_Store +0 -0
  40. data/lib/app_store_dev_api/requests/v1/.DS_Store +0 -0
  41. data/lib/app_store_dev_api/requests/v1/app/.DS_Store +0 -0
  42. data/lib/app_store_dev_api/requests/v1/app/update.rb +27 -0
  43. data/lib/app_store_dev_api/requests/v1/app_availability/.DS_Store +0 -0
  44. data/lib/app_store_dev_api/requests/v1/app_availability/update.rb +21 -0
  45. data/lib/app_store_dev_api/requests/v1/app_info/.DS_Store +0 -0
  46. data/lib/app_store_dev_api/requests/v1/app_info/update.rb +25 -0
  47. data/lib/app_store_dev_api/requests/v1/app_info_localization/create.rb +24 -0
  48. data/lib/app_store_dev_api/requests/v1/app_info_localization/update.rb +25 -0
  49. data/lib/app_store_dev_api/requests/v1/app_price_ schedule/.DS_Store +0 -0
  50. data/lib/app_store_dev_api/requests/v1/app_price_ schedule/update.rb +17 -0
  51. data/lib/app_store_dev_api/requests/v1/app_promoted_purchases/.DS_Store +0 -0
  52. data/lib/app_store_dev_api/requests/v1/app_promoted_purchases/update.rb +16 -0
  53. data/lib/app_store_dev_api/requests/v1/app_store_review_detail/create.rb +27 -0
  54. data/lib/app_store_dev_api/requests/v1/app_store_review_detail/update.rb +25 -0
  55. data/lib/app_store_dev_api/requests/v1/app_store_version/create.rb +23 -0
  56. data/lib/app_store_dev_api/requests/v1/app_store_version/update.rb +25 -0
  57. data/lib/app_store_dev_api/requests/v1/app_store_version_build_linkage_request/.DS_Store +0 -0
  58. data/lib/app_store_dev_api/requests/v1/app_store_version_build_linkage_request/update.rb +17 -0
  59. data/lib/app_store_dev_api/requests/v1/app_store_version_localization/create.rb +25 -0
  60. data/lib/app_store_dev_api/requests/v1/app_store_version_localization/update.rb +25 -0
  61. data/lib/app_store_dev_api/requests/v1/app_store_version_phased_releases/create.rb +20 -0
  62. data/lib/app_store_dev_api/requests/v1/app_store_version_phased_releases/update.rb +20 -0
  63. data/lib/app_store_dev_api/requests/v1/app_store_version_promotion/.DS_Store +0 -0
  64. data/lib/app_store_dev_api/requests/v1/app_store_version_promotion/create.rb +20 -0
  65. data/lib/app_store_dev_api/requests/v1/app_store_version_releases_request/.DS_Store +0 -0
  66. data/lib/app_store_dev_api/requests/v1/app_store_version_releases_request/create.rb +20 -0
  67. data/lib/app_store_dev_api/requests/v1/beta_build_localization/.DS_Store +0 -0
  68. data/lib/app_store_dev_api/requests/v1/beta_build_localization/create.rb +14 -0
  69. data/lib/app_store_dev_api/requests/v1/beta_build_localization/update.rb +13 -0
  70. data/lib/app_store_dev_api/requests/v1/builds/.DS_Store +0 -0
  71. data/lib/app_store_dev_api/requests/v1/builds/update.rb +21 -0
  72. data/lib/app_store_dev_api/requests/v1/customer_review_response/.DS_Store +0 -0
  73. data/lib/app_store_dev_api/requests/v1/customer_review_response/create.rb +19 -0
  74. data/lib/app_store_dev_api/requests/v1/in_app_purchase_ territory/.DS_Store +0 -0
  75. data/lib/app_store_dev_api/requests/v1/in_app_purchase_ territory/create.rb +19 -0
  76. data/lib/app_store_dev_api/requests/v1/in_app_purchase_localization/create.rb +21 -0
  77. data/lib/app_store_dev_api/requests/v1/in_app_purchase_localization/update.rb +21 -0
  78. data/lib/app_store_dev_api/requests/v1/in_app_purchase_price_schedule/create.rb +17 -0
  79. data/lib/app_store_dev_api/requests/v1/in_app_purchase_review_screenshot/create.rb +20 -0
  80. data/lib/app_store_dev_api/requests/v1/in_app_purchase_review_screenshot/update.rb +21 -0
  81. data/lib/app_store_dev_api/requests/v1/in_app_purchase_submission/create.rb +17 -0
  82. data/lib/app_store_dev_api/requests/v1/promoted_purchases/create.rb +20 -0
  83. data/lib/app_store_dev_api/requests/v1/promoted_purchases/update.rb +21 -0
  84. data/lib/app_store_dev_api/requests/v1/promoted_purchases_image/create.rb +20 -0
  85. data/lib/app_store_dev_api/requests/v1/promoted_purchases_image/update.rb +21 -0
  86. data/lib/app_store_dev_api/requests/v1/review_submission/.DS_Store +0 -0
  87. data/lib/app_store_dev_api/requests/v1/review_submission/create.rb +20 -0
  88. data/lib/app_store_dev_api/requests/v1/review_submission/update.rb +22 -0
  89. data/lib/app_store_dev_api/requests/v1/review_submission_item/.DS_Store +0 -0
  90. data/lib/app_store_dev_api/requests/v1/review_submission_item/create.rb +15 -0
  91. data/lib/app_store_dev_api/requests/v1/subscription/create.rb +25 -0
  92. data/lib/app_store_dev_api/requests/v1/subscription/update.rb +25 -0
  93. data/lib/app_store_dev_api/requests/v1/subscription_availability/.DS_Store +0 -0
  94. data/lib/app_store_dev_api/requests/v1/subscription_availability/create.rb +19 -0
  95. data/lib/app_store_dev_api/requests/v1/subscription_grace_period/.DS_Store +0 -0
  96. data/lib/app_store_dev_api/requests/v1/subscription_grace_period/update.rb +23 -0
  97. data/lib/app_store_dev_api/requests/v1/subscription_group/create.rb +20 -0
  98. data/lib/app_store_dev_api/requests/v1/subscription_group/update.rb +21 -0
  99. data/lib/app_store_dev_api/requests/v1/subscription_group_localization/create.rb +22 -0
  100. data/lib/app_store_dev_api/requests/v1/subscription_group_localization/update.rb +24 -0
  101. data/lib/app_store_dev_api/requests/v1/subscription_group_submission/.DS_Store +0 -0
  102. data/lib/app_store_dev_api/requests/v1/subscription_group_submission/create.rb +17 -0
  103. data/lib/app_store_dev_api/requests/v1/subscription_introductory_offer/create.rb +25 -0
  104. data/lib/app_store_dev_api/requests/v1/subscription_introductory_offer/update.rb +22 -0
  105. data/lib/app_store_dev_api/requests/v1/subscription_localization/create.rb +23 -0
  106. data/lib/app_store_dev_api/requests/v1/subscription_localization/update.rb +23 -0
  107. data/lib/app_store_dev_api/requests/v1/subscription_offer_code/create.rb +26 -0
  108. data/lib/app_store_dev_api/requests/v1/subscription_offer_code/update.rb +22 -0
  109. data/lib/app_store_dev_api/requests/v1/subscription_offer_code_cunstom_code/create.rb +23 -0
  110. data/lib/app_store_dev_api/requests/v1/subscription_offer_code_cunstom_code/update.rb +22 -0
  111. data/lib/app_store_dev_api/requests/v1/subscription_offer_code_one_time_use_code/create.rb +22 -0
  112. data/lib/app_store_dev_api/requests/v1/subscription_offer_code_one_time_use_code/update.rb +22 -0
  113. data/lib/app_store_dev_api/requests/v1/subscription_price/.DS_Store +0 -0
  114. data/lib/app_store_dev_api/requests/v1/subscription_price/create.rb +20 -0
  115. data/lib/app_store_dev_api/requests/v1/subscription_promotional_offer/create.rb +25 -0
  116. data/lib/app_store_dev_api/requests/v1/subscription_promotional_offer/update.rb +19 -0
  117. data/lib/app_store_dev_api/requests/v1/subscription_review_screenshot/create.rb +20 -0
  118. data/lib/app_store_dev_api/requests/v1/subscription_review_screenshot/update.rb +21 -0
  119. data/lib/app_store_dev_api/requests/v1/subscription_submission/.DS_Store +0 -0
  120. data/lib/app_store_dev_api/requests/v1/subscription_submission/create.rb +15 -0
  121. data/lib/app_store_dev_api/requests/v2/.DS_Store +0 -0
  122. data/lib/app_store_dev_api/requests/v2/in_app_purchase/create.rb +25 -0
  123. data/lib/app_store_dev_api/requests/v2/in_app_purchase/update.rb +23 -0
  124. data/lib/app_store_dev_api/requests/v2/sandbox_tester/.DS_Store +0 -0
  125. data/lib/app_store_dev_api/requests/v2/sandbox_tester/update.rb +22 -0
  126. data/lib/app_store_dev_api/requests/v2/sandbox_tester_clear_purchase_history/.DS_Store +0 -0
  127. data/lib/app_store_dev_api/requests/v2/sandbox_tester_clear_purchase_history/update.rb +16 -0
  128. data/lib/app_store_dev_api/schema/object.rb +14 -0
  129. data/lib/app_store_dev_api/schema/type.rb +15 -0
  130. data/lib/app_store_dev_api/schema/web_service_endpoint.rb +27 -0
  131. data/lib/app_store_dev_api/schema.rb +24 -0
  132. data/lib/app_store_dev_api/specification/component/schema.rb +25 -0
  133. data/lib/app_store_dev_api/specification.rb +54 -0
  134. data/lib/app_store_dev_api/user_invitation_create_request.rb +18 -0
  135. data/lib/app_store_dev_api/version.rb +5 -0
  136. data/lib/app_store_dev_api.rb +23 -0
  137. data/lib/config/schema.json +1650 -0
  138. data/lib/tasks/build.rake +8 -0
  139. data/lib/tasks/bundle.rake +7 -0
  140. data/lib/tasks/changelog.rake +17 -0
  141. data/lib/tasks/console.rake +9 -0
  142. data/lib/tasks/git.rake +19 -0
  143. data/lib/tasks/push.rake +18 -0
  144. data/lib/tasks/release.rake +17 -0
  145. data/lib/tasks/version.rake +28 -0
  146. data/sig/app_store_connect_api.rbs +4 -0
  147. 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
@@ -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
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreDevApi
4
+ module Requests
5
+ module V1
6
+ module SubscriptionSubmission
7
+ class Create < Request::Body
8
+ data do
9
+ type 'subscriptionSubmissions'
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -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
@@ -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
@@ -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,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreDevApi
4
+ class Schema
5
+ class Object
6
+ attr_reader :type, :properties
7
+
8
+ def initialize(options)
9
+ @type = options.fetch(:type)
10
+ @properties = options.fetch(:properties)
11
+ end
12
+ end
13
+ end
14
+ 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,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppStoreDevApi
4
+ VERSION = '0.1.0'
5
+ 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