shopify_api 13.1.0 → 13.2.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_V10.md +231 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +5 -5
- data/README.md +10 -34
- data/docs/README.md +0 -1
- data/docs/getting_started.md +20 -3
- data/docs/usage/custom_apps.md +75 -0
- data/docs/usage/graphql.md +63 -18
- data/docs/usage/oauth.md +160 -27
- data/docs/usage/rest.md +204 -62
- data/docs/usage/webhooks.md +22 -4
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/context.rb +5 -3
- data/lib/shopify_api/rest/base.rb +22 -14
- data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
- data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
- data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
- data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
- data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
- data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
- data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
- data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
- data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
- data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
- data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
- data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
- data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
- data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
- data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
- data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
- data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
- data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
- data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
- data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
- data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
- data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
- data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
- data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
- data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
- data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
- data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
- data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
- data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
- data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
- data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registration.rb +19 -4
- data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
- data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
- data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
- data/lib/shopify_api/webhooks/registry.rb +9 -5
- metadata +80 -6
- data/.github/workflows/stale.yml +0 -43
- data/docs/issues.md +0 -39
- data/docs/usage/session_storage.md +0 -46
@@ -0,0 +1,69 @@
|
|
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 Policy < 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
|
+
@body = T.let(nil, T.nilable(String))
|
20
|
+
@created_at = T.let(nil, T.nilable(String))
|
21
|
+
@handle = T.let(nil, T.nilable(String))
|
22
|
+
@title = T.let(nil, T.nilable(String))
|
23
|
+
@updated_at = T.let(nil, T.nilable(String))
|
24
|
+
@url = T.let(nil, T.nilable(String))
|
25
|
+
end
|
26
|
+
|
27
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
28
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
29
|
+
@paths = T.let([
|
30
|
+
{http_method: :get, operation: :get, ids: [], path: "policies.json"}
|
31
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
32
|
+
|
33
|
+
sig { returns(T.nilable(String)) }
|
34
|
+
attr_reader :body
|
35
|
+
sig { returns(T.nilable(String)) }
|
36
|
+
attr_reader :created_at
|
37
|
+
sig { returns(T.nilable(String)) }
|
38
|
+
attr_reader :handle
|
39
|
+
sig { returns(T.nilable(String)) }
|
40
|
+
attr_reader :title
|
41
|
+
sig { returns(T.nilable(String)) }
|
42
|
+
attr_reader :updated_at
|
43
|
+
sig { returns(T.nilable(String)) }
|
44
|
+
attr_reader :url
|
45
|
+
|
46
|
+
class << self
|
47
|
+
sig do
|
48
|
+
params(
|
49
|
+
session: Auth::Session,
|
50
|
+
kwargs: T.untyped
|
51
|
+
).returns(T::Array[Policy])
|
52
|
+
end
|
53
|
+
def all(
|
54
|
+
session: ShopifyAPI::Context.active_session,
|
55
|
+
**kwargs
|
56
|
+
)
|
57
|
+
response = base_find(
|
58
|
+
session: session,
|
59
|
+
ids: {},
|
60
|
+
params: {}.merge(kwargs).compact,
|
61
|
+
)
|
62
|
+
|
63
|
+
T.cast(response, T::Array[Policy])
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,223 @@
|
|
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 PriceRule < 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
|
+
@allocation_limit = T.let(nil, T.nilable(Integer))
|
20
|
+
@allocation_method = T.let(nil, T.nilable(String))
|
21
|
+
@created_at = T.let(nil, T.nilable(String))
|
22
|
+
@customer_segment_prerequisite_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
23
|
+
@customer_selection = T.let(nil, T.nilable(String))
|
24
|
+
@ends_at = T.let(nil, T.nilable(String))
|
25
|
+
@entitled_collection_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
26
|
+
@entitled_country_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
27
|
+
@entitled_product_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
28
|
+
@entitled_variant_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
29
|
+
@id = T.let(nil, T.nilable(Integer))
|
30
|
+
@once_per_customer = T.let(nil, T.nilable(T::Boolean))
|
31
|
+
@prerequisite_collection_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
32
|
+
@prerequisite_customer_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
33
|
+
@prerequisite_product_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
34
|
+
@prerequisite_quantity_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
35
|
+
@prerequisite_shipping_price_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
|
+
@prerequisite_subtotal_range = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
37
|
+
@prerequisite_to_entitlement_purchase = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
38
|
+
@prerequisite_to_entitlement_quantity_ratio = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
39
|
+
@prerequisite_variant_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
|
40
|
+
@starts_at = T.let(nil, T.nilable(String))
|
41
|
+
@target_selection = T.let(nil, T.nilable(String))
|
42
|
+
@target_type = T.let(nil, T.nilable(String))
|
43
|
+
@title = T.let(nil, T.nilable(String))
|
44
|
+
@updated_at = T.let(nil, T.nilable(String))
|
45
|
+
@usage_limit = T.let(nil, T.nilable(Integer))
|
46
|
+
@value = T.let(nil, T.nilable(String))
|
47
|
+
@value_type = T.let(nil, T.nilable(String))
|
48
|
+
end
|
49
|
+
|
50
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
51
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
52
|
+
@paths = T.let([
|
53
|
+
{http_method: :delete, operation: :delete, ids: [:id], path: "price_rules/<id>.json"},
|
54
|
+
{http_method: :get, operation: :count, ids: [], path: "price_rules/count.json"},
|
55
|
+
{http_method: :get, operation: :get, ids: [], path: "price_rules.json"},
|
56
|
+
{http_method: :get, operation: :get, ids: [:id], path: "price_rules/<id>.json"},
|
57
|
+
{http_method: :post, operation: :post, ids: [], path: "price_rules.json"},
|
58
|
+
{http_method: :put, operation: :put, ids: [:id], path: "price_rules/<id>.json"}
|
59
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
60
|
+
|
61
|
+
sig { returns(T.nilable(Integer)) }
|
62
|
+
attr_reader :allocation_limit
|
63
|
+
sig { returns(T.nilable(String)) }
|
64
|
+
attr_reader :allocation_method
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :created_at
|
67
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
68
|
+
attr_reader :customer_segment_prerequisite_ids
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :customer_selection
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :ends_at
|
73
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
74
|
+
attr_reader :entitled_collection_ids
|
75
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
76
|
+
attr_reader :entitled_country_ids
|
77
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
78
|
+
attr_reader :entitled_product_ids
|
79
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
80
|
+
attr_reader :entitled_variant_ids
|
81
|
+
sig { returns(T.nilable(Integer)) }
|
82
|
+
attr_reader :id
|
83
|
+
sig { returns(T.nilable(T::Boolean)) }
|
84
|
+
attr_reader :once_per_customer
|
85
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
86
|
+
attr_reader :prerequisite_collection_ids
|
87
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
88
|
+
attr_reader :prerequisite_customer_ids
|
89
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
90
|
+
attr_reader :prerequisite_product_ids
|
91
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
92
|
+
attr_reader :prerequisite_quantity_range
|
93
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
94
|
+
attr_reader :prerequisite_shipping_price_range
|
95
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
96
|
+
attr_reader :prerequisite_subtotal_range
|
97
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
98
|
+
attr_reader :prerequisite_to_entitlement_purchase
|
99
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
100
|
+
attr_reader :prerequisite_to_entitlement_quantity_ratio
|
101
|
+
sig { returns(T.nilable(T::Array[Integer])) }
|
102
|
+
attr_reader :prerequisite_variant_ids
|
103
|
+
sig { returns(T.nilable(String)) }
|
104
|
+
attr_reader :starts_at
|
105
|
+
sig { returns(T.nilable(String)) }
|
106
|
+
attr_reader :target_selection
|
107
|
+
sig { returns(T.nilable(String)) }
|
108
|
+
attr_reader :target_type
|
109
|
+
sig { returns(T.nilable(String)) }
|
110
|
+
attr_reader :title
|
111
|
+
sig { returns(T.nilable(String)) }
|
112
|
+
attr_reader :updated_at
|
113
|
+
sig { returns(T.nilable(Integer)) }
|
114
|
+
attr_reader :usage_limit
|
115
|
+
sig { returns(T.nilable(String)) }
|
116
|
+
attr_reader :value
|
117
|
+
sig { returns(T.nilable(String)) }
|
118
|
+
attr_reader :value_type
|
119
|
+
|
120
|
+
class << self
|
121
|
+
sig do
|
122
|
+
params(
|
123
|
+
id: T.any(Integer, String),
|
124
|
+
session: Auth::Session
|
125
|
+
).returns(T.nilable(PriceRule))
|
126
|
+
end
|
127
|
+
def find(
|
128
|
+
id:,
|
129
|
+
session: ShopifyAPI::Context.active_session
|
130
|
+
)
|
131
|
+
result = base_find(
|
132
|
+
session: session,
|
133
|
+
ids: {id: id},
|
134
|
+
params: {},
|
135
|
+
)
|
136
|
+
T.cast(result[0], T.nilable(PriceRule))
|
137
|
+
end
|
138
|
+
|
139
|
+
sig do
|
140
|
+
params(
|
141
|
+
id: T.any(Integer, String),
|
142
|
+
session: Auth::Session
|
143
|
+
).returns(T.untyped)
|
144
|
+
end
|
145
|
+
def delete(
|
146
|
+
id:,
|
147
|
+
session: ShopifyAPI::Context.active_session
|
148
|
+
)
|
149
|
+
request(
|
150
|
+
http_method: :delete,
|
151
|
+
operation: :delete,
|
152
|
+
session: session,
|
153
|
+
ids: {id: id},
|
154
|
+
params: {},
|
155
|
+
)
|
156
|
+
end
|
157
|
+
|
158
|
+
sig do
|
159
|
+
params(
|
160
|
+
limit: T.untyped,
|
161
|
+
since_id: T.untyped,
|
162
|
+
created_at_min: T.untyped,
|
163
|
+
created_at_max: T.untyped,
|
164
|
+
updated_at_min: T.untyped,
|
165
|
+
updated_at_max: T.untyped,
|
166
|
+
starts_at_min: T.untyped,
|
167
|
+
starts_at_max: T.untyped,
|
168
|
+
ends_at_min: T.untyped,
|
169
|
+
ends_at_max: T.untyped,
|
170
|
+
times_used: T.untyped,
|
171
|
+
session: Auth::Session,
|
172
|
+
kwargs: T.untyped
|
173
|
+
).returns(T::Array[PriceRule])
|
174
|
+
end
|
175
|
+
def all(
|
176
|
+
limit: nil,
|
177
|
+
since_id: nil,
|
178
|
+
created_at_min: nil,
|
179
|
+
created_at_max: nil,
|
180
|
+
updated_at_min: nil,
|
181
|
+
updated_at_max: nil,
|
182
|
+
starts_at_min: nil,
|
183
|
+
starts_at_max: nil,
|
184
|
+
ends_at_min: nil,
|
185
|
+
ends_at_max: nil,
|
186
|
+
times_used: nil,
|
187
|
+
session: ShopifyAPI::Context.active_session,
|
188
|
+
**kwargs
|
189
|
+
)
|
190
|
+
response = base_find(
|
191
|
+
session: session,
|
192
|
+
ids: {},
|
193
|
+
params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, starts_at_min: starts_at_min, starts_at_max: starts_at_max, ends_at_min: ends_at_min, ends_at_max: ends_at_max, times_used: times_used}.merge(kwargs).compact,
|
194
|
+
)
|
195
|
+
|
196
|
+
T.cast(response, T::Array[PriceRule])
|
197
|
+
end
|
198
|
+
|
199
|
+
sig do
|
200
|
+
params(
|
201
|
+
session: Auth::Session,
|
202
|
+
kwargs: T.untyped
|
203
|
+
).returns(T.untyped)
|
204
|
+
end
|
205
|
+
def count(
|
206
|
+
session: ShopifyAPI::Context.active_session,
|
207
|
+
**kwargs
|
208
|
+
)
|
209
|
+
request(
|
210
|
+
http_method: :get,
|
211
|
+
operation: :count,
|
212
|
+
session: session,
|
213
|
+
ids: {},
|
214
|
+
params: {}.merge(kwargs).compact,
|
215
|
+
body: {},
|
216
|
+
entity: nil,
|
217
|
+
)
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,223 @@
|
|
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 Product < 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
|
+
@title = T.let(nil, T.nilable(String))
|
20
|
+
@body_html = T.let(nil, T.nilable(String))
|
21
|
+
@created_at = T.let(nil, T.nilable(String))
|
22
|
+
@handle = T.let(nil, T.nilable(String))
|
23
|
+
@id = T.let(nil, T.nilable(Integer))
|
24
|
+
@images = T.let(nil, T.nilable(T::Array[T.untyped]))
|
25
|
+
@options = T.let(nil, T.nilable(T.any(T::Hash[T.untyped, T.untyped], T::Array[T.untyped])))
|
26
|
+
@product_type = T.let(nil, T.nilable(String))
|
27
|
+
@published_at = T.let(nil, T.nilable(String))
|
28
|
+
@published_scope = T.let(nil, T.nilable(String))
|
29
|
+
@status = T.let(nil, T.nilable(String))
|
30
|
+
@tags = T.let(nil, T.nilable(T.any(String, T::Array[T.untyped])))
|
31
|
+
@template_suffix = T.let(nil, T.nilable(String))
|
32
|
+
@updated_at = T.let(nil, T.nilable(String))
|
33
|
+
@variants = T.let(nil, T.nilable(T::Array[T.untyped]))
|
34
|
+
@vendor = T.let(nil, T.nilable(String))
|
35
|
+
end
|
36
|
+
|
37
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
38
|
+
@has_many = T.let({
|
39
|
+
images: Image,
|
40
|
+
variants: Variant
|
41
|
+
}, T::Hash[Symbol, Class])
|
42
|
+
@paths = T.let([
|
43
|
+
{http_method: :delete, operation: :delete, ids: [:id], path: "products/<id>.json"},
|
44
|
+
{http_method: :get, operation: :count, ids: [], path: "products/count.json"},
|
45
|
+
{http_method: :get, operation: :get, ids: [], path: "products.json"},
|
46
|
+
{http_method: :get, operation: :get, ids: [:id], path: "products/<id>.json"},
|
47
|
+
{http_method: :post, operation: :post, ids: [], path: "products.json"},
|
48
|
+
{http_method: :put, operation: :put, ids: [:id], path: "products/<id>.json"}
|
49
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
50
|
+
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :title
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :body_html
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :created_at
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :handle
|
59
|
+
sig { returns(T.nilable(Integer)) }
|
60
|
+
attr_reader :id
|
61
|
+
sig { returns(T.nilable(T::Array[Image])) }
|
62
|
+
attr_reader :images
|
63
|
+
sig { returns(T.nilable(T.any(T::Hash[T.untyped, T.untyped], T::Array[T::Hash[T.untyped, T.untyped]]))) }
|
64
|
+
attr_reader :options
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :product_type
|
67
|
+
sig { returns(T.nilable(String)) }
|
68
|
+
attr_reader :published_at
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :published_scope
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :status
|
73
|
+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
|
74
|
+
attr_reader :tags
|
75
|
+
sig { returns(T.nilable(String)) }
|
76
|
+
attr_reader :template_suffix
|
77
|
+
sig { returns(T.nilable(String)) }
|
78
|
+
attr_reader :updated_at
|
79
|
+
sig { returns(T.nilable(T::Array[Variant])) }
|
80
|
+
attr_reader :variants
|
81
|
+
sig { returns(T.nilable(String)) }
|
82
|
+
attr_reader :vendor
|
83
|
+
|
84
|
+
class << self
|
85
|
+
sig do
|
86
|
+
params(
|
87
|
+
id: T.any(Integer, String),
|
88
|
+
fields: T.untyped,
|
89
|
+
session: Auth::Session
|
90
|
+
).returns(T.nilable(Product))
|
91
|
+
end
|
92
|
+
def find(
|
93
|
+
id:,
|
94
|
+
fields: nil,
|
95
|
+
session: ShopifyAPI::Context.active_session
|
96
|
+
)
|
97
|
+
result = base_find(
|
98
|
+
session: session,
|
99
|
+
ids: {id: id},
|
100
|
+
params: {fields: fields},
|
101
|
+
)
|
102
|
+
T.cast(result[0], T.nilable(Product))
|
103
|
+
end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
params(
|
107
|
+
id: T.any(Integer, String),
|
108
|
+
session: Auth::Session
|
109
|
+
).returns(T.untyped)
|
110
|
+
end
|
111
|
+
def delete(
|
112
|
+
id:,
|
113
|
+
session: ShopifyAPI::Context.active_session
|
114
|
+
)
|
115
|
+
request(
|
116
|
+
http_method: :delete,
|
117
|
+
operation: :delete,
|
118
|
+
session: session,
|
119
|
+
ids: {id: id},
|
120
|
+
params: {},
|
121
|
+
)
|
122
|
+
end
|
123
|
+
|
124
|
+
sig do
|
125
|
+
params(
|
126
|
+
ids: T.untyped,
|
127
|
+
limit: T.untyped,
|
128
|
+
since_id: T.untyped,
|
129
|
+
title: T.untyped,
|
130
|
+
vendor: T.untyped,
|
131
|
+
handle: T.untyped,
|
132
|
+
product_type: T.untyped,
|
133
|
+
status: T.untyped,
|
134
|
+
collection_id: T.untyped,
|
135
|
+
created_at_min: T.untyped,
|
136
|
+
created_at_max: T.untyped,
|
137
|
+
updated_at_min: T.untyped,
|
138
|
+
updated_at_max: T.untyped,
|
139
|
+
published_at_min: T.untyped,
|
140
|
+
published_at_max: T.untyped,
|
141
|
+
published_status: T.untyped,
|
142
|
+
fields: T.untyped,
|
143
|
+
presentment_currencies: T.untyped,
|
144
|
+
session: Auth::Session,
|
145
|
+
kwargs: T.untyped
|
146
|
+
).returns(T::Array[Product])
|
147
|
+
end
|
148
|
+
def all(
|
149
|
+
ids: nil,
|
150
|
+
limit: nil,
|
151
|
+
since_id: nil,
|
152
|
+
title: nil,
|
153
|
+
vendor: nil,
|
154
|
+
handle: nil,
|
155
|
+
product_type: nil,
|
156
|
+
status: nil,
|
157
|
+
collection_id: nil,
|
158
|
+
created_at_min: nil,
|
159
|
+
created_at_max: nil,
|
160
|
+
updated_at_min: nil,
|
161
|
+
updated_at_max: nil,
|
162
|
+
published_at_min: nil,
|
163
|
+
published_at_max: nil,
|
164
|
+
published_status: nil,
|
165
|
+
fields: nil,
|
166
|
+
presentment_currencies: nil,
|
167
|
+
session: ShopifyAPI::Context.active_session,
|
168
|
+
**kwargs
|
169
|
+
)
|
170
|
+
response = base_find(
|
171
|
+
session: session,
|
172
|
+
ids: {},
|
173
|
+
params: {ids: ids, limit: limit, since_id: since_id, title: title, vendor: vendor, handle: handle, product_type: product_type, status: status, collection_id: collection_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status, fields: fields, presentment_currencies: presentment_currencies}.merge(kwargs).compact,
|
174
|
+
)
|
175
|
+
|
176
|
+
T.cast(response, T::Array[Product])
|
177
|
+
end
|
178
|
+
|
179
|
+
sig do
|
180
|
+
params(
|
181
|
+
vendor: T.untyped,
|
182
|
+
product_type: T.untyped,
|
183
|
+
collection_id: T.untyped,
|
184
|
+
created_at_min: T.untyped,
|
185
|
+
created_at_max: T.untyped,
|
186
|
+
updated_at_min: T.untyped,
|
187
|
+
updated_at_max: T.untyped,
|
188
|
+
published_at_min: T.untyped,
|
189
|
+
published_at_max: T.untyped,
|
190
|
+
published_status: T.untyped,
|
191
|
+
session: Auth::Session,
|
192
|
+
kwargs: T.untyped
|
193
|
+
).returns(T.untyped)
|
194
|
+
end
|
195
|
+
def count(
|
196
|
+
vendor: nil,
|
197
|
+
product_type: nil,
|
198
|
+
collection_id: nil,
|
199
|
+
created_at_min: nil,
|
200
|
+
created_at_max: nil,
|
201
|
+
updated_at_min: nil,
|
202
|
+
updated_at_max: nil,
|
203
|
+
published_at_min: nil,
|
204
|
+
published_at_max: nil,
|
205
|
+
published_status: nil,
|
206
|
+
session: ShopifyAPI::Context.active_session,
|
207
|
+
**kwargs
|
208
|
+
)
|
209
|
+
request(
|
210
|
+
http_method: :get,
|
211
|
+
operation: :count,
|
212
|
+
session: session,
|
213
|
+
ids: {},
|
214
|
+
params: {vendor: vendor, product_type: product_type, collection_id: collection_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status}.merge(kwargs).compact,
|
215
|
+
body: {},
|
216
|
+
entity: nil,
|
217
|
+
)
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|