shopify_api 14.5.0 → 14.7.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 +11 -1
- data/Gemfile.lock +20 -11
- data/docs/usage/oauth.md +14 -0
- data/docs/usage/webhooks.md +11 -0
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/context.rb +2 -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/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_07/webhook.rb +1 -0
- data/lib/shopify_api/rest/resources/2024_10/abandoned_checkout.rb +194 -0
- data/lib/shopify_api/rest/resources/2024_10/access_scope.rb +62 -0
- data/lib/shopify_api/rest/resources/2024_10/apple_pay_certificate.rb +109 -0
- data/lib/shopify_api/rest/resources/2024_10/application_charge.rb +113 -0
- data/lib/shopify_api/rest/resources/2024_10/application_credit.rb +95 -0
- data/lib/shopify_api/rest/resources/2024_10/article.rb +269 -0
- data/lib/shopify_api/rest/resources/2024_10/asset.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_10/assigned_fulfillment_order.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_10/balance.rb +58 -0
- data/lib/shopify_api/rest/resources/2024_10/blog.rb +166 -0
- data/lib/shopify_api/rest/resources/2024_10/cancellation_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_10/carrier_service.rb +120 -0
- data/lib/shopify_api/rest/resources/2024_10/checkout.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_10/collect.rb +146 -0
- data/lib/shopify_api/rest/resources/2024_10/collection.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_10/collection_listing.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_10/comment.rb +287 -0
- data/lib/shopify_api/rest/resources/2024_10/country.rb +141 -0
- data/lib/shopify_api/rest/resources/2024_10/currency.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_10/custom_collection.rb +191 -0
- data/lib/shopify_api/rest/resources/2024_10/customer.rb +335 -0
- data/lib/shopify_api/rest/resources/2024_10/customer_address.rb +215 -0
- data/lib/shopify_api/rest/resources/2024_10/deprecated_api_call.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_10/discount_code.rb +226 -0
- data/lib/shopify_api/rest/resources/2024_10/dispute.rb +115 -0
- data/lib/shopify_api/rest/resources/2024_10/dispute_evidence.rb +121 -0
- data/lib/shopify_api/rest/resources/2024_10/dispute_file_upload.rb +85 -0
- data/lib/shopify_api/rest/resources/2024_10/draft_order.rb +279 -0
- data/lib/shopify_api/rest/resources/2024_10/event.rb +152 -0
- data/lib/shopify_api/rest/resources/2024_10/fulfillment.rb +235 -0
- data/lib/shopify_api/rest/resources/2024_10/fulfillment_event.rb +167 -0
- data/lib/shopify_api/rest/resources/2024_10/fulfillment_order.rb +326 -0
- data/lib/shopify_api/rest/resources/2024_10/fulfillment_request.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_10/fulfillment_service.rb +134 -0
- data/lib/shopify_api/rest/resources/2024_10/gift_card.rb +222 -0
- data/lib/shopify_api/rest/resources/2024_10/gift_card_adjustment.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_10/image.rb +161 -0
- data/lib/shopify_api/rest/resources/2024_10/inventory_item.rb +112 -0
- data/lib/shopify_api/rest/resources/2024_10/inventory_level.rb +183 -0
- data/lib/shopify_api/rest/resources/2024_10/location.rb +171 -0
- data/lib/shopify_api/rest/resources/2024_10/locations_for_move.rb +60 -0
- data/lib/shopify_api/rest/resources/2024_10/marketing_event.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_10/metafield.rb +348 -0
- data/lib/shopify_api/rest/resources/2024_10/mobile_platform_application.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_10/order.rb +490 -0
- data/lib/shopify_api/rest/resources/2024_10/order_risk.rb +148 -0
- data/lib/shopify_api/rest/resources/2024_10/page.rb +198 -0
- data/lib/shopify_api/rest/resources/2024_10/payment.rb +144 -0
- data/lib/shopify_api/rest/resources/2024_10/payment_gateway.rb +147 -0
- data/lib/shopify_api/rest/resources/2024_10/payment_transaction.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_10/payout.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_10/policy.rb +73 -0
- data/lib/shopify_api/rest/resources/2024_10/price_rule.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_10/product.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_10/product_listing.rb +200 -0
- data/lib/shopify_api/rest/resources/2024_10/product_resource_feedback.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_10/province.rb +136 -0
- data/lib/shopify_api/rest/resources/2024_10/recurring_application_charge.rb +184 -0
- data/lib/shopify_api/rest/resources/2024_10/redirect.rb +143 -0
- data/lib/shopify_api/rest/resources/2024_10/refund.rb +155 -0
- data/lib/shopify_api/rest/resources/2024_10/resource_feedback.rb +77 -0
- data/lib/shopify_api/rest/resources/2024_10/script_tag.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_10/shipping_zone.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_10/shop.rb +232 -0
- data/lib/shopify_api/rest/resources/2024_10/smart_collection.rb +220 -0
- data/lib/shopify_api/rest/resources/2024_10/storefront_access_token.rb +91 -0
- data/lib/shopify_api/rest/resources/2024_10/tender_transaction.rb +97 -0
- data/lib/shopify_api/rest/resources/2024_10/theme.rb +127 -0
- data/lib/shopify_api/rest/resources/2024_10/transaction.rb +189 -0
- data/lib/shopify_api/rest/resources/2024_10/usage_charge.rb +106 -0
- data/lib/shopify_api/rest/resources/2024_10/user.rb +142 -0
- data/lib/shopify_api/rest/resources/2024_10/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2024_10/webhook.rb +173 -0
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registration.rb +17 -3
- data/lib/shopify_api/webhooks/registrations/event_bridge.rb +22 -3
- data/lib/shopify_api/webhooks/registrations/http.rb +22 -3
- data/lib/shopify_api/webhooks/registrations/pub_sub.rb +23 -4
- data/lib/shopify_api/webhooks/registry.rb +15 -5
- metadata +76 -3
@@ -0,0 +1,127 @@
|
|
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 Theme < 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
|
+
@id = T.let(nil, T.nilable(Integer))
|
23
|
+
@name = T.let(nil, T.nilable(String))
|
24
|
+
@previewable = T.let(nil, T.nilable(T::Boolean))
|
25
|
+
@processing = T.let(nil, T.nilable(T::Boolean))
|
26
|
+
@role = T.let(nil, T.nilable(String))
|
27
|
+
@src = T.let(nil, T.nilable(String))
|
28
|
+
@theme_store_id = T.let(nil, T.nilable(Integer))
|
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: :delete, operation: :delete, ids: [:id], path: "themes/<id>.json"},
|
38
|
+
{http_method: :get, operation: :get, ids: [], path: "themes.json"},
|
39
|
+
{http_method: :get, operation: :get, ids: [:id], path: "themes/<id>.json"},
|
40
|
+
{http_method: :post, operation: :post, ids: [], path: "themes.json"},
|
41
|
+
{http_method: :put, operation: :put, ids: [:id], path: "themes/<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 :created_at
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
47
|
+
attr_reader :id
|
48
|
+
sig { returns(T.nilable(String)) }
|
49
|
+
attr_reader :name
|
50
|
+
sig { returns(T.nilable(T::Boolean)) }
|
51
|
+
attr_reader :previewable
|
52
|
+
sig { returns(T.nilable(T::Boolean)) }
|
53
|
+
attr_reader :processing
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :role
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :src
|
58
|
+
sig { returns(T.nilable(Integer)) }
|
59
|
+
attr_reader :theme_store_id
|
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
|
+
fields: T.untyped,
|
68
|
+
session: Auth::Session
|
69
|
+
).returns(T.nilable(Theme))
|
70
|
+
end
|
71
|
+
def find(
|
72
|
+
id:,
|
73
|
+
fields: nil,
|
74
|
+
session: ShopifyAPI::Context.active_session
|
75
|
+
)
|
76
|
+
result = base_find(
|
77
|
+
session: session,
|
78
|
+
ids: {id: id},
|
79
|
+
params: {fields: fields},
|
80
|
+
)
|
81
|
+
T.cast(result[0], T.nilable(Theme))
|
82
|
+
end
|
83
|
+
|
84
|
+
sig do
|
85
|
+
params(
|
86
|
+
id: T.any(Integer, String),
|
87
|
+
session: Auth::Session
|
88
|
+
).returns(T.untyped)
|
89
|
+
end
|
90
|
+
def delete(
|
91
|
+
id:,
|
92
|
+
session: ShopifyAPI::Context.active_session
|
93
|
+
)
|
94
|
+
request(
|
95
|
+
http_method: :delete,
|
96
|
+
operation: :delete,
|
97
|
+
session: session,
|
98
|
+
ids: {id: id},
|
99
|
+
params: {},
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
sig do
|
104
|
+
params(
|
105
|
+
fields: T.untyped,
|
106
|
+
session: Auth::Session,
|
107
|
+
kwargs: T.untyped
|
108
|
+
).returns(T::Array[Theme])
|
109
|
+
end
|
110
|
+
def all(
|
111
|
+
fields: nil,
|
112
|
+
session: ShopifyAPI::Context.active_session,
|
113
|
+
**kwargs
|
114
|
+
)
|
115
|
+
response = base_find(
|
116
|
+
session: session,
|
117
|
+
ids: {},
|
118
|
+
params: {fields: fields}.merge(kwargs).compact,
|
119
|
+
)
|
120
|
+
|
121
|
+
T.cast(response, T::Array[Theme])
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,189 @@
|
|
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 Transaction < 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
|
+
@kind = T.let(nil, T.nilable(String))
|
22
|
+
@amount = T.let(nil, T.nilable(String))
|
23
|
+
@amount_rounding = T.let(nil, T.nilable(String))
|
24
|
+
@authorization = T.let(nil, T.nilable(String))
|
25
|
+
@authorization_expires_at = T.let(nil, T.nilable(String))
|
26
|
+
@created_at = T.let(nil, T.nilable(String))
|
27
|
+
@currency = T.let(nil, T.nilable(String))
|
28
|
+
@currency_exchange_adjustment = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
29
|
+
@device_id = T.let(nil, T.nilable(Integer))
|
30
|
+
@error_code = T.let(nil, T.nilable(String))
|
31
|
+
@extended_authorization_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
32
|
+
@gateway = T.let(nil, T.nilable(String))
|
33
|
+
@id = T.let(nil, T.nilable(Integer))
|
34
|
+
@location_id = T.let(nil, T.nilable(Integer))
|
35
|
+
@message = T.let(nil, T.nilable(String))
|
36
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
37
|
+
@parent_id = T.let(nil, T.nilable(Integer))
|
38
|
+
@payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
39
|
+
@payments_refund_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
40
|
+
@processed_at = T.let(nil, T.nilable(String))
|
41
|
+
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
42
|
+
@source_name = T.let(nil, T.nilable(String))
|
43
|
+
@status = T.let(nil, T.nilable(String))
|
44
|
+
@test = T.let(nil, T.nilable(T::Boolean))
|
45
|
+
@total_unsettled_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
46
|
+
@user_id = T.let(nil, T.nilable(Integer))
|
47
|
+
|
48
|
+
super(session: session, from_hash: from_hash)
|
49
|
+
end
|
50
|
+
|
51
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
52
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
53
|
+
@paths = T.let([
|
54
|
+
{http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/transactions/count.json"},
|
55
|
+
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/transactions.json"},
|
56
|
+
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/transactions/<id>.json"},
|
57
|
+
{http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/transactions.json"}
|
58
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
59
|
+
|
60
|
+
sig { returns(T.nilable(String)) }
|
61
|
+
attr_reader :kind
|
62
|
+
sig { returns(T.nilable(String)) }
|
63
|
+
attr_reader :amount
|
64
|
+
sig { returns(T.nilable(String)) }
|
65
|
+
attr_reader :authorization
|
66
|
+
sig { returns(T.nilable(String)) }
|
67
|
+
attr_reader :authorization_expires_at
|
68
|
+
sig { returns(T.nilable(String)) }
|
69
|
+
attr_reader :created_at
|
70
|
+
sig { returns(T.nilable(String)) }
|
71
|
+
attr_reader :currency
|
72
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
73
|
+
attr_reader :currency_exchange_adjustment
|
74
|
+
sig { returns(T.nilable(Integer)) }
|
75
|
+
attr_reader :device_id
|
76
|
+
sig { returns(T.nilable(String)) }
|
77
|
+
attr_reader :error_code
|
78
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
79
|
+
attr_reader :extended_authorization_attributes
|
80
|
+
sig { returns(T.nilable(String)) }
|
81
|
+
attr_reader :gateway
|
82
|
+
sig { returns(T.nilable(Integer)) }
|
83
|
+
attr_reader :id
|
84
|
+
sig { returns(T.nilable(Integer)) }
|
85
|
+
attr_reader :location_id
|
86
|
+
sig { returns(T.nilable(String)) }
|
87
|
+
attr_reader :message
|
88
|
+
sig { returns(T.nilable(Integer)) }
|
89
|
+
attr_reader :order_id
|
90
|
+
sig { returns(T.nilable(Integer)) }
|
91
|
+
attr_reader :parent_id
|
92
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
93
|
+
attr_reader :payment_details
|
94
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
95
|
+
attr_reader :payments_refund_attributes
|
96
|
+
sig { returns(T.nilable(String)) }
|
97
|
+
attr_reader :processed_at
|
98
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
99
|
+
attr_reader :receipt
|
100
|
+
sig { returns(T.nilable(String)) }
|
101
|
+
attr_reader :source_name
|
102
|
+
sig { returns(T.nilable(String)) }
|
103
|
+
attr_reader :status
|
104
|
+
sig { returns(T.nilable(T::Boolean)) }
|
105
|
+
attr_reader :test
|
106
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
107
|
+
attr_reader :total_unsettled_set
|
108
|
+
sig { returns(T.nilable(Integer)) }
|
109
|
+
attr_reader :user_id
|
110
|
+
|
111
|
+
class << self
|
112
|
+
sig do
|
113
|
+
params(
|
114
|
+
id: T.any(Integer, String),
|
115
|
+
order_id: T.nilable(T.any(Integer, String)),
|
116
|
+
fields: T.untyped,
|
117
|
+
in_shop_currency: T.untyped,
|
118
|
+
session: Auth::Session
|
119
|
+
).returns(T.nilable(Transaction))
|
120
|
+
end
|
121
|
+
def find(
|
122
|
+
id:,
|
123
|
+
order_id: nil,
|
124
|
+
fields: nil,
|
125
|
+
in_shop_currency: nil,
|
126
|
+
session: ShopifyAPI::Context.active_session
|
127
|
+
)
|
128
|
+
result = base_find(
|
129
|
+
session: session,
|
130
|
+
ids: {id: id, order_id: order_id},
|
131
|
+
params: {fields: fields, in_shop_currency: in_shop_currency},
|
132
|
+
)
|
133
|
+
T.cast(result[0], T.nilable(Transaction))
|
134
|
+
end
|
135
|
+
|
136
|
+
sig do
|
137
|
+
params(
|
138
|
+
order_id: T.nilable(T.any(Integer, String)),
|
139
|
+
since_id: T.untyped,
|
140
|
+
fields: T.untyped,
|
141
|
+
in_shop_currency: T.untyped,
|
142
|
+
session: Auth::Session,
|
143
|
+
kwargs: T.untyped
|
144
|
+
).returns(T::Array[Transaction])
|
145
|
+
end
|
146
|
+
def all(
|
147
|
+
order_id: nil,
|
148
|
+
since_id: nil,
|
149
|
+
fields: nil,
|
150
|
+
in_shop_currency: nil,
|
151
|
+
session: ShopifyAPI::Context.active_session,
|
152
|
+
**kwargs
|
153
|
+
)
|
154
|
+
response = base_find(
|
155
|
+
session: session,
|
156
|
+
ids: {order_id: order_id},
|
157
|
+
params: {since_id: since_id, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
|
158
|
+
)
|
159
|
+
|
160
|
+
T.cast(response, T::Array[Transaction])
|
161
|
+
end
|
162
|
+
|
163
|
+
sig do
|
164
|
+
params(
|
165
|
+
order_id: T.nilable(T.any(Integer, String)),
|
166
|
+
session: Auth::Session,
|
167
|
+
kwargs: T.untyped
|
168
|
+
).returns(T.untyped)
|
169
|
+
end
|
170
|
+
def count(
|
171
|
+
order_id: nil,
|
172
|
+
session: ShopifyAPI::Context.active_session,
|
173
|
+
**kwargs
|
174
|
+
)
|
175
|
+
request(
|
176
|
+
http_method: :get,
|
177
|
+
operation: :count,
|
178
|
+
session: session,
|
179
|
+
ids: {order_id: order_id},
|
180
|
+
params: {}.merge(kwargs).compact,
|
181
|
+
body: {},
|
182
|
+
entity: nil,
|
183
|
+
)
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
end
|
@@ -0,0 +1,106 @@
|
|
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 UsageCharge < 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
|
+
@currency = T.let(nil, T.nilable(Currency))
|
23
|
+
@description = T.let(nil, T.nilable(String))
|
24
|
+
@id = T.let(nil, T.nilable(Integer))
|
25
|
+
@price = T.let(nil, T.nilable(String))
|
26
|
+
@recurring_application_charge_id = T.let(nil, T.nilable(Integer))
|
27
|
+
@updated_at = T.let(nil, T.nilable(String))
|
28
|
+
|
29
|
+
super(session: session, from_hash: from_hash)
|
30
|
+
end
|
31
|
+
|
32
|
+
@has_one = T.let({
|
33
|
+
currency: Currency
|
34
|
+
}, T::Hash[Symbol, Class])
|
35
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
36
|
+
@paths = T.let([
|
37
|
+
{http_method: :get, operation: :get, ids: [:recurring_application_charge_id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges.json"},
|
38
|
+
{http_method: :get, operation: :get, ids: [:recurring_application_charge_id, :id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges/<id>.json"},
|
39
|
+
{http_method: :post, operation: :post, ids: [:recurring_application_charge_id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges.json"}
|
40
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
41
|
+
|
42
|
+
sig { returns(T.nilable(String)) }
|
43
|
+
attr_reader :created_at
|
44
|
+
sig { returns(T.nilable(Currency)) }
|
45
|
+
attr_reader :currency
|
46
|
+
sig { returns(T.nilable(String)) }
|
47
|
+
attr_reader :description
|
48
|
+
sig { returns(T.nilable(Integer)) }
|
49
|
+
attr_reader :id
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_reader :price
|
52
|
+
sig { returns(T.nilable(Integer)) }
|
53
|
+
attr_reader :recurring_application_charge_id
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :updated_at
|
56
|
+
|
57
|
+
class << self
|
58
|
+
sig do
|
59
|
+
params(
|
60
|
+
id: T.any(Integer, String),
|
61
|
+
recurring_application_charge_id: T.nilable(T.any(Integer, String)),
|
62
|
+
fields: T.untyped,
|
63
|
+
session: Auth::Session
|
64
|
+
).returns(T.nilable(UsageCharge))
|
65
|
+
end
|
66
|
+
def find(
|
67
|
+
id:,
|
68
|
+
recurring_application_charge_id: nil,
|
69
|
+
fields: nil,
|
70
|
+
session: ShopifyAPI::Context.active_session
|
71
|
+
)
|
72
|
+
result = base_find(
|
73
|
+
session: session,
|
74
|
+
ids: {id: id, recurring_application_charge_id: recurring_application_charge_id},
|
75
|
+
params: {fields: fields},
|
76
|
+
)
|
77
|
+
T.cast(result[0], T.nilable(UsageCharge))
|
78
|
+
end
|
79
|
+
|
80
|
+
sig do
|
81
|
+
params(
|
82
|
+
recurring_application_charge_id: T.nilable(T.any(Integer, String)),
|
83
|
+
fields: T.untyped,
|
84
|
+
session: Auth::Session,
|
85
|
+
kwargs: T.untyped
|
86
|
+
).returns(T::Array[UsageCharge])
|
87
|
+
end
|
88
|
+
def all(
|
89
|
+
recurring_application_charge_id: nil,
|
90
|
+
fields: nil,
|
91
|
+
session: ShopifyAPI::Context.active_session,
|
92
|
+
**kwargs
|
93
|
+
)
|
94
|
+
response = base_find(
|
95
|
+
session: session,
|
96
|
+
ids: {recurring_application_charge_id: recurring_application_charge_id},
|
97
|
+
params: {fields: fields}.merge(kwargs).compact,
|
98
|
+
)
|
99
|
+
|
100
|
+
T.cast(response, T::Array[UsageCharge])
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,142 @@
|
|
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 User < 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
|
+
@account_owner = T.let(nil, T.nilable(T::Boolean))
|
22
|
+
@bio = T.let(nil, T.nilable(String))
|
23
|
+
@email = T.let(nil, T.nilable(String))
|
24
|
+
@first_name = T.let(nil, T.nilable(String))
|
25
|
+
@id = T.let(nil, T.nilable(Integer))
|
26
|
+
@im = T.let(nil, T.nilable(String))
|
27
|
+
@last_name = T.let(nil, T.nilable(String))
|
28
|
+
@locale = T.let(nil, T.nilable(String))
|
29
|
+
@permissions = T.let(nil, T.nilable(T::Array[T.untyped]))
|
30
|
+
@phone = T.let(nil, T.nilable(String))
|
31
|
+
@receive_announcements = T.let(nil, T.nilable(Integer))
|
32
|
+
@screen_name = T.let(nil, T.nilable(String))
|
33
|
+
@url = T.let(nil, T.nilable(String))
|
34
|
+
@user_type = T.let(nil, T.nilable(String))
|
35
|
+
|
36
|
+
super(session: session, from_hash: from_hash)
|
37
|
+
end
|
38
|
+
|
39
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
40
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
41
|
+
@paths = T.let([
|
42
|
+
{http_method: :get, operation: :current, ids: [], path: "users/current.json"},
|
43
|
+
{http_method: :get, operation: :get, ids: [], path: "users.json"},
|
44
|
+
{http_method: :get, operation: :get, ids: [:id], path: "users/<id>.json"}
|
45
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
46
|
+
|
47
|
+
sig { returns(T.nilable(T::Boolean)) }
|
48
|
+
attr_reader :account_owner
|
49
|
+
sig { returns(T.nilable(String)) }
|
50
|
+
attr_reader :bio
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :email
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :first_name
|
55
|
+
sig { returns(T.nilable(Integer)) }
|
56
|
+
attr_reader :id
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :im
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :last_name
|
61
|
+
sig { returns(T.nilable(String)) }
|
62
|
+
attr_reader :locale
|
63
|
+
sig { returns(T.nilable(T::Array[String])) }
|
64
|
+
attr_reader :permissions
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :phone
|
67
|
+
sig { returns(T.nilable(Integer)) }
|
68
|
+
attr_reader :receive_announcements
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :screen_name
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :url
|
73
|
+
sig { returns(T.nilable(String)) }
|
74
|
+
attr_reader :user_type
|
75
|
+
|
76
|
+
class << self
|
77
|
+
sig do
|
78
|
+
params(
|
79
|
+
id: T.any(Integer, String),
|
80
|
+
session: Auth::Session
|
81
|
+
).returns(T.nilable(User))
|
82
|
+
end
|
83
|
+
def find(
|
84
|
+
id:,
|
85
|
+
session: ShopifyAPI::Context.active_session
|
86
|
+
)
|
87
|
+
result = base_find(
|
88
|
+
session: session,
|
89
|
+
ids: {id: id},
|
90
|
+
params: {},
|
91
|
+
)
|
92
|
+
T.cast(result[0], T.nilable(User))
|
93
|
+
end
|
94
|
+
|
95
|
+
sig do
|
96
|
+
params(
|
97
|
+
limit: T.untyped,
|
98
|
+
page_info: T.untyped,
|
99
|
+
session: Auth::Session,
|
100
|
+
kwargs: T.untyped
|
101
|
+
).returns(T::Array[User])
|
102
|
+
end
|
103
|
+
def all(
|
104
|
+
limit: nil,
|
105
|
+
page_info: nil,
|
106
|
+
session: ShopifyAPI::Context.active_session,
|
107
|
+
**kwargs
|
108
|
+
)
|
109
|
+
response = base_find(
|
110
|
+
session: session,
|
111
|
+
ids: {},
|
112
|
+
params: {limit: limit, page_info: page_info}.merge(kwargs).compact,
|
113
|
+
)
|
114
|
+
|
115
|
+
T.cast(response, T::Array[User])
|
116
|
+
end
|
117
|
+
|
118
|
+
sig do
|
119
|
+
params(
|
120
|
+
session: Auth::Session,
|
121
|
+
kwargs: T.untyped
|
122
|
+
).returns(T.untyped)
|
123
|
+
end
|
124
|
+
def current(
|
125
|
+
session: ShopifyAPI::Context.active_session,
|
126
|
+
**kwargs
|
127
|
+
)
|
128
|
+
request(
|
129
|
+
http_method: :get,
|
130
|
+
operation: :current,
|
131
|
+
session: session,
|
132
|
+
ids: {},
|
133
|
+
params: {}.merge(kwargs).compact,
|
134
|
+
body: {},
|
135
|
+
entity: nil,
|
136
|
+
)
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
end
|