shopify_api 12.5.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +7 -0
  4. data/Gemfile.lock +2 -2
  5. data/lib/shopify_api/auth/oauth.rb +0 -2
  6. data/lib/shopify_api/clients/http_client.rb +13 -9
  7. data/lib/shopify_api/context.rb +4 -20
  8. data/lib/shopify_api/rest/base.rb +48 -14
  9. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +190 -0
  10. data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +58 -0
  11. data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +77 -0
  12. data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +105 -0
  13. data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +109 -0
  14. data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +92 -0
  15. data/lib/shopify_api/rest/resources/2022_04/article.rb +265 -0
  16. data/lib/shopify_api/rest/resources/2022_04/asset.rb +118 -0
  17. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +86 -0
  18. data/lib/shopify_api/rest/resources/2022_04/balance.rb +50 -0
  19. data/lib/shopify_api/rest/resources/2022_04/blog.rb +162 -0
  20. data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +83 -0
  21. data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +116 -0
  22. data/lib/shopify_api/rest/resources/2022_04/checkout.rb +209 -0
  23. data/lib/shopify_api/rest/resources/2022_04/collect.rb +142 -0
  24. data/lib/shopify_api/rest/resources/2022_04/collection.rb +110 -0
  25. data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +155 -0
  26. data/lib/shopify_api/rest/resources/2022_04/comment.rb +283 -0
  27. data/lib/shopify_api/rest/resources/2022_04/country.rb +137 -0
  28. data/lib/shopify_api/rest/resources/2022_04/currency.rb +57 -0
  29. data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +187 -0
  30. data/lib/shopify_api/rest/resources/2022_04/customer.rb +329 -0
  31. data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +201 -0
  32. data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +169 -0
  33. data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +57 -0
  34. data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +222 -0
  35. data/lib/shopify_api/rest/resources/2022_04/dispute.rb +111 -0
  36. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +275 -0
  37. data/lib/shopify_api/rest/resources/2022_04/event.rb +148 -0
  38. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +278 -0
  39. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +166 -0
  40. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +284 -0
  41. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +87 -0
  42. data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +130 -0
  43. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +218 -0
  44. data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +118 -0
  45. data/lib/shopify_api/rest/resources/2022_04/image.rb +157 -0
  46. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +108 -0
  47. data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +179 -0
  48. data/lib/shopify_api/rest/resources/2022_04/location.rb +167 -0
  49. data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +56 -0
  50. data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +209 -0
  51. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +344 -0
  52. data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +110 -0
  53. data/lib/shopify_api/rest/resources/2022_04/order.rb +473 -0
  54. data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +142 -0
  55. data/lib/shopify_api/rest/resources/2022_04/page.rb +194 -0
  56. data/lib/shopify_api/rest/resources/2022_04/payment.rb +140 -0
  57. data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +143 -0
  58. data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +107 -0
  59. data/lib/shopify_api/rest/resources/2022_04/payout.rb +97 -0
  60. data/lib/shopify_api/rest/resources/2022_04/policy.rb +69 -0
  61. data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +223 -0
  62. data/lib/shopify_api/rest/resources/2022_04/product.rb +223 -0
  63. data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +196 -0
  64. data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +88 -0
  65. data/lib/shopify_api/rest/resources/2022_04/province.rb +132 -0
  66. data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +172 -0
  67. data/lib/shopify_api/rest/resources/2022_04/redirect.rb +139 -0
  68. data/lib/shopify_api/rest/resources/2022_04/refund.rb +151 -0
  69. data/lib/shopify_api/rest/resources/2022_04/report.rb +121 -0
  70. data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +73 -0
  71. data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +155 -0
  72. data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +83 -0
  73. data/lib/shopify_api/rest/resources/2022_04/shop.rb +218 -0
  74. data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +216 -0
  75. data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +87 -0
  76. data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +93 -0
  77. data/lib/shopify_api/rest/resources/2022_04/theme.rb +123 -0
  78. data/lib/shopify_api/rest/resources/2022_04/transaction.rb +181 -0
  79. data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +102 -0
  80. data/lib/shopify_api/rest/resources/2022_04/user.rb +138 -0
  81. data/lib/shopify_api/rest/resources/2022_04/variant.rb +212 -0
  82. data/lib/shopify_api/rest/resources/2022_04/webhook.rb +168 -0
  83. data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +2 -2
  84. data/lib/shopify_api/rest/resources/2022_07/carrier_service.rb +3 -0
  85. data/lib/shopify_api/rest/resources/2022_07/discount_code.rb +3 -0
  86. data/lib/shopify_api/rest/resources/2022_07/dispute.rb +2 -2
  87. data/lib/shopify_api/rest/resources/2022_07/draft_order.rb +2 -2
  88. data/lib/shopify_api/rest/resources/2022_07/event.rb +2 -2
  89. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +6 -0
  90. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +8 -5
  91. data/lib/shopify_api/rest/resources/2022_07/order_risk.rb +9 -2
  92. data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +2 -2
  93. data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
  94. data/lib/shopify_api/rest/resources/2022_07/theme.rb +3 -0
  95. data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +2 -2
  96. data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +2 -2
  97. data/lib/shopify_api/rest/resources/2022_10/carrier_service.rb +3 -0
  98. data/lib/shopify_api/rest/resources/2022_10/discount_code.rb +3 -0
  99. data/lib/shopify_api/rest/resources/2022_10/dispute.rb +2 -2
  100. data/lib/shopify_api/rest/resources/2022_10/draft_order.rb +2 -2
  101. data/lib/shopify_api/rest/resources/2022_10/event.rb +2 -2
  102. data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +6 -0
  103. data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +8 -5
  104. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +9 -2
  105. data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +2 -2
  106. data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
  107. data/lib/shopify_api/rest/resources/2022_10/theme.rb +3 -0
  108. data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +2 -2
  109. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +2 -2
  110. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +3 -0
  111. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +3 -0
  112. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +2 -2
  113. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +2 -2
  114. data/lib/shopify_api/rest/resources/2023_01/event.rb +2 -2
  115. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +6 -0
  116. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +8 -5
  117. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +9 -2
  118. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +2 -2
  119. data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
  120. data/lib/shopify_api/rest/resources/2023_01/theme.rb +3 -0
  121. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +2 -2
  122. data/lib/shopify_api/rest/resources/2023_04/application_credit.rb +2 -2
  123. data/lib/shopify_api/rest/resources/2023_04/carrier_service.rb +3 -0
  124. data/lib/shopify_api/rest/resources/2023_04/discount_code.rb +3 -0
  125. data/lib/shopify_api/rest/resources/2023_04/dispute.rb +2 -2
  126. data/lib/shopify_api/rest/resources/2023_04/draft_order.rb +2 -2
  127. data/lib/shopify_api/rest/resources/2023_04/event.rb +2 -2
  128. data/lib/shopify_api/rest/resources/2023_04/fulfillment.rb +6 -0
  129. data/lib/shopify_api/rest/resources/2023_04/gift_card.rb +8 -5
  130. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +9 -2
  131. data/lib/shopify_api/rest/resources/2023_04/shipping_zone.rb +2 -2
  132. data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
  133. data/lib/shopify_api/rest/resources/2023_04/theme.rb +3 -0
  134. data/lib/shopify_api/rest/resources/2023_04/usage_charge.rb +2 -2
  135. data/lib/shopify_api/utils/graphql_proxy.rb +3 -6
  136. data/lib/shopify_api/utils/session_utils.rb +0 -84
  137. data/lib/shopify_api/version.rb +1 -1
  138. data/lib/shopify_api/webhooks/registry.rb +1 -1
  139. metadata +77 -5
  140. data/lib/shopify_api/auth/file_session_storage.rb +0 -72
  141. data/lib/shopify_api/auth/session_storage.rb +0 -30
