shopify_api 13.0.0 → 13.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +7 -7
- data/README.md +0 -7
- data/docs/getting_started.md +1 -8
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/context.rb +1 -0
- data/lib/shopify_api/rest/base.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -7
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -7
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -7
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +3 -7
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_07/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2023_07/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2023_07/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2023_07/application_charge.rb +109 -0
- data/lib/shopify_api/rest/resources/2023_07/application_credit.rb +91 -0
- data/lib/shopify_api/rest/resources/2023_07/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2023_07/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +86 -0
- data/lib/shopify_api/rest/resources/2023_07/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2023_07/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2023_07/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_07/carrier_service.rb +116 -0
- data/lib/shopify_api/rest/resources/2023_07/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_07/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2023_07/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_07/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_07/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2023_07/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2023_07/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_07/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2023_07/customer.rb +329 -0
- data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2023_07/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2023_07/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_07/discount_code.rb +222 -0
- data/lib/shopify_api/rest/resources/2023_07/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2023_07/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2023_07/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/2023_07/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2023_07/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment.rb +231 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment_order.rb +312 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2023_07/gift_card.rb +218 -0
- data/lib/shopify_api/rest/resources/2023_07/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_07/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2023_07/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2023_07/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_07/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2023_07/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_07/metafield.rb +344 -0
- data/lib/shopify_api/rest/resources/2023_07/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_07/order.rb +488 -0
- data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +142 -0
- data/lib/shopify_api/rest/resources/2023_07/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2023_07/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2023_07/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2023_07/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2023_07/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_07/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2023_07/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_07/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_07/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2023_07/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2023_07/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2023_07/recurring_application_charge.rb +172 -0
- data/lib/shopify_api/rest/resources/2023_07/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2023_07/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2023_07/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2023_07/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_07/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_07/shop.rb +221 -0
- data/lib/shopify_api/rest/resources/2023_07/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2023_07/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_07/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2023_07/theme.rb +123 -0
- data/lib/shopify_api/rest/resources/2023_07/transaction.rb +184 -0
- data/lib/shopify_api/rest/resources/2023_07/usage_charge.rb +102 -0
- data/lib/shopify_api/rest/resources/2023_07/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2023_07/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2023_07/webhook.rb +168 -0
- data/lib/shopify_api/version.rb +1 -1
- data/shopify_api.gemspec +1 -1
- metadata +77 -9
@@ -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
|