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,219 +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 DiscountCode < 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
- @code = T.let(nil, T.nilable(String))
20
- @created_at = T.let(nil, T.nilable(String))
21
- @id = T.let(nil, T.nilable(Integer))
22
- @price_rule_id = T.let(nil, T.nilable(Integer))
23
- @updated_at = T.let(nil, T.nilable(String))
24
- @usage_count = T.let(nil, T.nilable(Integer))
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: [:price_rule_id, :id], path: "price_rules/<price_rule_id>/discount_codes/<id>.json"},
31
- {http_method: :get, operation: :count, ids: [], path: "discount_codes/count.json"},
32
- {http_method: :get, operation: :get, ids: [:price_rule_id, :batch_id], path: "price_rules/<price_rule_id>/batch/<batch_id>/discount_codes.json"},
33
- {http_method: :get, operation: :get, ids: [:price_rule_id], path: "price_rules/<price_rule_id>/discount_codes.json"},
34
- {http_method: :get, operation: :get, ids: [:price_rule_id, :id], path: "price_rules/<price_rule_id>/discount_codes/<id>.json"},
35
- {http_method: :get, operation: :get_all, ids: [:price_rule_id, :batch_id], path: "price_rules/<price_rule_id>/batch/<batch_id>.json"},
36
- {http_method: :get, operation: :lookup, ids: [], path: "discount_codes/lookup.json"},
37
- {http_method: :post, operation: :batch, ids: [:price_rule_id], path: "price_rules/<price_rule_id>/batch.json"},
38
- {http_method: :post, operation: :post, ids: [:price_rule_id], path: "price_rules/<price_rule_id>/discount_codes.json"},
39
- {http_method: :put, operation: :put, ids: [:price_rule_id, :id], path: "price_rules/<price_rule_id>/discount_codes/<id>.json"}
40
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
41
-
42
- sig { returns(T.nilable(String)) }
43
- attr_reader :code
44
- sig { returns(T.nilable(String)) }
45
- attr_reader :created_at
46
- sig { returns(T.nilable(Integer)) }
47
- attr_reader :id
48
- sig { returns(T.nilable(Integer)) }
49
- attr_reader :price_rule_id
50
- sig { returns(T.nilable(String)) }
51
- attr_reader :updated_at
52
- sig { returns(T.nilable(Integer)) }
53
- attr_reader :usage_count
54
-
55
- class << self
56
- sig do
57
- params(
58
- id: T.any(Integer, String),
59
- price_rule_id: T.nilable(T.any(Integer, String)),
60
- session: Auth::Session
61
- ).returns(T.nilable(DiscountCode))
62
- end
63
- def find(
64
- id:,
65
- price_rule_id: nil,
66
- session: ShopifyAPI::Context.active_session
67
- )
68
- result = base_find(
69
- session: session,
70
- ids: {id: id, price_rule_id: price_rule_id},
71
- params: {},
72
- )
73
- T.cast(result[0], T.nilable(DiscountCode))
74
- end
75
-
76
- sig do
77
- params(
78
- id: T.any(Integer, String),
79
- price_rule_id: T.nilable(T.any(Integer, String)),
80
- session: Auth::Session
81
- ).returns(T.untyped)
82
- end
83
- def delete(
84
- id:,
85
- price_rule_id: nil,
86
- session: ShopifyAPI::Context.active_session
87
- )
88
- request(
89
- http_method: :delete,
90
- operation: :delete,
91
- session: session,
92
- ids: {id: id, price_rule_id: price_rule_id},
93
- params: {},
94
- )
95
- end
96
-
97
- sig do
98
- params(
99
- price_rule_id: T.nilable(T.any(Integer, String)),
100
- batch_id: T.nilable(T.any(Integer, String)),
101
- session: Auth::Session,
102
- kwargs: T.untyped
103
- ).returns(T::Array[DiscountCode])
104
- end
105
- def all(
106
- price_rule_id: nil,
107
- batch_id: nil,
108
- session: ShopifyAPI::Context.active_session,
109
- **kwargs
110
- )
111
- response = base_find(
112
- session: session,
113
- ids: {price_rule_id: price_rule_id, batch_id: batch_id},
114
- params: {}.merge(kwargs).compact,
115
- )
116
-
117
- T.cast(response, T::Array[DiscountCode])
118
- end
119
-
120
- sig do
121
- params(
122
- times_used: T.untyped,
123
- times_used_min: T.untyped,
124
- times_used_max: T.untyped,
125
- session: Auth::Session,
126
- kwargs: T.untyped
127
- ).returns(T.untyped)
128
- end
129
- def count(
130
- times_used: nil,
131
- times_used_min: nil,
132
- times_used_max: nil,
133
- session: ShopifyAPI::Context.active_session,
134
- **kwargs
135
- )
136
- request(
137
- http_method: :get,
138
- operation: :count,
139
- session: session,
140
- ids: {},
141
- params: {times_used: times_used, times_used_min: times_used_min, times_used_max: times_used_max}.merge(kwargs).compact,
142
- body: {},
143
- entity: nil,
144
- )
145
- end
146
-
147
- sig do
148
- params(
149
- price_rule_id: T.nilable(T.any(Integer, String)),
150
- batch_id: T.nilable(T.any(Integer, String)),
151
- session: Auth::Session,
152
- kwargs: T.untyped
153
- ).returns(T.untyped)
154
- end
155
- def get_all(
156
- price_rule_id: nil,
157
- batch_id: nil,
158
- session: ShopifyAPI::Context.active_session,
159
- **kwargs
160
- )
161
- request(
162
- http_method: :get,
163
- operation: :get_all,
164
- session: session,
165
- ids: {price_rule_id: price_rule_id, batch_id: batch_id},
166
- params: {}.merge(kwargs).compact,
167
- body: {},
168
- entity: nil,
169
- )
170
- end
171
-
172
- sig do
173
- params(
174
- code: T.untyped,
175
- session: Auth::Session,
176
- kwargs: T.untyped
177
- ).returns(T.untyped)
178
- end
179
- def lookup(
180
- code: nil,
181
- session: ShopifyAPI::Context.active_session,
182
- **kwargs
183
- )
184
- request(
185
- http_method: :get,
186
- operation: :lookup,
187
- session: session,
188
- ids: {},
189
- params: {code: code}.merge(kwargs).compact,
190
- body: {},
191
- entity: nil,
192
- )
193
- end
194
-
195
- end
196
-
197
- sig do
198
- params(
199
- body: T.untyped,
200
- kwargs: T.untyped
201
- ).returns(T.untyped)
202
- end
203
- def batch(
204
- body: nil,
205
- **kwargs
206
- )
207
- self.class.request(
208
- http_method: :post,
209
- operation: :batch,
210
- session: @session,
211
- ids: {price_rule_id: @price_rule_id},
212
- params: {}.merge(kwargs).compact,
213
- body: body,
214
- entity: self,
215
- )
216
- end
217
-
218
- end
219
- end
@@ -1,111 +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 Dispute < 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(String))
20
- @currency = T.let(nil, T.nilable(String))
21
- @evidence_due_by = T.let(nil, T.nilable(String))
22
- @evidence_sent_on = T.let(nil, T.nilable(String))
23
- @finalized_on = T.let(nil, T.nilable(String))
24
- @id = T.let(nil, T.nilable(Integer))
25
- @network_reason_code = T.let(nil, T.nilable(Integer))
26
- @order_id = T.let(nil, T.nilable(Integer))
27
- @reason = T.let(nil, T.nilable(String))
28
- @status = T.let(nil, T.nilable(String))
29
- @type = 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: "shopify_payments/disputes.json"},
36
- {http_method: :get, operation: :get, ids: [:id], path: "shopify_payments/disputes/<id>.json"}
37
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
38
-
39
- sig { returns(T.nilable(String)) }
40
- attr_reader :amount
41
- sig { returns(T.nilable(String)) }
42
- attr_reader :currency
43
- sig { returns(T.nilable(String)) }
44
- attr_reader :evidence_due_by
45
- sig { returns(T.nilable(String)) }
46
- attr_reader :evidence_sent_on
47
- sig { returns(T.nilable(String)) }
48
- attr_reader :finalized_on
49
- sig { returns(T.nilable(Integer)) }
50
- attr_reader :id
51
- sig { returns(T.nilable(Integer)) }
52
- attr_reader :network_reason_code
53
- sig { returns(T.nilable(Integer)) }
54
- attr_reader :order_id
55
- sig { returns(T.nilable(String)) }
56
- attr_reader :reason
57
- sig { returns(T.nilable(String)) }
58
- attr_reader :status
59
- sig { returns(T.nilable(String)) }
60
- attr_reader :type
61
-
62
- class << self
63
- sig do
64
- params(
65
- id: T.any(Integer, String),
66
- session: Auth::Session
67
- ).returns(T.nilable(Dispute))
68
- end
69
- def find(
70
- id:,
71
- session: ShopifyAPI::Context.active_session
72
- )
73
- result = base_find(
74
- session: session,
75
- ids: {id: id},
76
- params: {},
77
- )
78
- T.cast(result[0], T.nilable(Dispute))
79
- end
80
-
81
- sig do
82
- params(
83
- since_id: T.untyped,
84
- last_id: T.untyped,
85
- status: T.untyped,
86
- initiated_at: T.untyped,
87
- session: Auth::Session,
88
- kwargs: T.untyped
89
- ).returns(T::Array[Dispute])
90
- end
91
- def all(
92
- since_id: nil,
93
- last_id: nil,
94
- status: nil,
95
- initiated_at: nil,
96
- session: ShopifyAPI::Context.active_session,
97
- **kwargs
98
- )
99
- response = base_find(
100
- session: session,
101
- ids: {},
102
- params: {since_id: since_id, last_id: last_id, status: status, initiated_at: initiated_at}.merge(kwargs).compact,
103
- )
104
-
105
- T.cast(response, T::Array[Dispute])
106
- end
107
-
108
- end
109
-
110
- end
111
- end
@@ -1,275 +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 DraftOrder < 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
- @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
20
- @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
21
- @completed_at = T.let(nil, T.nilable(String))
22
- @created_at = T.let(nil, T.nilable(String))
23
- @currency = T.let(nil, T.nilable(String))
24
- @customer = T.let(nil, T.nilable(Customer))
25
- @email = T.let(nil, T.nilable(String))
26
- @id = T.let(nil, T.nilable(Integer))
27
- @invoice_sent_at = T.let(nil, T.nilable(String))
28
- @invoice_url = T.let(nil, T.nilable(String))
29
- @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
30
- @name = T.let(nil, T.nilable(String))
31
- @note = T.let(nil, T.nilable(String))
32
- @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
33
- @order_id = T.let(nil, T.nilable(Integer))
34
- @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
35
- @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
36
- @shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
37
- @source_name = T.let(nil, T.nilable(String))
38
- @status = T.let(nil, T.nilable(String))
39
- @subtotal_price = T.let(nil, T.nilable(Float))
40
- @tags = T.let(nil, T.nilable(String))
41
- @tax_exempt = T.let(nil, T.nilable(T::Boolean))
42
- @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
43
- @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
44
- @taxes_included = T.let(nil, T.nilable(T::Boolean))
45
- @total_price = T.let(nil, T.nilable(String))
46
- @total_tax = T.let(nil, T.nilable(String))
47
- @updated_at = T.let(nil, T.nilable(String))
48
- end
49
-
50
- @has_one = T.let({
51
- customer: Customer
52
- }, T::Hash[Symbol, Class])
53
- @has_many = T.let({}, T::Hash[Symbol, Class])
54
- @paths = T.let([
55
- {http_method: :delete, operation: :delete, ids: [:id], path: "draft_orders/<id>.json"},
56
- {http_method: :get, operation: :count, ids: [], path: "draft_orders/count.json"},
57
- {http_method: :get, operation: :get, ids: [], path: "draft_orders.json"},
58
- {http_method: :get, operation: :get, ids: [:id], path: "draft_orders/<id>.json"},
59
- {http_method: :post, operation: :post, ids: [], path: "draft_orders.json"},
60
- {http_method: :post, operation: :send_invoice, ids: [:id], path: "draft_orders/<id>/send_invoice.json"},
61
- {http_method: :put, operation: :complete, ids: [:id], path: "draft_orders/<id>/complete.json"},
62
- {http_method: :put, operation: :put, ids: [:id], path: "draft_orders/<id>.json"}
63
- ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
64
-
65
- sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
66
- attr_reader :applied_discount
67
- sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
68
- attr_reader :billing_address
69
- sig { returns(T.nilable(String)) }
70
- attr_reader :completed_at
71
- sig { returns(T.nilable(String)) }
72
- attr_reader :created_at
73
- sig { returns(T.nilable(String)) }
74
- attr_reader :currency
75
- sig { returns(T.nilable(Customer)) }
76
- attr_reader :customer
77
- sig { returns(T.nilable(String)) }
78
- attr_reader :email
79
- sig { returns(T.nilable(Integer)) }
80
- attr_reader :id
81
- sig { returns(T.nilable(String)) }
82
- attr_reader :invoice_sent_at
83
- sig { returns(T.nilable(String)) }
84
- attr_reader :invoice_url
85
- sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
86
- attr_reader :line_items
87
- sig { returns(T.nilable(String)) }
88
- attr_reader :name
89
- sig { returns(T.nilable(String)) }
90
- attr_reader :note
91
- sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
92
- attr_reader :note_attributes
93
- sig { returns(T.nilable(Integer)) }
94
- attr_reader :order_id
95
- sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
96
- attr_reader :payment_terms
97
- sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
98
- attr_reader :shipping_address
99
- sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100
- attr_reader :shipping_line
101
- sig { returns(T.nilable(String)) }
102
- attr_reader :source_name
103
- sig { returns(T.nilable(String)) }
104
- attr_reader :status
105
- sig { returns(T.nilable(Float)) }
106
- attr_reader :subtotal_price
107
- sig { returns(T.nilable(String)) }
108
- attr_reader :tags
109
- sig { returns(T.nilable(T::Boolean)) }
110
- attr_reader :tax_exempt
111
- sig { returns(T.nilable(T::Array[String])) }
112
- attr_reader :tax_exemptions
113
- sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
114
- attr_reader :tax_lines
115
- sig { returns(T.nilable(T::Boolean)) }
116
- attr_reader :taxes_included
117
- sig { returns(T.nilable(String)) }
118
- attr_reader :total_price
119
- sig { returns(T.nilable(String)) }
120
- attr_reader :total_tax
121
- sig { returns(T.nilable(String)) }
122
- attr_reader :updated_at
123
-
124
- class << self
125
- sig do
126
- params(
127
- id: T.any(Integer, String),
128
- fields: T.untyped,
129
- session: Auth::Session
130
- ).returns(T.nilable(DraftOrder))
131
- end
132
- def find(
133
- id:,
134
- fields: nil,
135
- session: ShopifyAPI::Context.active_session
136
- )
137
- result = base_find(
138
- session: session,
139
- ids: {id: id},
140
- params: {fields: fields},
141
- )
142
- T.cast(result[0], T.nilable(DraftOrder))
143
- end
144
-
145
- sig do
146
- params(
147
- id: T.any(Integer, String),
148
- session: Auth::Session
149
- ).returns(T.untyped)
150
- end
151
- def delete(
152
- id:,
153
- session: ShopifyAPI::Context.active_session
154
- )
155
- request(
156
- http_method: :delete,
157
- operation: :delete,
158
- session: session,
159
- ids: {id: id},
160
- params: {},
161
- )
162
- end
163
-
164
- sig do
165
- params(
166
- fields: T.untyped,
167
- limit: T.untyped,
168
- since_id: T.untyped,
169
- updated_at_min: T.untyped,
170
- updated_at_max: T.untyped,
171
- ids: T.untyped,
172
- status: T.untyped,
173
- session: Auth::Session,
174
- kwargs: T.untyped
175
- ).returns(T::Array[DraftOrder])
176
- end
177
- def all(
178
- fields: nil,
179
- limit: nil,
180
- since_id: nil,
181
- updated_at_min: nil,
182
- updated_at_max: nil,
183
- ids: nil,
184
- status: nil,
185
- session: ShopifyAPI::Context.active_session,
186
- **kwargs
187
- )
188
- response = base_find(
189
- session: session,
190
- ids: {},
191
- params: {fields: fields, limit: limit, since_id: since_id, updated_at_min: updated_at_min, updated_at_max: updated_at_max, ids: ids, status: status}.merge(kwargs).compact,
192
- )
193
-
194
- T.cast(response, T::Array[DraftOrder])
195
- end
196
-
197
- sig do
198
- params(
199
- since_id: T.untyped,
200
- status: T.untyped,
201
- updated_at_max: T.untyped,
202
- updated_at_min: T.untyped,
203
- session: Auth::Session,
204
- kwargs: T.untyped
205
- ).returns(T.untyped)
206
- end
207
- def count(
208
- since_id: nil,
209
- status: nil,
210
- updated_at_max: nil,
211
- updated_at_min: nil,
212
- session: ShopifyAPI::Context.active_session,
213
- **kwargs
214
- )
215
- request(
216
- http_method: :get,
217
- operation: :count,
218
- session: session,
219
- ids: {},
220
- params: {since_id: since_id, status: status, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
221
- body: {},
222
- entity: nil,
223
- )
224
- end
225
-
226
- end
227
-
228
- sig do
229
- params(
230
- body: T.untyped,
231
- kwargs: T.untyped
232
- ).returns(T.untyped)
233
- end
234
- def send_invoice(
235
- body: nil,
236
- **kwargs
237
- )
238
- self.class.request(
239
- http_method: :post,
240
- operation: :send_invoice,
241
- session: @session,
242
- ids: {id: @id},
243
- params: {}.merge(kwargs).compact,
244
- body: body,
245
- entity: self,
246
- )
247
- end
248
-
249
- sig do
250
- params(
251
- payment_gateway_id: T.untyped,
252
- payment_pending: T.untyped,
253
- body: T.untyped,
254
- kwargs: T.untyped
255
- ).returns(T.untyped)
256
- end
257
- def complete(
258
- payment_gateway_id: nil,
259
- payment_pending: nil,
260
- body: nil,
261
- **kwargs
262
- )
263
- self.class.request(
264
- http_method: :put,
265
- operation: :complete,
266
- session: @session,
267
- ids: {id: @id},
268
- params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
269
- body: body,
270
- entity: self,
271
- )
272
- end
273
-
274
- end
275
- end