shopify_api 12.3.0 → 12.4.0

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