shopify_api 13.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/BREAKING_CHANGES_FOR_V10.md +231 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile.lock +5 -5
  5. data/README.md +10 -34
  6. data/docs/README.md +0 -1
  7. data/docs/getting_started.md +20 -3
  8. data/docs/usage/custom_apps.md +75 -0
  9. data/docs/usage/graphql.md +63 -18
  10. data/docs/usage/oauth.md +160 -27
  11. data/docs/usage/rest.md +204 -62
  12. data/docs/usage/webhooks.md +22 -4
  13. data/lib/shopify_api/admin_versions.rb +2 -1
  14. data/lib/shopify_api/context.rb +5 -3
  15. data/lib/shopify_api/rest/base.rb +22 -14
  16. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
  17. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
  18. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
  19. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
  21. data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
  22. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
  23. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
  24. data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
  25. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
  26. data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
  27. data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
  28. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
  29. data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
  30. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
  31. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
  32. data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
  33. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
  34. data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
  35. data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
  36. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
  37. data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
  39. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
  40. data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
  41. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
  42. data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
  43. data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
  44. data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
  45. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
  46. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
  47. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
  48. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
  49. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
  50. data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
  51. data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
  52. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
  53. data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
  54. data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
  55. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
  56. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
  57. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
  58. data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
  59. data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
  60. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
  61. data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
  62. data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
  63. data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
  64. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
  65. data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
  66. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
  67. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
  68. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
  69. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
  70. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
  71. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
  72. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
  73. data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
  74. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
  75. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
  76. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
  77. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
  78. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
  79. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
  80. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
  81. data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
  82. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
  83. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
  84. data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
  85. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
  86. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
  87. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
  88. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
  89. data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
  90. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
  91. data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
  92. data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
  93. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
  94. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
  95. data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
  96. data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
  97. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
  98. data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
  99. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
  100. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
  101. data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
  102. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
  103. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
  104. data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
  105. data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
  106. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
  107. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
  108. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
  109. data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
  110. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
  111. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
  112. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
  113. data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
  114. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
  115. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
  116. data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
  117. data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
  118. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
  119. data/lib/shopify_api/version.rb +1 -1
  120. data/lib/shopify_api/webhooks/registration.rb +19 -4
  121. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
  122. data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
  123. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
  124. data/lib/shopify_api/webhooks/registry.rb +9 -5
  125. metadata +80 -6
  126. data/.github/workflows/stale.yml +0 -43
  127. data/docs/issues.md +0 -39
  128. data/docs/usage/session_storage.md +0 -46
