shopify_api 14.3.0 → 14.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/BREAKING_CHANGES_FOR_V15.md +42 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +2 -2
- data/README.md +3 -0
- data/docs/usage/custom_apps.md +32 -1
- data/docs/usage/oauth.md +88 -16
- data/docs/usage/webhooks.md +3 -2
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/clients/graphql/client.rb +14 -3
- data/lib/shopify_api/clients/graphql/storefront.rb +12 -2
- data/lib/shopify_api/rest/base.rb +7 -1
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2022_07/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2022_10/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_10/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2023_01/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2023_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2023_07/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_07/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_07/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2023_10/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_10/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2024_01/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2024_01/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2024_01/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2024_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2024_04/shop.rb +12 -2
- data/lib/shopify_api/rest/resources/2024_07/abandoned_checkout.rb +194 -0
- data/lib/shopify_api/rest/resources/2024_07/access_scope.rb +62 -0
- data/lib/shopify_api/rest/resources/2024_07/apple_pay_certificate.rb +109 -0
- data/lib/shopify_api/rest/resources/2024_07/application_charge.rb +113 -0
- data/lib/shopify_api/rest/resources/2024_07/application_credit.rb +95 -0
- data/lib/shopify_api/rest/resources/2024_07/article.rb +269 -0
- data/lib/shopify_api/rest/resources/2024_07/asset.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_07/assigned_fulfillment_order.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_07/balance.rb +58 -0
- data/lib/shopify_api/rest/resources/2024_07/blog.rb +166 -0
- data/lib/shopify_api/rest/resources/2024_07/cancellation_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_07/carrier_service.rb +120 -0
- data/lib/shopify_api/rest/resources/2024_07/checkout.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_07/collect.rb +146 -0
- data/lib/shopify_api/rest/resources/2024_07/collection.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/collection_listing.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_07/comment.rb +287 -0
- data/lib/shopify_api/rest/resources/2024_07/country.rb +141 -0
- data/lib/shopify_api/rest/resources/2024_07/currency.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_07/custom_collection.rb +191 -0
- data/lib/shopify_api/rest/resources/2024_07/customer.rb +335 -0
- data/lib/shopify_api/rest/resources/2024_07/customer_address.rb +215 -0
- data/lib/shopify_api/rest/resources/2024_07/deprecated_api_call.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_07/discount_code.rb +226 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute.rb +115 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute_evidence.rb +121 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute_file_upload.rb +85 -0
- data/lib/shopify_api/rest/resources/2024_07/draft_order.rb +279 -0
- data/lib/shopify_api/rest/resources/2024_07/event.rb +152 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment.rb +235 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_event.rb +167 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_order.rb +326 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_request.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_service.rb +134 -0
- data/lib/shopify_api/rest/resources/2024_07/gift_card.rb +222 -0
- data/lib/shopify_api/rest/resources/2024_07/gift_card_adjustment.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_07/image.rb +161 -0
- data/lib/shopify_api/rest/resources/2024_07/inventory_item.rb +112 -0
- data/lib/shopify_api/rest/resources/2024_07/inventory_level.rb +183 -0
- data/lib/shopify_api/rest/resources/2024_07/location.rb +171 -0
- data/lib/shopify_api/rest/resources/2024_07/locations_for_move.rb +60 -0
- data/lib/shopify_api/rest/resources/2024_07/marketing_event.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_07/metafield.rb +348 -0
- data/lib/shopify_api/rest/resources/2024_07/mobile_platform_application.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/order.rb +489 -0
- data/lib/shopify_api/rest/resources/2024_07/order_risk.rb +148 -0
- data/lib/shopify_api/rest/resources/2024_07/page.rb +198 -0
- data/lib/shopify_api/rest/resources/2024_07/payment.rb +144 -0
- data/lib/shopify_api/rest/resources/2024_07/payment_gateway.rb +147 -0
- data/lib/shopify_api/rest/resources/2024_07/payment_transaction.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/payout.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_07/policy.rb +73 -0
- data/lib/shopify_api/rest/resources/2024_07/price_rule.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_07/product.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_07/product_listing.rb +200 -0
- data/lib/shopify_api/rest/resources/2024_07/product_resource_feedback.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_07/province.rb +136 -0
- data/lib/shopify_api/rest/resources/2024_07/recurring_application_charge.rb +184 -0
- data/lib/shopify_api/rest/resources/2024_07/redirect.rb +143 -0
- data/lib/shopify_api/rest/resources/2024_07/refund.rb +155 -0
- data/lib/shopify_api/rest/resources/2024_07/resource_feedback.rb +77 -0
- data/lib/shopify_api/rest/resources/2024_07/script_tag.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_07/shipping_zone.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_07/shop.rb +232 -0
- data/lib/shopify_api/rest/resources/2024_07/smart_collection.rb +220 -0
- data/lib/shopify_api/rest/resources/2024_07/storefront_access_token.rb +91 -0
- data/lib/shopify_api/rest/resources/2024_07/tender_transaction.rb +97 -0
- data/lib/shopify_api/rest/resources/2024_07/theme.rb +127 -0
- data/lib/shopify_api/rest/resources/2024_07/transaction.rb +188 -0
- data/lib/shopify_api/rest/resources/2024_07/usage_charge.rb +106 -0
- data/lib/shopify_api/rest/resources/2024_07/user.rb +142 -0
- data/lib/shopify_api/rest/resources/2024_07/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2024_07/webhook.rb +172 -0
- data/lib/shopify_api/utils/attributes_comparator.rb +21 -4
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +5 -4
- data/sorbet/rbi/shims/hash.rb +3 -0
- metadata +81 -6
@@ -0,0 +1,112 @@
|
|
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
|
+
@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
16
|
+
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
17
|
+
|
18
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
19
|
+
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
|
20
|
+
|
21
|
+
@cost = T.let(nil, T.nilable(String))
|
22
|
+
@country_code_of_origin = T.let(nil, T.nilable(String))
|
23
|
+
@country_harmonized_system_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
|
24
|
+
@created_at = T.let(nil, T.nilable(String))
|
25
|
+
@harmonized_system_code = T.let(nil, T.nilable(T.any(Integer, String)))
|
26
|
+
@id = T.let(nil, T.nilable(Integer))
|
27
|
+
@province_code_of_origin = T.let(nil, T.nilable(String))
|
28
|
+
@requires_shipping = T.let(nil, T.nilable(T::Boolean))
|
29
|
+
@sku = T.let(nil, T.nilable(String))
|
30
|
+
@tracked = T.let(nil, T.nilable(T::Boolean))
|
31
|
+
@updated_at = T.let(nil, T.nilable(String))
|
32
|
+
|
33
|
+
super(session: session, from_hash: from_hash)
|
34
|
+
end
|
35
|
+
|
36
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
37
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
38
|
+
@paths = T.let([
|
39
|
+
{http_method: :get, operation: :get, ids: [], path: "inventory_items.json"},
|
40
|
+
{http_method: :get, operation: :get, ids: [:id], path: "inventory_items/<id>.json"},
|
41
|
+
{http_method: :put, operation: :put, ids: [:id], path: "inventory_items/<id>.json"}
|
42
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
43
|
+
|
44
|
+
sig { returns(T.nilable(String)) }
|
45
|
+
attr_reader :cost
|
46
|
+
sig { returns(T.nilable(String)) }
|
47
|
+
attr_reader :country_code_of_origin
|
48
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
49
|
+
attr_reader :country_harmonized_system_codes
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_reader :created_at
|
52
|
+
sig { returns(T.nilable(T.any(Integer, String))) }
|
53
|
+
attr_reader :harmonized_system_code
|
54
|
+
sig { returns(T.nilable(Integer)) }
|
55
|
+
attr_reader :id
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :province_code_of_origin
|
58
|
+
sig { returns(T.nilable(T::Boolean)) }
|
59
|
+
attr_reader :requires_shipping
|
60
|
+
sig { returns(T.nilable(String)) }
|
61
|
+
attr_reader :sku
|
62
|
+
sig { returns(T.nilable(T::Boolean)) }
|
63
|
+
attr_reader :tracked
|
64
|
+
sig { returns(T.nilable(String)) }
|
65
|
+
attr_reader :updated_at
|
66
|
+
|
67
|
+
class << self
|
68
|
+
sig do
|
69
|
+
params(
|
70
|
+
id: T.any(Integer, String),
|
71
|
+
session: Auth::Session
|
72
|
+
).returns(T.nilable(InventoryItem))
|
73
|
+
end
|
74
|
+
def find(
|
75
|
+
id:,
|
76
|
+
session: ShopifyAPI::Context.active_session
|
77
|
+
)
|
78
|
+
result = base_find(
|
79
|
+
session: session,
|
80
|
+
ids: {id: id},
|
81
|
+
params: {},
|
82
|
+
)
|
83
|
+
T.cast(result[0], T.nilable(InventoryItem))
|
84
|
+
end
|
85
|
+
|
86
|
+
sig do
|
87
|
+
params(
|
88
|
+
ids: T.untyped,
|
89
|
+
limit: T.untyped,
|
90
|
+
session: Auth::Session,
|
91
|
+
kwargs: T.untyped
|
92
|
+
).returns(T::Array[InventoryItem])
|
93
|
+
end
|
94
|
+
def all(
|
95
|
+
ids: nil,
|
96
|
+
limit: nil,
|
97
|
+
session: ShopifyAPI::Context.active_session,
|
98
|
+
**kwargs
|
99
|
+
)
|
100
|
+
response = base_find(
|
101
|
+
session: session,
|
102
|
+
ids: {},
|
103
|
+
params: {ids: ids, limit: limit}.merge(kwargs).compact,
|
104
|
+
)
|
105
|
+
|
106
|
+
T.cast(response, T::Array[InventoryItem])
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,183 @@
|
|
1
|
+
# typed: false
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
########################################################################################################################
|
5
|
+
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
|
6
|
+
########################################################################################################################
|
7
|
+
|
8
|
+
module ShopifyAPI
|
9
|
+
class InventoryLevel < ShopifyAPI::Rest::Base
|
10
|
+
extend T::Sig
|
11
|
+
|
12
|
+
@prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
13
|
+
@next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
14
|
+
|
15
|
+
@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
16
|
+
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
17
|
+
|
18
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
19
|
+
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
|
20
|
+
|
21
|
+
@available = T.let(nil, T.nilable(Integer))
|
22
|
+
@inventory_item_id = T.let(nil, T.nilable(Integer))
|
23
|
+
@location_id = T.let(nil, T.nilable(Integer))
|
24
|
+
@updated_at = T.let(nil, T.nilable(String))
|
25
|
+
|
26
|
+
super(session: session, from_hash: from_hash)
|
27
|
+
end
|
28
|
+
|
29
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
30
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
31
|
+
@paths = T.let([
|
32
|
+
{http_method: :delete, operation: :delete, ids: [], path: "inventory_levels.json"},
|
33
|
+
{http_method: :get, operation: :get, ids: [], path: "inventory_levels.json"},
|
34
|
+
{http_method: :post, operation: :adjust, ids: [], path: "inventory_levels/adjust.json"},
|
35
|
+
{http_method: :post, operation: :connect, ids: [], path: "inventory_levels/connect.json"},
|
36
|
+
{http_method: :post, operation: :set, ids: [], path: "inventory_levels/set.json"}
|
37
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
38
|
+
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
40
|
+
attr_reader :available
|
41
|
+
sig { returns(T.nilable(Integer)) }
|
42
|
+
attr_reader :inventory_item_id
|
43
|
+
sig { returns(T.nilable(Integer)) }
|
44
|
+
attr_reader :location_id
|
45
|
+
sig { returns(T.nilable(String)) }
|
46
|
+
attr_reader :updated_at
|
47
|
+
|
48
|
+
class << self
|
49
|
+
sig do
|
50
|
+
params(
|
51
|
+
inventory_item_id: T.untyped,
|
52
|
+
location_id: T.untyped,
|
53
|
+
session: Auth::Session
|
54
|
+
).returns(T.untyped)
|
55
|
+
end
|
56
|
+
def delete(
|
57
|
+
inventory_item_id: nil,
|
58
|
+
location_id: nil,
|
59
|
+
session: ShopifyAPI::Context.active_session
|
60
|
+
)
|
61
|
+
request(
|
62
|
+
http_method: :delete,
|
63
|
+
operation: :delete,
|
64
|
+
session: session,
|
65
|
+
ids: {},
|
66
|
+
params: {inventory_item_id: inventory_item_id, location_id: location_id},
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
sig do
|
71
|
+
params(
|
72
|
+
inventory_item_ids: T.untyped,
|
73
|
+
location_ids: T.untyped,
|
74
|
+
limit: T.untyped,
|
75
|
+
updated_at_min: T.untyped,
|
76
|
+
session: Auth::Session,
|
77
|
+
kwargs: T.untyped
|
78
|
+
).returns(T::Array[InventoryLevel])
|
79
|
+
end
|
80
|
+
def all(
|
81
|
+
inventory_item_ids: nil,
|
82
|
+
location_ids: nil,
|
83
|
+
limit: nil,
|
84
|
+
updated_at_min: nil,
|
85
|
+
session: ShopifyAPI::Context.active_session,
|
86
|
+
**kwargs
|
87
|
+
)
|
88
|
+
response = base_find(
|
89
|
+
session: session,
|
90
|
+
ids: {},
|
91
|
+
params: {inventory_item_ids: inventory_item_ids, location_ids: location_ids, limit: limit, updated_at_min: updated_at_min}.merge(kwargs).compact,
|
92
|
+
)
|
93
|
+
|
94
|
+
T.cast(response, T::Array[InventoryLevel])
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
sig do
|
100
|
+
params(
|
101
|
+
inventory_item_id: T.untyped,
|
102
|
+
location_id: T.untyped,
|
103
|
+
available_adjustment: T.untyped,
|
104
|
+
body: T.untyped,
|
105
|
+
kwargs: T.untyped
|
106
|
+
).returns(T.untyped)
|
107
|
+
end
|
108
|
+
def adjust(
|
109
|
+
inventory_item_id: nil,
|
110
|
+
location_id: nil,
|
111
|
+
available_adjustment: nil,
|
112
|
+
body: nil,
|
113
|
+
**kwargs
|
114
|
+
)
|
115
|
+
self.class.request(
|
116
|
+
http_method: :post,
|
117
|
+
operation: :adjust,
|
118
|
+
session: @session,
|
119
|
+
ids: {},
|
120
|
+
params: {inventory_item_id: inventory_item_id, location_id: location_id, available_adjustment: available_adjustment}.merge(kwargs).compact,
|
121
|
+
body: body,
|
122
|
+
entity: self,
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
sig do
|
127
|
+
params(
|
128
|
+
inventory_item_id: T.untyped,
|
129
|
+
location_id: T.untyped,
|
130
|
+
relocate_if_necessary: T.untyped,
|
131
|
+
body: T.untyped,
|
132
|
+
kwargs: T.untyped
|
133
|
+
).returns(T.untyped)
|
134
|
+
end
|
135
|
+
def connect(
|
136
|
+
inventory_item_id: nil,
|
137
|
+
location_id: nil,
|
138
|
+
relocate_if_necessary: nil,
|
139
|
+
body: nil,
|
140
|
+
**kwargs
|
141
|
+
)
|
142
|
+
self.class.request(
|
143
|
+
http_method: :post,
|
144
|
+
operation: :connect,
|
145
|
+
session: @session,
|
146
|
+
ids: {},
|
147
|
+
params: {inventory_item_id: inventory_item_id, location_id: location_id, relocate_if_necessary: relocate_if_necessary}.merge(kwargs).compact,
|
148
|
+
body: body,
|
149
|
+
entity: self,
|
150
|
+
)
|
151
|
+
end
|
152
|
+
|
153
|
+
sig do
|
154
|
+
params(
|
155
|
+
inventory_item_id: T.untyped,
|
156
|
+
location_id: T.untyped,
|
157
|
+
available: T.untyped,
|
158
|
+
disconnect_if_necessary: T.untyped,
|
159
|
+
body: T.untyped,
|
160
|
+
kwargs: T.untyped
|
161
|
+
).returns(T.untyped)
|
162
|
+
end
|
163
|
+
def set(
|
164
|
+
inventory_item_id: nil,
|
165
|
+
location_id: nil,
|
166
|
+
available: nil,
|
167
|
+
disconnect_if_necessary: nil,
|
168
|
+
body: nil,
|
169
|
+
**kwargs
|
170
|
+
)
|
171
|
+
self.class.request(
|
172
|
+
http_method: :post,
|
173
|
+
operation: :set,
|
174
|
+
session: @session,
|
175
|
+
ids: {},
|
176
|
+
params: {inventory_item_id: inventory_item_id, location_id: location_id, available: available, disconnect_if_necessary: disconnect_if_necessary}.merge(kwargs).compact,
|
177
|
+
body: body,
|
178
|
+
entity: self,
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
end
|
183
|
+
end
|
@@ -0,0 +1,171 @@
|
|
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 Location < 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
|
+
@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
16
|
+
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
17
|
+
|
18
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
19
|
+
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
|
20
|
+
|
21
|
+
@active = T.let(nil, T.nilable(T::Boolean))
|
22
|
+
@address1 = T.let(nil, T.nilable(String))
|
23
|
+
@address2 = T.let(nil, T.nilable(String))
|
24
|
+
@city = T.let(nil, T.nilable(String))
|
25
|
+
@country = T.let(nil, T.nilable(String))
|
26
|
+
@country_code = T.let(nil, T.nilable(String))
|
27
|
+
@created_at = T.let(nil, T.nilable(String))
|
28
|
+
@id = T.let(nil, T.nilable(Integer))
|
29
|
+
@legacy = T.let(nil, T.nilable(T::Boolean))
|
30
|
+
@localized_country_name = T.let(nil, T.nilable(String))
|
31
|
+
@localized_province_name = T.let(nil, T.nilable(String))
|
32
|
+
@name = T.let(nil, T.nilable(String))
|
33
|
+
@phone = T.let(nil, T.nilable(String))
|
34
|
+
@province = T.let(nil, T.nilable(String))
|
35
|
+
@province_code = T.let(nil, T.nilable(String))
|
36
|
+
@updated_at = T.let(nil, T.nilable(String))
|
37
|
+
@zip = T.let(nil, T.nilable(String))
|
38
|
+
|
39
|
+
super(session: session, from_hash: from_hash)
|
40
|
+
end
|
41
|
+
|
42
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
43
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
44
|
+
@paths = T.let([
|
45
|
+
{http_method: :get, operation: :count, ids: [], path: "locations/count.json"},
|
46
|
+
{http_method: :get, operation: :get, ids: [], path: "locations.json"},
|
47
|
+
{http_method: :get, operation: :get, ids: [:id], path: "locations/<id>.json"},
|
48
|
+
{http_method: :get, operation: :inventory_levels, ids: [:id], path: "locations/<id>/inventory_levels.json"}
|
49
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
50
|
+
|
51
|
+
sig { returns(T.nilable(T::Boolean)) }
|
52
|
+
attr_reader :active
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :address1
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :address2
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :city
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :country
|
61
|
+
sig { returns(T.nilable(String)) }
|
62
|
+
attr_reader :country_code
|
63
|
+
sig { returns(T.nilable(String)) }
|
64
|
+
attr_reader :created_at
|
65
|
+
sig { returns(T.nilable(Integer)) }
|
66
|
+
attr_reader :id
|
67
|
+
sig { returns(T.nilable(T::Boolean)) }
|
68
|
+
attr_reader :legacy
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :localized_country_name
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :localized_province_name
|
73
|
+
sig { returns(T.nilable(String)) }
|
74
|
+
attr_reader :name
|
75
|
+
sig { returns(T.nilable(String)) }
|
76
|
+
attr_reader :phone
|
77
|
+
sig { returns(T.nilable(String)) }
|
78
|
+
attr_reader :province
|
79
|
+
sig { returns(T.nilable(String)) }
|
80
|
+
attr_reader :province_code
|
81
|
+
sig { returns(T.nilable(String)) }
|
82
|
+
attr_reader :updated_at
|
83
|
+
sig { returns(T.nilable(String)) }
|
84
|
+
attr_reader :zip
|
85
|
+
|
86
|
+
class << self
|
87
|
+
sig do
|
88
|
+
params(
|
89
|
+
id: T.any(Integer, String),
|
90
|
+
session: Auth::Session
|
91
|
+
).returns(T.nilable(Location))
|
92
|
+
end
|
93
|
+
def find(
|
94
|
+
id:,
|
95
|
+
session: ShopifyAPI::Context.active_session
|
96
|
+
)
|
97
|
+
result = base_find(
|
98
|
+
session: session,
|
99
|
+
ids: {id: id},
|
100
|
+
params: {},
|
101
|
+
)
|
102
|
+
T.cast(result[0], T.nilable(Location))
|
103
|
+
end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
params(
|
107
|
+
session: Auth::Session,
|
108
|
+
kwargs: T.untyped
|
109
|
+
).returns(T::Array[Location])
|
110
|
+
end
|
111
|
+
def all(
|
112
|
+
session: ShopifyAPI::Context.active_session,
|
113
|
+
**kwargs
|
114
|
+
)
|
115
|
+
response = base_find(
|
116
|
+
session: session,
|
117
|
+
ids: {},
|
118
|
+
params: {}.merge(kwargs).compact,
|
119
|
+
)
|
120
|
+
|
121
|
+
T.cast(response, T::Array[Location])
|
122
|
+
end
|
123
|
+
|
124
|
+
sig do
|
125
|
+
params(
|
126
|
+
session: Auth::Session,
|
127
|
+
kwargs: T.untyped
|
128
|
+
).returns(T.untyped)
|
129
|
+
end
|
130
|
+
def count(
|
131
|
+
session: ShopifyAPI::Context.active_session,
|
132
|
+
**kwargs
|
133
|
+
)
|
134
|
+
request(
|
135
|
+
http_method: :get,
|
136
|
+
operation: :count,
|
137
|
+
session: session,
|
138
|
+
ids: {},
|
139
|
+
params: {}.merge(kwargs).compact,
|
140
|
+
body: {},
|
141
|
+
entity: nil,
|
142
|
+
)
|
143
|
+
end
|
144
|
+
|
145
|
+
sig do
|
146
|
+
params(
|
147
|
+
id: T.any(Integer, String),
|
148
|
+
session: Auth::Session,
|
149
|
+
kwargs: T.untyped
|
150
|
+
).returns(T.untyped)
|
151
|
+
end
|
152
|
+
def inventory_levels(
|
153
|
+
id:,
|
154
|
+
session: ShopifyAPI::Context.active_session,
|
155
|
+
**kwargs
|
156
|
+
)
|
157
|
+
request(
|
158
|
+
http_method: :get,
|
159
|
+
operation: :inventory_levels,
|
160
|
+
session: session,
|
161
|
+
ids: {id: id},
|
162
|
+
params: {}.merge(kwargs).compact,
|
163
|
+
body: {},
|
164
|
+
entity: nil,
|
165
|
+
)
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
169
|
+
|
170
|
+
end
|
171
|
+
end
|
@@ -0,0 +1,60 @@
|
|
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 LocationsForMove < 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
|
+
@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
16
|
+
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
|
17
|
+
|
18
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
19
|
+
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
|
20
|
+
|
21
|
+
@locations_for_move = T.let(nil, T.nilable(T::Array[T.untyped]))
|
22
|
+
|
23
|
+
super(session: session, from_hash: from_hash)
|
24
|
+
end
|
25
|
+
|
26
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
27
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
28
|
+
@paths = T.let([
|
29
|
+
{http_method: :get, operation: :get, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/locations_for_move.json"}
|
30
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
31
|
+
|
32
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
33
|
+
attr_reader :locations_for_move
|
34
|
+
|
35
|
+
class << self
|
36
|
+
sig do
|
37
|
+
params(
|
38
|
+
fulfillment_order_id: T.nilable(T.any(Integer, String)),
|
39
|
+
session: Auth::Session,
|
40
|
+
kwargs: T.untyped
|
41
|
+
).returns(T::Array[LocationsForMove])
|
42
|
+
end
|
43
|
+
def all(
|
44
|
+
fulfillment_order_id: nil,
|
45
|
+
session: ShopifyAPI::Context.active_session,
|
46
|
+
**kwargs
|
47
|
+
)
|
48
|
+
response = base_find(
|
49
|
+
session: session,
|
50
|
+
ids: {fulfillment_order_id: fulfillment_order_id},
|
51
|
+
params: {}.merge(kwargs).compact,
|
52
|
+
)
|
53
|
+
|
54
|
+
T.cast(response, T::Array[LocationsForMove])
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|