shopify_api 12.4.0 → 12.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/.github/api_update_reminder.md +25 -0
  3. data/.github/api_update_reminder_on_release.md +19 -0
  4. data/.github/workflows/api_update_reminder.yml +16 -0
  5. data/.github/workflows/api_update_reminder_on_release.yml +16 -0
  6. data/.github/workflows/stale.yml +20 -10
  7. data/CHANGELOG.md +11 -4
  8. data/CONTRIBUTING.md +2 -2
  9. data/Gemfile.lock +6 -6
  10. data/README.md +10 -10
  11. data/docs/getting_started.md +2 -2
  12. data/docs/usage/graphql.md +6 -0
  13. data/docs/usage/graphql_storefront.md +8 -2
  14. data/docs/usage/oauth.md +1 -1
  15. data/docs/usage/rest.md +9 -2
  16. data/docs/usage/webhooks.md +1 -1
  17. data/lib/shopify_api/admin_versions.rb +2 -1
  18. data/lib/shopify_api/clients/graphql/admin.rb +3 -3
  19. data/lib/shopify_api/clients/graphql/client.rb +13 -3
  20. data/lib/shopify_api/clients/graphql/storefront.rb +3 -3
  21. data/lib/shopify_api/clients/http_client.rb +8 -1
  22. data/lib/shopify_api/clients/rest/admin.rb +14 -3
  23. data/lib/shopify_api/rest/base.rb +3 -1
  24. data/lib/shopify_api/rest/resources/2022_07/application_charge.rb +6 -1
  25. data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +6 -1
  26. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +4 -4
  27. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +2 -2
  28. data/lib/shopify_api/rest/resources/2022_07/order.rb +2 -2
  29. data/lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb +6 -1
  30. data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +6 -6
  31. data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +6 -1
  32. data/lib/shopify_api/rest/resources/2022_10/application_charge.rb +6 -1
  33. data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +6 -1
  34. data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +4 -4
  35. data/lib/shopify_api/rest/resources/2022_10/metafield.rb +2 -2
  36. data/lib/shopify_api/rest/resources/2022_10/order.rb +2 -2
  37. data/lib/shopify_api/rest/resources/2022_10/recurring_application_charge.rb +6 -1
  38. data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +6 -6
  39. data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +6 -1
  40. data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +6 -1
  41. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +6 -1
  42. data/lib/shopify_api/rest/resources/2023_01/dispute_evidence.rb +117 -0
  43. data/lib/shopify_api/rest/resources/{2022_04/storefront_access_token.rb → 2023_01/dispute_file_upload.rb} +27 -33
  44. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +4 -4
  45. data/lib/shopify_api/rest/resources/2023_01/metafield.rb +2 -2
  46. data/lib/shopify_api/rest/resources/2023_01/order.rb +2 -2
  47. data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +6 -1
  48. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +6 -6
  49. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +6 -1
  50. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/application_charge.rb +6 -1
  51. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/application_credit.rb +6 -1
  52. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/carrier_service.rb +0 -3
  53. data/lib/shopify_api/rest/resources/2023_04/dispute_evidence.rb +117 -0
  54. data/lib/shopify_api/rest/resources/{2022_04/android_pay_key.rb → 2023_04/dispute_file_upload.rb} +29 -25
  55. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/fulfillment.rb +2 -49
  56. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/fulfillment_order.rb +36 -8
  57. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/fulfillment_service.rb +3 -3
  58. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/gift_card.rb +4 -4
  59. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/metafield.rb +2 -2
  60. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/order.rb +14 -2
  61. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/recurring_application_charge.rb +6 -1
  62. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/shipping_zone.rb +6 -6
  63. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/shop.rb +3 -0
  64. data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/transaction.rb +3 -0
  65. data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/usage_charge.rb +6 -1
  66. data/lib/shopify_api/version.rb +1 -1
  67. data/shopify_api.gemspec +1 -1
  68. metadata +85 -152
  69. data/lib/shopify_api/rest/resources/2022_01/android_pay_key.rb +0 -77
  70. data/lib/shopify_api/rest/resources/2022_01/customer.rb +0 -326
  71. data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +0 -281
  72. data/lib/shopify_api/rest/resources/2022_01/fulfillment_service.rb +0 -130
  73. data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +0 -215
  74. data/lib/shopify_api/rest/resources/2022_01/metafield.rb +0 -349
  75. data/lib/shopify_api/rest/resources/2022_01/order.rb +0 -473
  76. data/lib/shopify_api/rest/resources/2022_01/price_rule.rb +0 -223
  77. data/lib/shopify_api/rest/resources/2022_01/usage_charge.rb +0 -97
  78. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +0 -190
  79. data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +0 -58
  80. data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +0 -105
  81. data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +0 -104
  82. data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +0 -87
  83. data/lib/shopify_api/rest/resources/2022_04/article.rb +0 -265
  84. data/lib/shopify_api/rest/resources/2022_04/asset.rb +0 -118
  85. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +0 -86
  86. data/lib/shopify_api/rest/resources/2022_04/balance.rb +0 -50
  87. data/lib/shopify_api/rest/resources/2022_04/blog.rb +0 -162
  88. data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +0 -83
  89. data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +0 -116
  90. data/lib/shopify_api/rest/resources/2022_04/checkout.rb +0 -209
  91. data/lib/shopify_api/rest/resources/2022_04/collect.rb +0 -142
  92. data/lib/shopify_api/rest/resources/2022_04/collection.rb +0 -110
  93. data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +0 -155
  94. data/lib/shopify_api/rest/resources/2022_04/comment.rb +0 -283
  95. data/lib/shopify_api/rest/resources/2022_04/country.rb +0 -137
  96. data/lib/shopify_api/rest/resources/2022_04/currency.rb +0 -57
  97. data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +0 -187
  98. data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +0 -201
  99. data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +0 -169
  100. data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +0 -57
  101. data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +0 -219
  102. data/lib/shopify_api/rest/resources/2022_04/dispute.rb +0 -111
  103. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +0 -275
  104. data/lib/shopify_api/rest/resources/2022_04/event.rb +0 -148
  105. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +0 -272
  106. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +0 -166
  107. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +0 -87
  108. data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +0 -118
  109. data/lib/shopify_api/rest/resources/2022_04/image.rb +0 -157
  110. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +0 -108
  111. data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +0 -179
  112. data/lib/shopify_api/rest/resources/2022_04/location.rb +0 -167
  113. data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +0 -56
  114. data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +0 -209
  115. data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +0 -110
  116. data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +0 -135
  117. data/lib/shopify_api/rest/resources/2022_04/page.rb +0 -194
  118. data/lib/shopify_api/rest/resources/2022_04/payment.rb +0 -140
  119. data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +0 -143
  120. data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +0 -107
  121. data/lib/shopify_api/rest/resources/2022_04/payout.rb +0 -97
  122. data/lib/shopify_api/rest/resources/2022_04/policy.rb +0 -69
  123. data/lib/shopify_api/rest/resources/2022_04/product.rb +0 -223
  124. data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +0 -196
  125. data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +0 -88
  126. data/lib/shopify_api/rest/resources/2022_04/province.rb +0 -132
  127. data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +0 -167
  128. data/lib/shopify_api/rest/resources/2022_04/redirect.rb +0 -139
  129. data/lib/shopify_api/rest/resources/2022_04/refund.rb +0 -151
  130. data/lib/shopify_api/rest/resources/2022_04/report.rb +0 -121
  131. data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +0 -73
  132. data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +0 -155
  133. data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +0 -83
  134. data/lib/shopify_api/rest/resources/2022_04/shop.rb +0 -218
  135. data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +0 -216
  136. data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +0 -93
  137. data/lib/shopify_api/rest/resources/2022_04/theme.rb +0 -120
  138. data/lib/shopify_api/rest/resources/2022_04/transaction.rb +0 -181
  139. data/lib/shopify_api/rest/resources/2022_04/user.rb +0 -138
  140. data/lib/shopify_api/rest/resources/2022_04/variant.rb +0 -212
  141. data/lib/shopify_api/rest/resources/2022_04/webhook.rb +0 -168
  142. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/abandoned_checkout.rb +0 -0
  143. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/access_scope.rb +0 -0
  144. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/apple_pay_certificate.rb +0 -0
  145. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/article.rb +0 -0
  146. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/asset.rb +0 -0
  147. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/assigned_fulfillment_order.rb +0 -0
  148. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/balance.rb +0 -0
  149. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/blog.rb +0 -0
  150. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/cancellation_request.rb +0 -0
  151. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/checkout.rb +0 -0
  152. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/collect.rb +0 -0
  153. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/collection.rb +0 -0
  154. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/collection_listing.rb +0 -0
  155. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/comment.rb +0 -0
  156. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/country.rb +0 -0
  157. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/currency.rb +0 -0
  158. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/custom_collection.rb +0 -0
  159. /data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/customer.rb +0 -0
  160. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/customer_address.rb +0 -0
  161. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/customer_saved_search.rb +0 -0
  162. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/deprecated_api_call.rb +0 -0
  163. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/discount_code.rb +0 -0
  164. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/dispute.rb +0 -0
  165. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/draft_order.rb +0 -0
  166. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/event.rb +0 -0
  167. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/fulfillment_event.rb +0 -0
  168. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/fulfillment_request.rb +0 -0
  169. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/gift_card_adjustment.rb +0 -0
  170. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/image.rb +0 -0
  171. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/inventory_item.rb +0 -0
  172. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/inventory_level.rb +0 -0
  173. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/location.rb +0 -0
  174. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/locations_for_move.rb +0 -0
  175. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/marketing_event.rb +0 -0
  176. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/mobile_platform_application.rb +0 -0
  177. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/order_risk.rb +0 -0
  178. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/page.rb +0 -0
  179. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/payment.rb +0 -0
  180. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/payment_gateway.rb +0 -0
  181. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/payment_transaction.rb +0 -0
  182. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/payout.rb +0 -0
  183. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/policy.rb +0 -0
  184. /data/lib/shopify_api/rest/resources/{2022_04 → 2023_04}/price_rule.rb +0 -0
  185. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/product.rb +0 -0
  186. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/product_listing.rb +0 -0
  187. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/product_resource_feedback.rb +0 -0
  188. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/province.rb +0 -0
  189. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/redirect.rb +0 -0
  190. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/refund.rb +0 -0
  191. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/report.rb +0 -0
  192. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/resource_feedback.rb +0 -0
  193. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/script_tag.rb +0 -0
  194. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/smart_collection.rb +0 -0
  195. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/storefront_access_token.rb +0 -0
  196. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/tender_transaction.rb +0 -0
  197. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/theme.rb +0 -0
  198. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/user.rb +0 -0
  199. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/variant.rb +0 -0
  200. /data/lib/shopify_api/rest/resources/{2022_01 → 2023_04}/webhook.rb +0 -0