@@ -0,0 +1,209 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class MarketingEvent < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @event_type = T.let(nil, T.nilable(String))
20
+ @marketing_channel = T.let(nil, T.nilable(String))
21
+ @paid = T.let(nil, T.nilable(T::Boolean))
22
+ @started_at = T.let(nil, T.nilable(String))
23
+ @UTM_parameters = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
24
+ @budget = T.let(nil, T.nilable(String))
25
+ @budget_type = T.let(nil, T.nilable(String))
26
+ @currency = T.let(nil, T.nilable(String))
27
+ @description = T.let(nil, T.nilable(String))
28
+ @ended_at = T.let(nil, T.nilable(String))
29
+ @id = T.let(nil, T.nilable(Integer))
30
+ @manage_url = T.let(nil, T.nilable(String))
31
+ @marketed_resources = T.let(nil, T.nilable(T::Array[T.untyped]))
32
+ @preview_url = T.let(nil, T.nilable(String))
33
+ @referring_domain = T.let(nil, T.nilable(String))
34
+ @remote_id = T.let(nil, T.nilable(String))
35
+ @scheduled_to_end_at = T.let(nil, T.nilable(String))
36
+ end
37
+
38
+ @has_one = T.let({}, T::Hash[Symbol, Class])
39
+ @has_many = T.let({}, T::Hash[Symbol, Class])
40
+ @paths = T.let([
41
+ {http_method: :delete, operation: :delete, ids: [:id], path: "marketing_events/<id>.json"},
42
+ {http_method: :get, operation: :count, ids: [], path: "marketing_events/count.json"},
43
+ {http_method: :get, operation: :get, ids: [], path: "marketing_events.json"},
44
+ {http_method: :get, operation: :get, ids: [:id], path: "marketing_events/<id>.json"},
45
+ {http_method: :post, operation: :engagements, ids: [:id], path: "marketing_events/<id>/engagements.json"},
46
+ {http_method: :post, operation: :post, ids: [], path: "marketing_events.json"},
47
+ {http_method: :put, operation: :put, ids: [:id], path: "marketing_events/<id>.json"}
48
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
49
+
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :event_type
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :marketing_channel
54
+ sig { returns(T.nilable(T::Boolean)) }
55
+ attr_reader :paid
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :started_at
58
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
59
+ attr_reader :UTM_parameters
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :budget
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :budget_type
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :currency
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :description
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :ended_at
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_reader :id
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :manage_url
74
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
75
+ attr_reader :marketed_resources
76
+ sig { returns(T.nilable(String)) }
77
+ attr_reader :preview_url
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :referring_domain
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :remote_id
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :scheduled_to_end_at
84
+
85
+ class << self
86
+ sig do
87
+ params(
88
+ id: T.any(Integer, String),
89
+ session: Auth::Session
90
+ ).returns(T.nilable(MarketingEvent))
91
+ end
92
+ def find(
93
+ id:,
94
+ session: ShopifyAPI::Context.active_session
95
+ )
96
+ result = base_find(
97
+ session: session,
98
+ ids: {id: id},
99
+ params: {},
100
+ )
101
+ T.cast(result[0], T.nilable(MarketingEvent))
102
+ end
103
+
104
+ sig do
105
+ params(
106
+ id: T.any(Integer, String),
107
+ session: Auth::Session
108
+ ).returns(T.untyped)
109
+ end
110
+ def delete(
111
+ id:,
112
+ session: ShopifyAPI::Context.active_session
113
+ )
114
+ request(
115
+ http_method: :delete,
116
+ operation: :delete,
117
+ session: session,
118
+ ids: {id: id},
119
+ params: {},
120
+ )
121
+ end
122
+
123
+ sig do
124
+ params(
125
+ limit: T.untyped,
126
+ offset: T.untyped,
127
+ session: Auth::Session,
128
+ kwargs: T.untyped
129
+ ).returns(T::Array[MarketingEvent])
130
+ end
131
+ def all(
132
+ limit: nil,
133
+ offset: nil,
134
+ session: ShopifyAPI::Context.active_session,
135
+ **kwargs
136
+ )
137
+ response = base_find(
138
+ session: session,
139
+ ids: {},
140
+ params: {limit: limit, offset: offset}.merge(kwargs).compact,
141
+ )
142
+
143
+ T.cast(response, T::Array[MarketingEvent])
144
+ end
145
+
146
+ sig do
147
+ params(
148
+ session: Auth::Session,
149
+ kwargs: T.untyped
150
+ ).returns(T.untyped)
151
+ end
152
+ def count(
153
+ session: ShopifyAPI::Context.active_session,
154
+ **kwargs
155
+ )
156
+ request(
157
+ http_method: :get,
158
+ operation: :count,
159
+ session: session,
160
+ ids: {},
161
+ params: {}.merge(kwargs).compact,
162
+ body: {},
163
+ entity: nil,
164
+ )
165
+ end
166
+
167
+ end
168
+
169
+ sig do
170
+ params(
171
+ occurred_on: T.untyped,
172
+ impressions_count: T.untyped,
173
+ views_count: T.untyped,
174
+ clicks_count: T.untyped,
175
+ shares_count: T.untyped,
176
+ favorites_count: T.untyped,
177
+ comments_count: T.untyped,
178
+ ad_spend: T.untyped,
179
+ is_cumulative: T.untyped,
180
+ body: T.untyped,
181
+ kwargs: T.untyped
182
+ ).returns(T.untyped)
183
+ end
184
+ def engagements(
185
+ occurred_on: nil,
186
+ impressions_count: nil,
187
+ views_count: nil,
188
+ clicks_count: nil,
189
+ shares_count: nil,
190
+ favorites_count: nil,
191
+ comments_count: nil,
192
+ ad_spend: nil,
193
+ is_cumulative: nil,
194
+ body: nil,
195
+ **kwargs
196
+ )
197
+ self.class.request(
198
+ http_method: :post,
199
+ operation: :engagements,
200
+ session: @session,
201
+ ids: {id: @id},
202
+ params: {occurred_on: occurred_on, impressions_count: impressions_count, views_count: views_count, clicks_count: clicks_count, shares_count: shares_count, favorites_count: favorites_count, comments_count: comments_count, ad_spend: ad_spend, is_cumulative: is_cumulative}.merge(kwargs).compact,
203
+ body: body,
204
+ entity: self,
205
+ )
206
+ end
207
+
208
+ end
209
+ end
@@ -0,0 +1,344 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Metafield < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @key = T.let(nil, T.nilable(String))
20
+ @namespace = T.let(nil, T.nilable(String))
21
+ @value = T.let(nil, T.nilable(T.any(String, Integer, Float, T::Boolean, String)))
22
+ @article_id = T.let(nil, T.nilable(Integer))
23
+ @blog_id = T.let(nil, T.nilable(Integer))
24
+ @collection_id = T.let(nil, T.nilable(Integer))
25
+ @created_at = T.let(nil, T.nilable(String))
26
+ @customer_id = T.let(nil, T.nilable(Integer))
27
+ @description = T.let(nil, T.nilable(String))
28
+ @draft_order_id = T.let(nil, T.nilable(Integer))
29
+ @id = T.let(nil, T.nilable(Integer))
30
+ @order_id = T.let(nil, T.nilable(Integer))
31
+ @owner_id = T.let(nil, T.nilable(Integer))
32
+ @owner_resource = T.let(nil, T.nilable(String))
33
+ @page_id = T.let(nil, T.nilable(Integer))
34
+ @product_id = T.let(nil, T.nilable(Integer))
35
+ @product_image_id = T.let(nil, T.nilable(Integer))
36
+ @type = T.let(nil, T.nilable(String))
37
+ @updated_at = T.let(nil, T.nilable(String))
38
+ @variant_id = T.let(nil, T.nilable(Integer))
39
+ end
40
+
41
+ @has_one = T.let({}, T::Hash[Symbol, Class])
42
+ @has_many = T.let({}, T::Hash[Symbol, Class])
43
+ @paths = T.let([
44
+ {http_method: :delete, operation: :delete, ids: [:article_id, :id], path: "articles/<article_id>/metafields/<id>.json"},
45
+ {http_method: :delete, operation: :delete, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
46
+ {http_method: :delete, operation: :delete, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
47
+ {http_method: :delete, operation: :delete, ids: [:collection_id, :id], path: "collections/<collection_id>/metafields/<id>.json"},
48
+ {http_method: :delete, operation: :delete, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
49
+ {http_method: :delete, operation: :delete, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
50
+ {http_method: :delete, operation: :delete, ids: [:id], path: "metafields/<id>.json"},
51
+ {http_method: :delete, operation: :delete, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
52
+ {http_method: :delete, operation: :delete, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
53
+ {http_method: :delete, operation: :delete, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
54
+ {http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
55
+ {http_method: :delete, operation: :delete, ids: [:variant_id, :id], path: "variants/<variant_id>/metafields/<id>.json"},
56
+ {http_method: :get, operation: :count, ids: [:article_id], path: "articles/<article_id>/metafields/count.json"},
57
+ {http_method: :get, operation: :count, ids: [:blog_id], path: "blogs/<blog_id>/metafields/count.json"},
58
+ {http_method: :get, operation: :count, ids: [:blog_id], path: "blogs/<blog_id>/metafields/count.json"},
59
+ {http_method: :get, operation: :count, ids: [:collection_id], path: "collections/<collection_id>/metafields/count.json"},
60
+ {http_method: :get, operation: :count, ids: [:customer_id], path: "customers/<customer_id>/metafields/count.json"},
61
+ {http_method: :get, operation: :count, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields/count.json"},
62
+ {http_method: :get, operation: :count, ids: [], path: "metafields/count.json"},
63
+ {http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/metafields/count.json"},
64
+ {http_method: :get, operation: :count, ids: [:page_id], path: "pages/<page_id>/metafields/count.json"},
65
+ {http_method: :get, operation: :count, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields/count.json"},
66
+ {http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/metafields/count.json"},
67
+ {http_method: :get, operation: :count, ids: [:variant_id], path: "variants/<variant_id>/metafields/count.json"},
68
+ {http_method: :get, operation: :get, ids: [:article_id], path: "articles/<article_id>/metafields.json"},
69
+ {http_method: :get, operation: :get, ids: [:article_id, :id], path: "articles/<article_id>/metafields/<id>.json"},
70
+ {http_method: :get, operation: :get, ids: [:blog_id], path: "blogs/<blog_id>/metafields.json"},
71
+ {http_method: :get, operation: :get, ids: [:blog_id], path: "blogs/<blog_id>/metafields.json"},
72
+ {http_method: :get, operation: :get, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
73
+ {http_method: :get, operation: :get, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
74
+ {http_method: :get, operation: :get, ids: [:collection_id], path: "collections/<collection_id>/metafields.json"},
75
+ {http_method: :get, operation: :get, ids: [:collection_id, :id], path: "collections/<collection_id>/metafields/<id>.json"},
76
+ {http_method: :get, operation: :get, ids: [:customer_id], path: "customers/<customer_id>/metafields.json"},
77
+ {http_method: :get, operation: :get, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
78
+ {http_method: :get, operation: :get, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
79
+ {http_method: :get, operation: :get, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
80
+ {http_method: :get, operation: :get, ids: [], path: "metafields.json"},
81
+ {http_method: :get, operation: :get, ids: [:id], path: "metafields/<id>.json"},
82
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
83
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
84
+ {http_method: :get, operation: :get, ids: [:page_id], path: "pages/<page_id>/metafields.json"},
85
+ {http_method: :get, operation: :get, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
86
+ {http_method: :get, operation: :get, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
87
+ {http_method: :get, operation: :get, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
88
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/metafields.json"},
89
+ {http_method: :get, operation: :get, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
90
+ {http_method: :get, operation: :get, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
91
+ {http_method: :get, operation: :get, ids: [:variant_id, :id], path: "variants/<variant_id>/metafields/<id>.json"},
92
+ {http_method: :post, operation: :post, ids: [:article_id], path: "articles/<article_id>/metafields.json"},
93
+ {http_method: :post, operation: :post, ids: [:blog_id], path: "blogs/<blog_id>/metafields.json"},
94
+ {http_method: :post, operation: :post, ids: [:blog_id], path: "blogs/<blog_id>/metafields.json"},
95
+ {http_method: :post, operation: :post, ids: [:collection_id], path: "collections/<collection_id>/metafields.json"},
96
+ {http_method: :post, operation: :post, ids: [:customer_id], path: "customers/<customer_id>/metafields.json"},
97
+ {http_method: :post, operation: :post, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
98
+ {http_method: :post, operation: :post, ids: [], path: "metafields.json"},
99
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
100
+ {http_method: :post, operation: :post, ids: [:page_id], path: "pages/<page_id>/metafields.json"},
101
+ {http_method: :post, operation: :post, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
102
+ {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/metafields.json"},
103
+ {http_method: :post, operation: :post, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
104
+ {http_method: :put, operation: :put, ids: [:article_id, :id], path: "articles/<article_id>/metafields/<id>.json"},
105
+ {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
106
+ {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
107
+ {http_method: :put, operation: :put, ids: [:collection_id, :id], path: "collections/<collection_id>/metafields/<id>.json"},
108
+ {http_method: :put, operation: :put, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
109
+ {http_method: :put, operation: :put, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
110
+ {http_method: :put, operation: :put, ids: [:id], path: "metafields/<id>.json"},
111
+ {http_method: :put, operation: :put, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
112
+ {http_method: :put, operation: :put, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
113
+ {http_method: :put, operation: :put, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
114
+ {http_method: :put, operation: :put, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
115
+ {http_method: :put, operation: :put, ids: [:variant_id, :id], path: "variants/<variant_id>/metafields/<id>.json"}
116
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
117
+
118
+ sig { returns(T.nilable(String)) }
119
+ attr_reader :key
120
+ sig { returns(T.nilable(String)) }
121
+ attr_reader :namespace
122
+ sig { returns(T.nilable(T.any(String, Integer, Float, T::Boolean, String))) }
123
+ attr_reader :value
124
+ sig { returns(T.nilable(Integer)) }
125
+ attr_reader :article_id
126
+ sig { returns(T.nilable(Integer)) }
127
+ attr_reader :blog_id
128
+ sig { returns(T.nilable(Integer)) }
129
+ attr_reader :collection_id
130
+ sig { returns(T.nilable(String)) }
131
+ attr_reader :created_at
132
+ sig { returns(T.nilable(Integer)) }
133
+ attr_reader :customer_id
134
+ sig { returns(T.nilable(String)) }
135
+ attr_reader :description
136
+ sig { returns(T.nilable(Integer)) }
137
+ attr_reader :draft_order_id
138
+ sig { returns(T.nilable(Integer)) }
139
+ attr_reader :id
140
+ sig { returns(T.nilable(Integer)) }
141
+ attr_reader :order_id
142
+ sig { returns(T.nilable(Integer)) }
143
+ attr_reader :owner_id
144
+ sig { returns(T.nilable(String)) }
145
+ attr_reader :owner_resource
146
+ sig { returns(T.nilable(Integer)) }
147
+ attr_reader :page_id
148
+ sig { returns(T.nilable(Integer)) }
149
+ attr_reader :product_id
150
+ sig { returns(T.nilable(Integer)) }
151
+ attr_reader :product_image_id
152
+ sig { returns(T.nilable(String)) }
153
+ attr_reader :type
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :updated_at
156
+ sig { returns(T.nilable(Integer)) }
157
+ attr_reader :variant_id
158
+
159
+ class << self
160
+ sig do
161
+ params(
162
+ id: T.any(Integer, String),
163
+ article_id: T.nilable(T.any(Integer, String)),
164
+ blog_id: T.nilable(T.any(Integer, String)),
165
+ collection_id: T.nilable(T.any(Integer, String)),
166
+ customer_id: T.nilable(T.any(Integer, String)),
167
+ draft_order_id: T.nilable(T.any(Integer, String)),
168
+ order_id: T.nilable(T.any(Integer, String)),
169
+ page_id: T.nilable(T.any(Integer, String)),
170
+ product_image_id: T.nilable(T.any(Integer, String)),
171
+ product_id: T.nilable(T.any(Integer, String)),
172
+ variant_id: T.nilable(T.any(Integer, String)),
173
+ fields: T.untyped,
174
+ session: Auth::Session
175
+ ).returns(T.nilable(Metafield))
176
+ end
177
+ def find(
178
+ id:,
179
+ article_id: nil,
180
+ blog_id: nil,
181
+ collection_id: nil,
182
+ customer_id: nil,
183
+ draft_order_id: nil,
184
+ order_id: nil,
185
+ page_id: nil,
186
+ product_image_id: nil,
187
+ product_id: nil,
188
+ variant_id: nil,
189
+ fields: nil,
190
+ session: ShopifyAPI::Context.active_session
191
+ )
192
+ result = base_find(
193
+ session: session,
194
+ ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
195
+ params: {fields: fields},
196
+ )
197
+ T.cast(result[0], T.nilable(Metafield))
198
+ end
199
+
200
+ sig do
201
+ params(
202
+ id: T.any(Integer, String),
203
+ article_id: T.nilable(T.any(Integer, String)),
204
+ blog_id: T.nilable(T.any(Integer, String)),
205
+ collection_id: T.nilable(T.any(Integer, String)),
206
+ customer_id: T.nilable(T.any(Integer, String)),
207
+ draft_order_id: T.nilable(T.any(Integer, String)),
208
+ order_id: T.nilable(T.any(Integer, String)),
209
+ page_id: T.nilable(T.any(Integer, String)),
210
+ product_image_id: T.nilable(T.any(Integer, String)),
211
+ product_id: T.nilable(T.any(Integer, String)),
212
+ variant_id: T.nilable(T.any(Integer, String)),
213
+ session: Auth::Session
214
+ ).returns(T.untyped)
215
+ end
216
+ def delete(
217
+ id:,
218
+ article_id: nil,
219
+ blog_id: nil,
220
+ collection_id: nil,
221
+ customer_id: nil,
222
+ draft_order_id: nil,
223
+ order_id: nil,
224
+ page_id: nil,
225
+ product_image_id: nil,
226
+ product_id: nil,
227
+ variant_id: nil,
228
+ session: ShopifyAPI::Context.active_session
229
+ )
230
+ request(
231
+ http_method: :delete,
232
+ operation: :delete,
233
+ session: session,
234
+ ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
235
+ params: {},
236
+ )
237
+ end
238
+
239
+ sig do
240
+ params(
241
+ article_id: T.nilable(T.any(Integer, String)),
242
+ blog_id: T.nilable(T.any(Integer, String)),
243
+ collection_id: T.nilable(T.any(Integer, String)),
244
+ customer_id: T.nilable(T.any(Integer, String)),
245
+ draft_order_id: T.nilable(T.any(Integer, String)),
246
+ order_id: T.nilable(T.any(Integer, String)),
247
+ page_id: T.nilable(T.any(Integer, String)),
248
+ product_image_id: T.nilable(T.any(Integer, String)),
249
+ product_id: T.nilable(T.any(Integer, String)),
250
+ variant_id: T.nilable(T.any(Integer, String)),
251
+ limit: T.untyped,
252
+ since_id: T.untyped,
253
+ created_at_min: T.untyped,
254
+ created_at_max: T.untyped,
255
+ updated_at_min: T.untyped,
256
+ updated_at_max: T.untyped,
257
+ namespace: T.untyped,
258
+ key: T.untyped,
259
+ type: T.untyped,
260
+ fields: T.untyped,
261
+ metafield: T.nilable(T::Hash[T.untyped, T.untyped]),
262
+ session: Auth::Session,
263
+ kwargs: T.untyped
264
+ ).returns(T::Array[Metafield])
265
+ end
266
+ def all(
267
+ article_id: nil,
268
+ blog_id: nil,
269
+ collection_id: nil,
270
+ customer_id: nil,
271
+ draft_order_id: nil,
272
+ order_id: nil,
273
+ page_id: nil,
274
+ product_image_id: nil,
275
+ product_id: nil,
276
+ variant_id: nil,
277
+ limit: nil,
278
+ since_id: nil,
279
+ created_at_min: nil,
280
+ created_at_max: nil,
281
+ updated_at_min: nil,
282
+ updated_at_max: nil,
283
+ namespace: nil,
284
+ key: nil,
285
+ type: nil,
286
+ fields: nil,
287
+ metafield: nil,
288
+ session: ShopifyAPI::Context.active_session,
289
+ **kwargs
290
+ )
291
+ response = base_find(
292
+ session: session,
293
+ ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
294
+ params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, namespace: namespace, key: key, type: type, fields: fields, metafield: metafield}.merge(kwargs).compact,
295
+ )
296
+
297
+ T.cast(response, T::Array[Metafield])
298
+ end
299
+
300
+ sig do
301
+ params(
302
+ article_id: T.nilable(T.any(Integer, String)),
303
+ blog_id: T.nilable(T.any(Integer, String)),
304
+ collection_id: T.nilable(T.any(Integer, String)),
305
+ customer_id: T.nilable(T.any(Integer, String)),
306
+ draft_order_id: T.nilable(T.any(Integer, String)),
307
+ order_id: T.nilable(T.any(Integer, String)),
308
+ page_id: T.nilable(T.any(Integer, String)),
309
+ product_image_id: T.nilable(T.any(Integer, String)),
310
+ product_id: T.nilable(T.any(Integer, String)),
311
+ variant_id: T.nilable(T.any(Integer, String)),
312
+ session: Auth::Session,
313
+ kwargs: T.untyped
314
+ ).returns(T.untyped)
315
+ end
316
+ def count(
317
+ article_id: nil,
318
+ blog_id: nil,
319
+ collection_id: nil,
320
+ customer_id: nil,
321
+ draft_order_id: nil,
322
+ order_id: nil,
323
+ page_id: nil,
324
+ product_image_id: nil,
325
+ product_id: nil,
326
+ variant_id: nil,
327
+ session: ShopifyAPI::Context.active_session,
328
+ **kwargs
329
+ )
330
+ request(
331
+ http_method: :get,
332
+ operation: :count,
333
+ session: session,
334
+ ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
335
+ params: {}.merge(kwargs).compact,
336
+ body: {},
337
+ entity: nil,
338
+ )
339
+ end
340
+
341
+ end
342
+
343
+ end
344
+ end
@@ -0,0 +1,110 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class MobilePlatformApplication < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @application_id = T.let(nil, T.nilable(String))
20
+ @enabled_shared_webcredentials = T.let(nil, T.nilable(T::Boolean))
21
+ @enabled_universal_or_app_links = T.let(nil, T.nilable(T::Boolean))
22
+ @id = T.let(nil, T.nilable(Integer))
23
+ @platform = T.let(nil, T.nilable(String))
24
+ @sha256_cert_fingerprints = T.let(nil, T.nilable(T::Array[T.untyped]))
25
+ end
26
+
27
+ @has_one = T.let({}, T::Hash[Symbol, Class])
28
+ @has_many = T.let({}, T::Hash[Symbol, Class])
29
+ @paths = T.let([
30
+ {http_method: :delete, operation: :delete, ids: [:id], path: "mobile_platform_applications/<id>.json"},
31
+ {http_method: :get, operation: :get, ids: [], path: "mobile_platform_applications.json"},
32
+ {http_method: :get, operation: :get, ids: [:id], path: "mobile_platform_applications/<id>.json"},
33
+ {http_method: :post, operation: :post, ids: [], path: "mobile_platform_applications.json"},
34
+ {http_method: :put, operation: :put, ids: [:id], path: "mobile_platform_applications/<id>.json"}
35
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
36
+
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :application_id
39
+ sig { returns(T.nilable(T::Boolean)) }
40
+ attr_reader :enabled_shared_webcredentials
41
+ sig { returns(T.nilable(T::Boolean)) }
42
+ attr_reader :enabled_universal_or_app_links
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :id
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :platform
47
+ sig { returns(T.nilable(T::Array[String])) }
48
+ attr_reader :sha256_cert_fingerprints
49
+
50
+ class << self
51
+ sig do
52
+ params(
53
+ id: T.any(Integer, String),
54
+ session: Auth::Session
55
+ ).returns(T.nilable(MobilePlatformApplication))
56
+ end
57
+ def find(
58
+ id:,
59
+ session: ShopifyAPI::Context.active_session
60
+ )
61
+ result = base_find(
62
+ session: session,
63
+ ids: {id: id},
64
+ params: {},
65
+ )
66
+ T.cast(result[0], T.nilable(MobilePlatformApplication))
67
+ end
68
+
69
+ sig do
70
+ params(
71
+ id: T.any(Integer, String),
72
+ session: Auth::Session
73
+ ).returns(T.untyped)
74
+ end
75
+ def delete(
76
+ id:,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ request(
80
+ http_method: :delete,
81
+ operation: :delete,
82
+ session: session,
83
+ ids: {id: id},
84
+ params: {},
85
+ )
86
+ end
87
+
88
+ sig do
89
+ params(
90
+ session: Auth::Session,
91
+ kwargs: T.untyped
92
+ ).returns(T::Array[MobilePlatformApplication])
93
+ end
94
+ def all(
95
+ session: ShopifyAPI::Context.active_session,
96
+ **kwargs
97
+ )
98
+ response = base_find(
99
+ session: session,
100
+ ids: {},
101
+ params: {}.merge(kwargs).compact,
102
+ )
103
+
104
+ T.cast(response, T::Array[MobilePlatformApplication])
105
+ end
106
+
107
+ end
108
+
109
+ end
110
+ end