shopify_api 14.3.0 → 14.4.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 +12 -0
- data/Gemfile.lock +2 -2
- data/README.md +3 -0
- data/docs/usage/oauth.md +88 -16
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/clients/graphql/client.rb +3 -2
- data/lib/shopify_api/clients/graphql/storefront.rb +4 -2
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
- 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/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_10/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_01/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_04/shop.rb +2 -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 +333 -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 +176 -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 +222 -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/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +5 -4
- metadata +80 -6
@@ -0,0 +1,200 @@
|
|
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 ProductListing < 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
|
+
@body_html = T.let(nil, T.nilable(String))
|
22
|
+
@created_at = T.let(nil, T.nilable(String))
|
23
|
+
@handle = T.let(nil, T.nilable(String))
|
24
|
+
@images = T.let(nil, T.nilable(T::Array[T.untyped]))
|
25
|
+
@options = T.let(nil, T.nilable(T::Array[T.untyped]))
|
26
|
+
@product_id = T.let(nil, T.nilable(Integer))
|
27
|
+
@product_type = T.let(nil, T.nilable(String))
|
28
|
+
@published_at = T.let(nil, T.nilable(String))
|
29
|
+
@tags = T.let(nil, T.nilable(String))
|
30
|
+
@title = T.let(nil, T.nilable(String))
|
31
|
+
@updated_at = T.let(nil, T.nilable(String))
|
32
|
+
@variants = T.let(nil, T.nilable(T::Array[T.untyped]))
|
33
|
+
@vendor = T.let(nil, T.nilable(String))
|
34
|
+
|
35
|
+
super(session: session, from_hash: from_hash)
|
36
|
+
end
|
37
|
+
|
38
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
39
|
+
@has_many = T.let({
|
40
|
+
images: Image,
|
41
|
+
variants: Variant
|
42
|
+
}, T::Hash[Symbol, Class])
|
43
|
+
@paths = T.let([
|
44
|
+
{http_method: :delete, operation: :delete, ids: [:product_id], path: "product_listings/<product_id>.json"},
|
45
|
+
{http_method: :get, operation: :count, ids: [], path: "product_listings/count.json"},
|
46
|
+
{http_method: :get, operation: :get, ids: [], path: "product_listings.json"},
|
47
|
+
{http_method: :get, operation: :get, ids: [:product_id], path: "product_listings/<product_id>.json"},
|
48
|
+
{http_method: :get, operation: :product_ids, ids: [], path: "product_listings/product_ids.json"},
|
49
|
+
{http_method: :put, operation: :put, ids: [:product_id], path: "product_listings/<product_id>.json"}
|
50
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
51
|
+
|
52
|
+
sig { returns(T.nilable(String)) }
|
53
|
+
attr_reader :body_html
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :created_at
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :handle
|
58
|
+
sig { returns(T.nilable(T::Array[Image])) }
|
59
|
+
attr_reader :images
|
60
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
61
|
+
attr_reader :options
|
62
|
+
sig { returns(T.nilable(Integer)) }
|
63
|
+
attr_reader :product_id
|
64
|
+
sig { returns(T.nilable(String)) }
|
65
|
+
attr_reader :product_type
|
66
|
+
sig { returns(T.nilable(String)) }
|
67
|
+
attr_reader :published_at
|
68
|
+
sig { returns(T.nilable(String)) }
|
69
|
+
attr_reader :tags
|
70
|
+
sig { returns(T.nilable(String)) }
|
71
|
+
attr_reader :title
|
72
|
+
sig { returns(T.nilable(String)) }
|
73
|
+
attr_reader :updated_at
|
74
|
+
sig { returns(T.nilable(T::Array[Variant])) }
|
75
|
+
attr_reader :variants
|
76
|
+
sig { returns(T.nilable(String)) }
|
77
|
+
attr_reader :vendor
|
78
|
+
|
79
|
+
class << self
|
80
|
+
sig do
|
81
|
+
returns(String)
|
82
|
+
end
|
83
|
+
def primary_key()
|
84
|
+
"product_id"
|
85
|
+
end
|
86
|
+
|
87
|
+
sig do
|
88
|
+
params(
|
89
|
+
product_id: T.any(Integer, String),
|
90
|
+
session: Auth::Session
|
91
|
+
).returns(T.nilable(ProductListing))
|
92
|
+
end
|
93
|
+
def find(
|
94
|
+
product_id:,
|
95
|
+
session: ShopifyAPI::Context.active_session
|
96
|
+
)
|
97
|
+
result = base_find(
|
98
|
+
session: session,
|
99
|
+
ids: {product_id: product_id},
|
100
|
+
params: {},
|
101
|
+
)
|
102
|
+
T.cast(result[0], T.nilable(ProductListing))
|
103
|
+
end
|
104
|
+
|
105
|
+
sig do
|
106
|
+
params(
|
107
|
+
product_id: T.any(Integer, String),
|
108
|
+
session: Auth::Session
|
109
|
+
).returns(T.untyped)
|
110
|
+
end
|
111
|
+
def delete(
|
112
|
+
product_id:,
|
113
|
+
session: ShopifyAPI::Context.active_session
|
114
|
+
)
|
115
|
+
request(
|
116
|
+
http_method: :delete,
|
117
|
+
operation: :delete,
|
118
|
+
session: session,
|
119
|
+
ids: {product_id: product_id},
|
120
|
+
params: {},
|
121
|
+
)
|
122
|
+
end
|
123
|
+
|
124
|
+
sig do
|
125
|
+
params(
|
126
|
+
product_ids: T.untyped,
|
127
|
+
limit: T.untyped,
|
128
|
+
collection_id: T.untyped,
|
129
|
+
updated_at_min: T.untyped,
|
130
|
+
handle: T.untyped,
|
131
|
+
session: Auth::Session,
|
132
|
+
kwargs: T.untyped
|
133
|
+
).returns(T::Array[ProductListing])
|
134
|
+
end
|
135
|
+
def all(
|
136
|
+
product_ids: nil,
|
137
|
+
limit: nil,
|
138
|
+
collection_id: nil,
|
139
|
+
updated_at_min: nil,
|
140
|
+
handle: nil,
|
141
|
+
session: ShopifyAPI::Context.active_session,
|
142
|
+
**kwargs
|
143
|
+
)
|
144
|
+
response = base_find(
|
145
|
+
session: session,
|
146
|
+
ids: {},
|
147
|
+
params: {product_ids: product_ids, limit: limit, collection_id: collection_id, updated_at_min: updated_at_min, handle: handle}.merge(kwargs).compact,
|
148
|
+
)
|
149
|
+
|
150
|
+
T.cast(response, T::Array[ProductListing])
|
151
|
+
end
|
152
|
+
|
153
|
+
sig do
|
154
|
+
params(
|
155
|
+
session: Auth::Session,
|
156
|
+
kwargs: T.untyped
|
157
|
+
).returns(T.untyped)
|
158
|
+
end
|
159
|
+
def count(
|
160
|
+
session: ShopifyAPI::Context.active_session,
|
161
|
+
**kwargs
|
162
|
+
)
|
163
|
+
request(
|
164
|
+
http_method: :get,
|
165
|
+
operation: :count,
|
166
|
+
session: session,
|
167
|
+
ids: {},
|
168
|
+
params: {}.merge(kwargs).compact,
|
169
|
+
body: {},
|
170
|
+
entity: nil,
|
171
|
+
)
|
172
|
+
end
|
173
|
+
|
174
|
+
sig do
|
175
|
+
params(
|
176
|
+
limit: T.untyped,
|
177
|
+
session: Auth::Session,
|
178
|
+
kwargs: T.untyped
|
179
|
+
).returns(T.untyped)
|
180
|
+
end
|
181
|
+
def product_ids(
|
182
|
+
limit: nil,
|
183
|
+
session: ShopifyAPI::Context.active_session,
|
184
|
+
**kwargs
|
185
|
+
)
|
186
|
+
request(
|
187
|
+
http_method: :get,
|
188
|
+
operation: :product_ids,
|
189
|
+
session: session,
|
190
|
+
ids: {},
|
191
|
+
params: {limit: limit}.merge(kwargs).compact,
|
192
|
+
body: {},
|
193
|
+
entity: nil,
|
194
|
+
)
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
end
|
@@ -0,0 +1,92 @@
|
|
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 ProductResourceFeedback < 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
|
+
@created_at = T.let(nil, T.nilable(String))
|
22
|
+
@feedback_generated_at = T.let(nil, T.nilable(String))
|
23
|
+
@messages = T.let(nil, T.nilable(T::Array[T.untyped]))
|
24
|
+
@product_id = T.let(nil, T.nilable(Integer))
|
25
|
+
@resource_id = T.let(nil, T.nilable(Integer))
|
26
|
+
@resource_type = T.let(nil, T.nilable(String))
|
27
|
+
@resource_updated_at = T.let(nil, T.nilable(String))
|
28
|
+
@state = T.let(nil, T.nilable(String))
|
29
|
+
@updated_at = T.let(nil, T.nilable(String))
|
30
|
+
|
31
|
+
super(session: session, from_hash: from_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
35
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
36
|
+
@paths = T.let([
|
37
|
+
{http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/resource_feedback.json"},
|
38
|
+
{http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/resource_feedback.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(String)) }
|
44
|
+
attr_reader :feedback_generated_at
|
45
|
+
sig { returns(T.nilable(T::Array[String])) }
|
46
|
+
attr_reader :messages
|
47
|
+
sig { returns(T.nilable(Integer)) }
|
48
|
+
attr_reader :product_id
|
49
|
+
sig { returns(T.nilable(Integer)) }
|
50
|
+
attr_reader :resource_id
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :resource_type
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :resource_updated_at
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :state
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :updated_at
|
59
|
+
|
60
|
+
class << self
|
61
|
+
sig do
|
62
|
+
returns(String)
|
63
|
+
end
|
64
|
+
def json_body_name()
|
65
|
+
"resource_feedback"
|
66
|
+
end
|
67
|
+
|
68
|
+
sig do
|
69
|
+
params(
|
70
|
+
product_id: T.nilable(T.any(Integer, String)),
|
71
|
+
session: Auth::Session,
|
72
|
+
kwargs: T.untyped
|
73
|
+
).returns(T::Array[ProductResourceFeedback])
|
74
|
+
end
|
75
|
+
def all(
|
76
|
+
product_id: nil,
|
77
|
+
session: ShopifyAPI::Context.active_session,
|
78
|
+
**kwargs
|
79
|
+
)
|
80
|
+
response = base_find(
|
81
|
+
session: session,
|
82
|
+
ids: {product_id: product_id},
|
83
|
+
params: {}.merge(kwargs).compact,
|
84
|
+
)
|
85
|
+
|
86
|
+
T.cast(response, T::Array[ProductResourceFeedback])
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,136 @@
|
|
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 Province < 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
|
+
@code = T.let(nil, T.nilable(String))
|
22
|
+
@country_id = T.let(nil, T.nilable(Integer))
|
23
|
+
@id = T.let(nil, T.nilable(Integer))
|
24
|
+
@name = T.let(nil, T.nilable(String))
|
25
|
+
@shipping_zone_id = T.let(nil, T.nilable(Integer))
|
26
|
+
@tax = T.let(nil, T.nilable(Float))
|
27
|
+
@tax_name = T.let(nil, T.nilable(String))
|
28
|
+
@tax_percentage = T.let(nil, T.nilable(Float))
|
29
|
+
@tax_type = T.let(nil, T.nilable(String))
|
30
|
+
|
31
|
+
super(session: session, from_hash: from_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
35
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
36
|
+
@paths = T.let([
|
37
|
+
{http_method: :get, operation: :count, ids: [:country_id], path: "countries/<country_id>/provinces/count.json"},
|
38
|
+
{http_method: :get, operation: :get, ids: [:country_id], path: "countries/<country_id>/provinces.json"},
|
39
|
+
{http_method: :get, operation: :get, ids: [:country_id, :id], path: "countries/<country_id>/provinces/<id>.json"},
|
40
|
+
{http_method: :put, operation: :put, ids: [:country_id, :id], path: "countries/<country_id>/provinces/<id>.json"}
|
41
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
42
|
+
|
43
|
+
sig { returns(T.nilable(String)) }
|
44
|
+
attr_reader :code
|
45
|
+
sig { returns(T.nilable(Integer)) }
|
46
|
+
attr_reader :country_id
|
47
|
+
sig { returns(T.nilable(Integer)) }
|
48
|
+
attr_reader :id
|
49
|
+
sig { returns(T.nilable(String)) }
|
50
|
+
attr_reader :name
|
51
|
+
sig { returns(T.nilable(Integer)) }
|
52
|
+
attr_reader :shipping_zone_id
|
53
|
+
sig { returns(T.nilable(Float)) }
|
54
|
+
attr_reader :tax
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :tax_name
|
57
|
+
sig { returns(T.nilable(Float)) }
|
58
|
+
attr_reader :tax_percentage
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :tax_type
|
61
|
+
|
62
|
+
class << self
|
63
|
+
sig do
|
64
|
+
params(
|
65
|
+
id: T.any(Integer, String),
|
66
|
+
country_id: T.nilable(T.any(Integer, String)),
|
67
|
+
fields: T.untyped,
|
68
|
+
session: Auth::Session
|
69
|
+
).returns(T.nilable(Province))
|
70
|
+
end
|
71
|
+
def find(
|
72
|
+
id:,
|
73
|
+
country_id: nil,
|
74
|
+
fields: nil,
|
75
|
+
session: ShopifyAPI::Context.active_session
|
76
|
+
)
|
77
|
+
result = base_find(
|
78
|
+
session: session,
|
79
|
+
ids: {id: id, country_id: country_id},
|
80
|
+
params: {fields: fields},
|
81
|
+
)
|
82
|
+
T.cast(result[0], T.nilable(Province))
|
83
|
+
end
|
84
|
+
|
85
|
+
sig do
|
86
|
+
params(
|
87
|
+
country_id: T.nilable(T.any(Integer, String)),
|
88
|
+
since_id: T.untyped,
|
89
|
+
fields: T.untyped,
|
90
|
+
session: Auth::Session,
|
91
|
+
kwargs: T.untyped
|
92
|
+
).returns(T::Array[Province])
|
93
|
+
end
|
94
|
+
def all(
|
95
|
+
country_id: nil,
|
96
|
+
since_id: nil,
|
97
|
+
fields: nil,
|
98
|
+
session: ShopifyAPI::Context.active_session,
|
99
|
+
**kwargs
|
100
|
+
)
|
101
|
+
response = base_find(
|
102
|
+
session: session,
|
103
|
+
ids: {country_id: country_id},
|
104
|
+
params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
|
105
|
+
)
|
106
|
+
|
107
|
+
T.cast(response, T::Array[Province])
|
108
|
+
end
|
109
|
+
|
110
|
+
sig do
|
111
|
+
params(
|
112
|
+
country_id: T.nilable(T.any(Integer, String)),
|
113
|
+
session: Auth::Session,
|
114
|
+
kwargs: T.untyped
|
115
|
+
).returns(T.untyped)
|
116
|
+
end
|
117
|
+
def count(
|
118
|
+
country_id: nil,
|
119
|
+
session: ShopifyAPI::Context.active_session,
|
120
|
+
**kwargs
|
121
|
+
)
|
122
|
+
request(
|
123
|
+
http_method: :get,
|
124
|
+
operation: :count,
|
125
|
+
session: session,
|
126
|
+
ids: {country_id: country_id},
|
127
|
+
params: {}.merge(kwargs).compact,
|
128
|
+
body: {},
|
129
|
+
entity: nil,
|
130
|
+
)
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,176 @@
|
|
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 RecurringApplicationCharge < 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
|
+
@activated_on = T.let(nil, T.nilable(String))
|
22
|
+
@billing_on = T.let(nil, T.nilable(String))
|
23
|
+
@cancelled_on = T.let(nil, T.nilable(String))
|
24
|
+
@capped_amount = T.let(nil, T.nilable(T.any(String, Integer)))
|
25
|
+
@confirmation_url = T.let(nil, T.nilable(String))
|
26
|
+
@created_at = T.let(nil, T.nilable(String))
|
27
|
+
@currency = T.let(nil, T.nilable(Currency))
|
28
|
+
@id = T.let(nil, T.nilable(Integer))
|
29
|
+
@name = T.let(nil, T.nilable(String))
|
30
|
+
@price = T.let(nil, T.nilable(T.any(String, Float)))
|
31
|
+
@return_url = T.let(nil, T.nilable(String))
|
32
|
+
@status = T.let(nil, T.nilable(String))
|
33
|
+
@terms = T.let(nil, T.nilable(String))
|
34
|
+
@test = T.let(nil, T.nilable(T::Boolean))
|
35
|
+
@trial_days = T.let(nil, T.nilable(Integer))
|
36
|
+
@trial_ends_on = T.let(nil, T.nilable(String))
|
37
|
+
@updated_at = T.let(nil, T.nilable(String))
|
38
|
+
|
39
|
+
super(session: session, from_hash: from_hash)
|
40
|
+
end
|
41
|
+
|
42
|
+
@has_one = T.let({
|
43
|
+
currency: Currency
|
44
|
+
}, T::Hash[Symbol, Class])
|
45
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
46
|
+
@paths = T.let([
|
47
|
+
{http_method: :delete, operation: :delete, ids: [:id], path: "recurring_application_charges/<id>.json"},
|
48
|
+
{http_method: :get, operation: :get, ids: [], path: "recurring_application_charges.json"},
|
49
|
+
{http_method: :get, operation: :get, ids: [:id], path: "recurring_application_charges/<id>.json"},
|
50
|
+
{http_method: :post, operation: :post, ids: [], path: "recurring_application_charges.json"},
|
51
|
+
{http_method: :put, operation: :customize, ids: [:id], path: "recurring_application_charges/<id>/customize.json"}
|
52
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
53
|
+
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :activated_on
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :billing_on
|
58
|
+
sig { returns(T.nilable(String)) }
|
59
|
+
attr_reader :cancelled_on
|
60
|
+
sig { returns(T.nilable(T.any(String, Integer))) }
|
61
|
+
attr_reader :capped_amount
|
62
|
+
sig { returns(T.nilable(String)) }
|
63
|
+
attr_reader :confirmation_url
|
64
|
+
sig { returns(T.nilable(String)) }
|
65
|
+
attr_reader :created_at
|
66
|
+
sig { returns(T.nilable(Currency)) }
|
67
|
+
attr_reader :currency
|
68
|
+
sig { returns(T.nilable(Integer)) }
|
69
|
+
attr_reader :id
|
70
|
+
sig { returns(T.nilable(String)) }
|
71
|
+
attr_reader :name
|
72
|
+
sig { returns(T.nilable(T.any(String, Float))) }
|
73
|
+
attr_reader :price
|
74
|
+
sig { returns(T.nilable(String)) }
|
75
|
+
attr_reader :return_url
|
76
|
+
sig { returns(T.nilable(String)) }
|
77
|
+
attr_reader :status
|
78
|
+
sig { returns(T.nilable(String)) }
|
79
|
+
attr_reader :terms
|
80
|
+
sig { returns(T.nilable(T::Boolean)) }
|
81
|
+
attr_reader :test
|
82
|
+
sig { returns(T.nilable(Integer)) }
|
83
|
+
attr_reader :trial_days
|
84
|
+
sig { returns(T.nilable(String)) }
|
85
|
+
attr_reader :trial_ends_on
|
86
|
+
sig { returns(T.nilable(String)) }
|
87
|
+
attr_reader :updated_at
|
88
|
+
|
89
|
+
class << self
|
90
|
+
sig do
|
91
|
+
params(
|
92
|
+
id: T.any(Integer, String),
|
93
|
+
fields: T.untyped,
|
94
|
+
session: Auth::Session
|
95
|
+
).returns(T.nilable(RecurringApplicationCharge))
|
96
|
+
end
|
97
|
+
def find(
|
98
|
+
id:,
|
99
|
+
fields: nil,
|
100
|
+
session: ShopifyAPI::Context.active_session
|
101
|
+
)
|
102
|
+
result = base_find(
|
103
|
+
session: session,
|
104
|
+
ids: {id: id},
|
105
|
+
params: {fields: fields},
|
106
|
+
)
|
107
|
+
T.cast(result[0], T.nilable(RecurringApplicationCharge))
|
108
|
+
end
|
109
|
+
|
110
|
+
sig do
|
111
|
+
params(
|
112
|
+
id: T.any(Integer, String),
|
113
|
+
session: Auth::Session
|
114
|
+
).returns(T.untyped)
|
115
|
+
end
|
116
|
+
def delete(
|
117
|
+
id:,
|
118
|
+
session: ShopifyAPI::Context.active_session
|
119
|
+
)
|
120
|
+
request(
|
121
|
+
http_method: :delete,
|
122
|
+
operation: :delete,
|
123
|
+
session: session,
|
124
|
+
ids: {id: id},
|
125
|
+
params: {},
|
126
|
+
)
|
127
|
+
end
|
128
|
+
|
129
|
+
sig do
|
130
|
+
params(
|
131
|
+
since_id: T.untyped,
|
132
|
+
fields: T.untyped,
|
133
|
+
session: Auth::Session,
|
134
|
+
kwargs: T.untyped
|
135
|
+
).returns(T::Array[RecurringApplicationCharge])
|
136
|
+
end
|
137
|
+
def all(
|
138
|
+
since_id: nil,
|
139
|
+
fields: nil,
|
140
|
+
session: ShopifyAPI::Context.active_session,
|
141
|
+
**kwargs
|
142
|
+
)
|
143
|
+
response = base_find(
|
144
|
+
session: session,
|
145
|
+
ids: {},
|
146
|
+
params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
|
147
|
+
)
|
148
|
+
|
149
|
+
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|
153
|
+
|
154
|
+
sig do
|
155
|
+
params(
|
156
|
+
body: T.untyped,
|
157
|
+
kwargs: T.untyped
|
158
|
+
).returns(T.untyped)
|
159
|
+
end
|
160
|
+
def customize(
|
161
|
+
body: nil,
|
162
|
+
**kwargs
|
163
|
+
)
|
164
|
+
self.class.request(
|
165
|
+
http_method: :put,
|
166
|
+
operation: :customize,
|
167
|
+
session: @session,
|
168
|
+
ids: {id: @id},
|
169
|
+
params: {}.merge(kwargs).compact,
|
170
|
+
body: body,
|
171
|
+
entity: self,
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
end
|