@@ -0,0 +1,218 @@
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 GiftCard < 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
+ @api_client_id = T.let(nil, T.nilable(Integer))
20
+ @balance = T.let(nil, T.nilable(Balance))
21
+ @code = T.let(nil, T.nilable(String))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @currency = T.let(nil, T.nilable(Currency))
24
+ @customer_id = T.let(nil, T.nilable(Integer))
25
+ @disabled_at = T.let(nil, T.nilable(String))
26
+ @expires_on = T.let(nil, T.nilable(String))
27
+ @id = T.let(nil, T.nilable(Integer))
28
+ @initial_value = T.let(nil, T.nilable(String))
29
+ @last_characters = T.let(nil, T.nilable(String))
30
+ @line_item_id = T.let(nil, T.nilable(Integer))
31
+ @note = T.let(nil, T.nilable(String))
32
+ @order_id = T.let(nil, T.nilable(Integer))
33
+ @template_suffix = T.let(nil, T.nilable(String))
34
+ @updated_at = T.let(nil, T.nilable(String))
35
+ @user_id = T.let(nil, T.nilable(Integer))
36
+ end
37
+
38
+ @has_one = T.let({
39
+ balance: Balance,
40
+ currency: Currency
41
+ }, T::Hash[Symbol, Class])
42
+ @has_many = T.let({}, T::Hash[Symbol, Class])
43
+ @paths = T.let([
44
+ {http_method: :get, operation: :count, ids: [], path: "gift_cards/count.json"},
45
+ {http_method: :get, operation: :get, ids: [], path: "gift_cards.json"},
46
+ {http_method: :get, operation: :get, ids: [:id], path: "gift_cards/<id>.json"},
47
+ {http_method: :get, operation: :search, ids: [], path: "gift_cards/search.json"},
48
+ {http_method: :post, operation: :disable, ids: [:id], path: "gift_cards/<id>/disable.json"},
49
+ {http_method: :post, operation: :post, ids: [], path: "gift_cards.json"},
50
+ {http_method: :put, operation: :put, ids: [:id], path: "gift_cards/<id>.json"}
51
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
52
+
53
+ sig { returns(T.nilable(Integer)) }
54
+ attr_reader :api_client_id
55
+ sig { returns(T.nilable(Balance)) }
56
+ attr_reader :balance
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :code
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :created_at
61
+ sig { returns(T.nilable(Currency)) }
62
+ attr_reader :currency
63
+ sig { returns(T.nilable(Integer)) }
64
+ attr_reader :customer_id
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :disabled_at
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :expires_on
69
+ sig { returns(T.nilable(Integer)) }
70
+ attr_reader :id
71
+ sig { returns(T.nilable(String)) }
72
+ attr_reader :initial_value
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :last_characters
75
+ sig { returns(T.nilable(Integer)) }
76
+ attr_reader :line_item_id
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :note
79
+ sig { returns(T.nilable(Integer)) }
80
+ attr_reader :order_id
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :template_suffix
83
+ sig { returns(T.nilable(String)) }
84
+ attr_reader :updated_at
85
+ sig { returns(T.nilable(Integer)) }
86
+ attr_reader :user_id
87
+
88
+ class << self
89
+ sig do
90
+ params(
91
+ id: T.any(Integer, String),
92
+ session: Auth::Session
93
+ ).returns(T.nilable(GiftCard))
94
+ end
95
+ def find(
96
+ id:,
97
+ session: ShopifyAPI::Context.active_session
98
+ )
99
+ result = base_find(
100
+ session: session,
101
+ ids: {id: id},
102
+ params: {},
103
+ )
104
+ T.cast(result[0], T.nilable(GiftCard))
105
+ end
106
+
107
+ sig do
108
+ params(
109
+ status: T.untyped,
110
+ limit: T.untyped,
111
+ since_id: T.untyped,
112
+ fields: T.untyped,
113
+ session: Auth::Session,
114
+ kwargs: T.untyped
115
+ ).returns(T::Array[GiftCard])
116
+ end
117
+ def all(
118
+ status: nil,
119
+ limit: nil,
120
+ since_id: nil,
121
+ fields: nil,
122
+ session: ShopifyAPI::Context.active_session,
123
+ **kwargs
124
+ )
125
+ response = base_find(
126
+ session: session,
127
+ ids: {},
128
+ params: {status: status, limit: limit, since_id: since_id, fields: fields}.merge(kwargs).compact,
129
+ )
130
+
131
+ T.cast(response, T::Array[GiftCard])
132
+ end
133
+
134
+ sig do
135
+ params(
136
+ status: T.untyped,
137
+ session: Auth::Session,
138
+ kwargs: T.untyped
139
+ ).returns(T.untyped)
140
+ end
141
+ def count(
142
+ status: nil,
143
+ session: ShopifyAPI::Context.active_session,
144
+ **kwargs
145
+ )
146
+ request(
147
+ http_method: :get,
148
+ operation: :count,
149
+ session: session,
150
+ ids: {},
151
+ params: {status: status}.merge(kwargs).compact,
152
+ body: {},
153
+ entity: nil,
154
+ )
155
+ end
156
+
157
+ sig do
158
+ params(
159
+ order: T.untyped,
160
+ query: T.untyped,
161
+ limit: T.untyped,
162
+ fields: T.untyped,
163
+ created_at_min: T.untyped,
164
+ created_at_max: T.untyped,
165
+ updated_at_min: T.untyped,
166
+ updated_at_max: T.untyped,
167
+ session: Auth::Session,
168
+ kwargs: T.untyped
169
+ ).returns(T.untyped)
170
+ end
171
+ def search(
172
+ order: nil,
173
+ query: nil,
174
+ limit: nil,
175
+ fields: nil,
176
+ created_at_min: nil,
177
+ created_at_max: nil,
178
+ updated_at_min: nil,
179
+ updated_at_max: nil,
180
+ session: ShopifyAPI::Context.active_session,
181
+ **kwargs
182
+ )
183
+ request(
184
+ http_method: :get,
185
+ operation: :search,
186
+ session: session,
187
+ ids: {},
188
+ params: {order: order, query: query, limit: limit, fields: fields, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max}.merge(kwargs).compact,
189
+ body: {},
190
+ entity: nil,
191
+ )
192
+ end
193
+
194
+ end
195
+
196
+ sig do
197
+ params(
198
+ body: T.untyped,
199
+ kwargs: T.untyped
200
+ ).returns(T.untyped)
201
+ end
202
+ def disable(
203
+ body: nil,
204
+ **kwargs
205
+ )
206
+ self.class.request(
207
+ http_method: :post,
208
+ operation: :disable,
209
+ session: @session,
210
+ ids: {id: @id},
211
+ params: {}.merge(kwargs).compact,
212
+ body: body,
213
+ entity: self,
214
+ )
215
+ end
216
+
217
+ end
218
+ end
@@ -0,0 +1,118 @@
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
@@ -0,0 +1,157 @@
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
@@ -0,0 +1,108 @@
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