@@ -1,118 +0,0 @@
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 GiftCardAdjustment < 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
- @amount = T.let(nil, T.nilable(Float))
20
- @api_client_id = T.let(nil, T.nilable(Integer))
21
- @created_at = T.let(nil, T.nilable(String))
22
- @gift_card_id = T.let(nil, T.nilable(Integer))
23
- @id = T.let(nil, T.nilable(Integer))
24
- @note = T.let(nil, T.nilable(String))
25
- @number = T.let(nil, T.nilable(Integer))
26
- @order_transaction_id = T.let(nil, T.nilable(Integer))
27
- @processed_at = T.let(nil, T.nilable(String))
28
- @remote_transaction_ref = T.let(nil, T.nilable(String))
29
- @remote_transaction_url = T.let(nil, T.nilable(String))
30
- @user_id = T.let(nil, T.nilable(Integer))
31
- end
32
-
33
- @has_one = T.let({}, T::Hash[Symbol, Class])
34
- @has_many = T.let({}, T::Hash[Symbol, Class])
35
- @paths = T.let([
36
- {http_method: :get, operation: :get, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"},
37
- {http_method: :get, operation: :get, ids: [:gift_card_id, :id], path: "gift_cards/<gift_card_id>/adjustments/<id>.json"},
38
- {http_method: :post, operation: :post, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"}
39
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
40
-
41
- sig { returns(T.nilable(Float)) }
42
- attr_reader :amount
43
- sig { returns(T.nilable(Integer)) }
44
- attr_reader :api_client_id
45
- sig { returns(T.nilable(String)) }
46
- attr_reader :created_at
47
- sig { returns(T.nilable(Integer)) }
48
- attr_reader :gift_card_id
49
- sig { returns(T.nilable(Integer)) }
50
- attr_reader :id
51
- sig { returns(T.nilable(String)) }
52
- attr_reader :note
53
- sig { returns(T.nilable(Integer)) }
54
- attr_reader :number
55
- sig { returns(T.nilable(Integer)) }
56
- attr_reader :order_transaction_id
57
- sig { returns(T.nilable(String)) }
58
- attr_reader :processed_at
59
- sig { returns(T.nilable(String)) }
60
- attr_reader :remote_transaction_ref
61
- sig { returns(T.nilable(String)) }
62
- attr_reader :remote_transaction_url
63
- sig { returns(T.nilable(Integer)) }
64
- attr_reader :user_id
65
-
66
- class << self
67
- sig do
68
- returns(String)
69
- end
70
- def json_body_name()
71
- "adjustment"
72
- end
73
-
74
- sig do
75
- params(
76
- id: T.any(Integer, String),
77
- gift_card_id: T.nilable(T.any(Integer, String)),
78
- session: Auth::Session
79
- ).returns(T.nilable(GiftCardAdjustment))
80
- end
81
- def find(
82
- id:,
83
- gift_card_id: nil,
84
- session: ShopifyAPI::Context.active_session
85
- )
86
- result = base_find(
87
- session: session,
88
- ids: {id: id, gift_card_id: gift_card_id},
89
- params: {},
90
- )
91
- T.cast(result[0], T.nilable(GiftCardAdjustment))
92
- end
93
-
94
- sig do
95
- params(
96
- gift_card_id: T.nilable(T.any(Integer, String)),
97
- session: Auth::Session,
98
- kwargs: T.untyped
99
- ).returns(T::Array[GiftCardAdjustment])
100
- end
101
- def all(
102
- gift_card_id: nil,
103
- session: ShopifyAPI::Context.active_session,
104
- **kwargs
105
- )
106
- response = base_find(
107
- session: session,
108
- ids: {gift_card_id: gift_card_id},
109
- params: {}.merge(kwargs).compact,
110
- )
111
-
112
- T.cast(response, T::Array[GiftCardAdjustment])
113
- end
114
-
115
- end
116
-
117
- end
118
- end
@@ -1,157 +0,0 @@
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 Image < 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
- @created_at = T.let(nil, T.nilable(String))
20
- @height = T.let(nil, T.nilable(Integer))
21
- @id = T.let(nil, T.nilable(Integer))
22
- @position = T.let(nil, T.nilable(Integer))
23
- @product_id = T.let(nil, T.nilable(Integer))
24
- @src = T.let(nil, T.nilable(String))
25
- @updated_at = T.let(nil, T.nilable(String))
26
- @variant_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
27
- @width = T.let(nil, T.nilable(Integer))
28
- end
29
-
30
- @has_one = T.let({}, T::Hash[Symbol, Class])
31
- @has_many = T.let({}, T::Hash[Symbol, Class])
32
- @paths = T.let([
33
- {http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"},
34
- {http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/images/count.json"},
35
- {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/images.json"},
36
- {http_method: :get, operation: :get, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"},
37
- {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/images.json"},
38
- {http_method: :put, operation: :put, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"}
39
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
40
-
41
- sig { returns(T.nilable(String)) }
42
- attr_reader :created_at
43
- sig { returns(T.nilable(Integer)) }
44
- attr_reader :height
45
- sig { returns(T.nilable(Integer)) }
46
- attr_reader :id
47
- sig { returns(T.nilable(Integer)) }
48
- attr_reader :position
49
- sig { returns(T.nilable(Integer)) }
50
- attr_reader :product_id
51
- sig { returns(T.nilable(String)) }
52
- attr_reader :src
53
- sig { returns(T.nilable(String)) }
54
- attr_reader :updated_at
55
- sig { returns(T.nilable(T::Array[Integer])) }
56
- attr_reader :variant_ids
57
- sig { returns(T.nilable(Integer)) }
58
- attr_reader :width
59
-
60
- class << self
61
- sig do
62
- params(
63
- id: T.any(Integer, String),
64
- product_id: T.nilable(T.any(Integer, String)),
65
- fields: T.untyped,
66
- session: Auth::Session
67
- ).returns(T.nilable(Image))
68
- end
69
- def find(
70
- id:,
71
- product_id: nil,
72
- fields: nil,
73
- session: ShopifyAPI::Context.active_session
74
- )
75
- result = base_find(
76
- session: session,
77
- ids: {id: id, product_id: product_id},
78
- params: {fields: fields},
79
- )
80
- T.cast(result[0], T.nilable(Image))
81
- end
82
-
83
- sig do
84
- params(
85
- id: T.any(Integer, String),
86
- product_id: T.nilable(T.any(Integer, String)),
87
- session: Auth::Session
88
- ).returns(T.untyped)
89
- end
90
- def delete(
91
- id:,
92
- product_id: nil,
93
- session: ShopifyAPI::Context.active_session
94
- )
95
- request(
96
- http_method: :delete,
97
- operation: :delete,
98
- session: session,
99
- ids: {id: id, product_id: product_id},
100
- params: {},
101
- )
102
- end
103
-
104
- sig do
105
- params(
106
- product_id: T.nilable(T.any(Integer, String)),
107
- since_id: T.untyped,
108
- fields: T.untyped,
109
- session: Auth::Session,
110
- kwargs: T.untyped
111
- ).returns(T::Array[Image])
112
- end
113
- def all(
114
- product_id: nil,
115
- since_id: nil,
116
- fields: nil,
117
- session: ShopifyAPI::Context.active_session,
118
- **kwargs
119
- )
120
- response = base_find(
121
- session: session,
122
- ids: {product_id: product_id},
123
- params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
124
- )
125
-
126
- T.cast(response, T::Array[Image])
127
- end
128
-
129
- sig do
130
- params(
131
- product_id: T.nilable(T.any(Integer, String)),
132
- since_id: T.untyped,
133
- session: Auth::Session,
134
- kwargs: T.untyped
135
- ).returns(T.untyped)
136
- end
137
- def count(
138
- product_id: nil,
139
- since_id: nil,
140
- session: ShopifyAPI::Context.active_session,
141
- **kwargs
142
- )
143
- request(
144
- http_method: :get,
145
- operation: :count,
146
- session: session,
147
- ids: {product_id: product_id},
148
- params: {since_id: since_id}.merge(kwargs).compact,
149
- body: {},
150
- entity: nil,
151
- )
152
- end
153
-
154
- end
155
-
156
- end
157
- end
@@ -1,108 +0,0 @@
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 InventoryItem < 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
- @cost = T.let(nil, T.nilable(String))
20
- @country_code_of_origin = T.let(nil, T.nilable(String))
21
- @country_harmonized_system_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
22
- @created_at = T.let(nil, T.nilable(String))
23
- @harmonized_system_code = T.let(nil, T.nilable(Integer))
24
- @id = T.let(nil, T.nilable(Integer))
25
- @province_code_of_origin = T.let(nil, T.nilable(String))
26
- @requires_shipping = T.let(nil, T.nilable(T::Boolean))
27
- @sku = T.let(nil, T.nilable(String))
28
- @tracked = T.let(nil, T.nilable(T::Boolean))
29
- @updated_at = T.let(nil, T.nilable(String))
30
- end
31
-
32
- @has_one = T.let({}, T::Hash[Symbol, Class])
33
- @has_many = T.let({}, T::Hash[Symbol, Class])
34
- @paths = T.let([
35
- {http_method: :get, operation: :get, ids: [], path: "inventory_items.json"},
36
- {http_method: :get, operation: :get, ids: [:id], path: "inventory_items/<id>.json"},
37
- {http_method: :put, operation: :put, ids: [:id], path: "inventory_items/<id>.json"}
38
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
39
-
40
- sig { returns(T.nilable(String)) }
41
- attr_reader :cost
42
- sig { returns(T.nilable(String)) }
43
- attr_reader :country_code_of_origin
44
- sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
45
- attr_reader :country_harmonized_system_codes
46
- sig { returns(T.nilable(String)) }
47
- attr_reader :created_at
48
- sig { returns(T.nilable(Integer)) }
49
- attr_reader :harmonized_system_code
50
- sig { returns(T.nilable(Integer)) }
51
- attr_reader :id
52
- sig { returns(T.nilable(String)) }
53
- attr_reader :province_code_of_origin
54
- sig { returns(T.nilable(T::Boolean)) }
55
- attr_reader :requires_shipping
56
- sig { returns(T.nilable(String)) }
57
- attr_reader :sku
58
- sig { returns(T.nilable(T::Boolean)) }
59
- attr_reader :tracked
60
- sig { returns(T.nilable(String)) }
61
- attr_reader :updated_at
62
-
63
- class << self
64
- sig do
65
- params(
66
- id: T.any(Integer, String),
67
- session: Auth::Session
68
- ).returns(T.nilable(InventoryItem))
69
- end
70
- def find(
71
- id:,
72
- session: ShopifyAPI::Context.active_session
73
- )
74
- result = base_find(
75
- session: session,
76
- ids: {id: id},
77
- params: {},
78
- )
79
- T.cast(result[0], T.nilable(InventoryItem))
80
- end
81
-
82
- sig do
83
- params(
84
- ids: T.untyped,
85
- limit: T.untyped,
86
- session: Auth::Session,
87
- kwargs: T.untyped
88
- ).returns(T::Array[InventoryItem])
89
- end
90
- def all(
91
- ids: nil,
92
- limit: nil,
93
- session: ShopifyAPI::Context.active_session,
94
- **kwargs
95
- )
96
- response = base_find(
97
- session: session,
98
- ids: {},
99
- params: {ids: ids, limit: limit}.merge(kwargs).compact,
100
- )
101
-
102
- T.cast(response, T::Array[InventoryItem])
103
- end
104
-
105
- end
106
-
107
- end
108
- end
@@ -1,179 +0,0 @@
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 InventoryLevel < 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
- @available = T.let(nil, T.nilable(Integer))
20
- @inventory_item_id = T.let(nil, T.nilable(Integer))
21
- @location_id = T.let(nil, T.nilable(Integer))
22
- @updated_at = T.let(nil, T.nilable(String))
23
- end
24
-
25
- @has_one = T.let({}, T::Hash[Symbol, Class])
26
- @has_many = T.let({}, T::Hash[Symbol, Class])
27
- @paths = T.let([
28
- {http_method: :delete, operation: :delete, ids: [], path: "inventory_levels.json"},
29
- {http_method: :get, operation: :get, ids: [], path: "inventory_levels.json"},
30
- {http_method: :post, operation: :adjust, ids: [], path: "inventory_levels/adjust.json"},
31
- {http_method: :post, operation: :connect, ids: [], path: "inventory_levels/connect.json"},
32
- {http_method: :post, operation: :set, ids: [], path: "inventory_levels/set.json"}
33
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
34
-
35
- sig { returns(T.nilable(Integer)) }
36
- attr_reader :available
37
- sig { returns(T.nilable(Integer)) }
38
- attr_reader :inventory_item_id
39
- sig { returns(T.nilable(Integer)) }
40
- attr_reader :location_id
41
- sig { returns(T.nilable(String)) }
42
- attr_reader :updated_at
43
-
44
- class << self
45
- sig do
46
- params(
47
- inventory_item_id: T.untyped,
48
- location_id: T.untyped,
49
- session: Auth::Session
50
- ).returns(T.untyped)
51
- end
52
- def delete(
53
- inventory_item_id: nil,
54
- location_id: nil,
55
- session: ShopifyAPI::Context.active_session
56
- )
57
- request(
58
- http_method: :delete,
59
- operation: :delete,
60
- session: session,
61
- ids: {},
62
- params: {inventory_item_id: inventory_item_id, location_id: location_id},
63
- )
64
- end
65
-
66
- sig do
67
- params(
68
- inventory_item_ids: T.untyped,
69
- location_ids: T.untyped,
70
- limit: T.untyped,
71
- updated_at_min: T.untyped,
72
- session: Auth::Session,
73
- kwargs: T.untyped
74
- ).returns(T::Array[InventoryLevel])
75
- end
76
- def all(
77
- inventory_item_ids: nil,
78
- location_ids: nil,
79
- limit: nil,
80
- updated_at_min: nil,
81
- session: ShopifyAPI::Context.active_session,
82
- **kwargs
83
- )
84
- response = base_find(
85
- session: session,
86
- ids: {},
87
- params: {inventory_item_ids: inventory_item_ids, location_ids: location_ids, limit: limit, updated_at_min: updated_at_min}.merge(kwargs).compact,
88
- )
89
-
90
- T.cast(response, T::Array[InventoryLevel])
91
- end
92
-
93
- end
94
-
95
- sig do
96
- params(
97
- inventory_item_id: T.untyped,
98
- location_id: T.untyped,
99
- available_adjustment: T.untyped,
100
- body: T.untyped,
101
- kwargs: T.untyped
102
- ).returns(T.untyped)
103
- end
104
- def adjust(
105
- inventory_item_id: nil,
106
- location_id: nil,
107
- available_adjustment: nil,
108
- body: nil,
109
- **kwargs
110
- )
111
- self.class.request(
112
- http_method: :post,
113
- operation: :adjust,
114
- session: @session,
115
- ids: {},
116
- params: {inventory_item_id: inventory_item_id, location_id: location_id, available_adjustment: available_adjustment}.merge(kwargs).compact,
117
- body: body,
118
- entity: self,
119
- )
120
- end
121
-
122
- sig do
123
- params(
124
- inventory_item_id: T.untyped,
125
- location_id: T.untyped,
126
- relocate_if_necessary: T.untyped,
127
- body: T.untyped,
128
- kwargs: T.untyped
129
- ).returns(T.untyped)
130
- end
131
- def connect(
132
- inventory_item_id: nil,
133
- location_id: nil,
134
- relocate_if_necessary: nil,
135
- body: nil,
136
- **kwargs
137
- )
138
- self.class.request(
139
- http_method: :post,
140
- operation: :connect,
141
- session: @session,
142
- ids: {},
143
- params: {inventory_item_id: inventory_item_id, location_id: location_id, relocate_if_necessary: relocate_if_necessary}.merge(kwargs).compact,
144
- body: body,
145
- entity: self,
146
- )
147
- end
148
-
149
- sig do
150
- params(
151
- inventory_item_id: T.untyped,
152
- location_id: T.untyped,
153
- available: T.untyped,
154
- disconnect_if_necessary: T.untyped,
155
- body: T.untyped,
156
- kwargs: T.untyped
157
- ).returns(T.untyped)
158
- end
159
- def set(
160
- inventory_item_id: nil,
161
- location_id: nil,
162
- available: nil,
163
- disconnect_if_necessary: nil,
164
- body: nil,
165
- **kwargs
166
- )
167
- self.class.request(
168
- http_method: :post,
169
- operation: :set,
170
- session: @session,
171
- ids: {},
172
- params: {inventory_item_id: inventory_item_id, location_id: location_id, available: available, disconnect_if_necessary: disconnect_if_necessary}.merge(kwargs).compact,
173
- body: body,
174
- entity: self,
175
- )
176
- end
177
-
178
- end
179
- end