shopify_api 12.3.0 → 12.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +40 -0
- data/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +9 -0
- data/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +9 -0
- data/.github/workflows/build.yml +0 -3
- data/.github/workflows/stale.yml +1 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +9 -9
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/rest/base.rb +11 -4
- data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_01/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_04/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_07/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_07/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_10/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_10/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2023_01/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +86 -0
- data/lib/shopify_api/rest/resources/2023_01/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2023_01/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +113 -0
- data/lib/shopify_api/rest/resources/2023_01/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_01/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2023_01/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_01/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2023_01/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2023_01/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2023_01/customer.rb +329 -0
- data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2023_01/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2023_01/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +225 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +316 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_01/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2023_01/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_01/metafield.rb +344 -0
- data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_01/order.rb +479 -0
- data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2023_01/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2023_01/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2023_01/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_01/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_01/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2023_01/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_01/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2023_01/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2023_01/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +221 -0
- data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2023_01/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2023_01/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_01/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2023_01/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2023_01/webhook.rb +168 -0
- data/lib/shopify_api/version.rb +1 -1
- metadata +78 -3
- data/.github/ISSUE_TEMPLATE.md +0 -35
@@ -0,0 +1,120 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@created_at = T.let(nil, T.nilable(String))
|
20
|
+
@id = T.let(nil, T.nilable(Integer))
|
21
|
+
@name = T.let(nil, T.nilable(String))
|
22
|
+
@previewable = T.let(nil, T.nilable(T::Boolean))
|
23
|
+
@processing = T.let(nil, T.nilable(T::Boolean))
|
24
|
+
@role = T.let(nil, T.nilable(String))
|
25
|
+
@theme_store_id = T.let(nil, T.nilable(Integer))
|
26
|
+
@updated_at = T.let(nil, T.nilable(String))
|
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: [:id], path: "themes/<id>.json"},
|
33
|
+
{http_method: :get, operation: :get, ids: [], path: "themes.json"},
|
34
|
+
{http_method: :get, operation: :get, ids: [:id], path: "themes/<id>.json"},
|
35
|
+
{http_method: :post, operation: :post, ids: [], path: "themes.json"},
|
36
|
+
{http_method: :put, operation: :put, ids: [:id], path: "themes/<id>.json"}
|
37
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
38
|
+
|
39
|
+
sig { returns(T.nilable(String)) }
|
40
|
+
attr_reader :created_at
|
41
|
+
sig { returns(T.nilable(Integer)) }
|
42
|
+
attr_reader :id
|
43
|
+
sig { returns(T.nilable(String)) }
|
44
|
+
attr_reader :name
|
45
|
+
sig { returns(T.nilable(T::Boolean)) }
|
46
|
+
attr_reader :previewable
|
47
|
+
sig { returns(T.nilable(T::Boolean)) }
|
48
|
+
attr_reader :processing
|
49
|
+
sig { returns(T.nilable(String)) }
|
50
|
+
attr_reader :role
|
51
|
+
sig { returns(T.nilable(Integer)) }
|
52
|
+
attr_reader :theme_store_id
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :updated_at
|
55
|
+
|
56
|
+
class << self
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
id: T.any(Integer, String),
|
60
|
+
fields: T.untyped,
|
61
|
+
session: Auth::Session
|
62
|
+
).returns(T.nilable(Theme))
|
63
|
+
end
|
64
|
+
def find(
|
65
|
+
id:,
|
66
|
+
fields: nil,
|
67
|
+
session: ShopifyAPI::Context.active_session
|
68
|
+
)
|
69
|
+
result = base_find(
|
70
|
+
session: session,
|
71
|
+
ids: {id: id},
|
72
|
+
params: {fields: fields},
|
73
|
+
)
|
74
|
+
T.cast(result[0], T.nilable(Theme))
|
75
|
+
end
|
76
|
+
|
77
|
+
sig do
|
78
|
+
params(
|
79
|
+
id: T.any(Integer, String),
|
80
|
+
session: Auth::Session
|
81
|
+
).returns(T.untyped)
|
82
|
+
end
|
83
|
+
def delete(
|
84
|
+
id:,
|
85
|
+
session: ShopifyAPI::Context.active_session
|
86
|
+
)
|
87
|
+
request(
|
88
|
+
http_method: :delete,
|
89
|
+
operation: :delete,
|
90
|
+
session: session,
|
91
|
+
ids: {id: id},
|
92
|
+
params: {},
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
sig do
|
97
|
+
params(
|
98
|
+
fields: T.untyped,
|
99
|
+
session: Auth::Session,
|
100
|
+
kwargs: T.untyped
|
101
|
+
).returns(T::Array[Theme])
|
102
|
+
end
|
103
|
+
def all(
|
104
|
+
fields: nil,
|
105
|
+
session: ShopifyAPI::Context.active_session,
|
106
|
+
**kwargs
|
107
|
+
)
|
108
|
+
response = base_find(
|
109
|
+
session: session,
|
110
|
+
ids: {},
|
111
|
+
params: {fields: fields}.merge(kwargs).compact,
|
112
|
+
)
|
113
|
+
|
114
|
+
T.cast(response, T::Array[Theme])
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,181 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@kind = T.let(nil, T.nilable(String))
|
20
|
+
@amount = T.let(nil, T.nilable(String))
|
21
|
+
@authorization = T.let(nil, T.nilable(String))
|
22
|
+
@authorization_expires_at = T.let(nil, T.nilable(String))
|
23
|
+
@created_at = T.let(nil, T.nilable(String))
|
24
|
+
@currency = T.let(nil, T.nilable(String))
|
25
|
+
@currency_exchange_adjustment = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
26
|
+
@device_id = T.let(nil, T.nilable(Integer))
|
27
|
+
@error_code = T.let(nil, T.nilable(String))
|
28
|
+
@extended_authorization_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
29
|
+
@gateway = T.let(nil, T.nilable(String))
|
30
|
+
@id = T.let(nil, T.nilable(Integer))
|
31
|
+
@location_id = T.let(nil, T.nilable(Integer))
|
32
|
+
@message = T.let(nil, T.nilable(String))
|
33
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
34
|
+
@parent_id = T.let(nil, T.nilable(Integer))
|
35
|
+
@payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
|
+
@payments_refund_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
37
|
+
@processed_at = T.let(nil, T.nilable(String))
|
38
|
+
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
39
|
+
@source_name = T.let(nil, T.nilable(String))
|
40
|
+
@status = T.let(nil, T.nilable(String))
|
41
|
+
@test = T.let(nil, T.nilable(T::Boolean))
|
42
|
+
@user_id = T.let(nil, T.nilable(Integer))
|
43
|
+
end
|
44
|
+
|
45
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
46
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
47
|
+
@paths = T.let([
|
48
|
+
{http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/transactions/count.json"},
|
49
|
+
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/transactions.json"},
|
50
|
+
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/transactions/<id>.json"},
|
51
|
+
{http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/transactions.json"}
|
52
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
53
|
+
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :kind
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :amount
|
58
|
+
sig { returns(T.nilable(String)) }
|
59
|
+
attr_reader :authorization
|
60
|
+
sig { returns(T.nilable(String)) }
|
61
|
+
attr_reader :authorization_expires_at
|
62
|
+
sig { returns(T.nilable(String)) }
|
63
|
+
attr_reader :created_at
|
64
|
+
sig { returns(T.nilable(String)) }
|
65
|
+
attr_reader :currency
|
66
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
67
|
+
attr_reader :currency_exchange_adjustment
|
68
|
+
sig { returns(T.nilable(Integer)) }
|
69
|
+
attr_reader :device_id
|
70
|
+
sig { returns(T.nilable(String)) }
|
71
|
+
attr_reader :error_code
|
72
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
73
|
+
attr_reader :extended_authorization_attributes
|
74
|
+
sig { returns(T.nilable(String)) }
|
75
|
+
attr_reader :gateway
|
76
|
+
sig { returns(T.nilable(Integer)) }
|
77
|
+
attr_reader :id
|
78
|
+
sig { returns(T.nilable(Integer)) }
|
79
|
+
attr_reader :location_id
|
80
|
+
sig { returns(T.nilable(String)) }
|
81
|
+
attr_reader :message
|
82
|
+
sig { returns(T.nilable(Integer)) }
|
83
|
+
attr_reader :order_id
|
84
|
+
sig { returns(T.nilable(Integer)) }
|
85
|
+
attr_reader :parent_id
|
86
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
87
|
+
attr_reader :payment_details
|
88
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
89
|
+
attr_reader :payments_refund_attributes
|
90
|
+
sig { returns(T.nilable(String)) }
|
91
|
+
attr_reader :processed_at
|
92
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
93
|
+
attr_reader :receipt
|
94
|
+
sig { returns(T.nilable(String)) }
|
95
|
+
attr_reader :source_name
|
96
|
+
sig { returns(T.nilable(String)) }
|
97
|
+
attr_reader :status
|
98
|
+
sig { returns(T.nilable(T::Boolean)) }
|
99
|
+
attr_reader :test
|
100
|
+
sig { returns(T.nilable(Integer)) }
|
101
|
+
attr_reader :user_id
|
102
|
+
|
103
|
+
class << self
|
104
|
+
sig do
|
105
|
+
params(
|
106
|
+
id: T.any(Integer, String),
|
107
|
+
order_id: T.nilable(T.any(Integer, String)),
|
108
|
+
fields: T.untyped,
|
109
|
+
in_shop_currency: T.untyped,
|
110
|
+
session: Auth::Session
|
111
|
+
).returns(T.nilable(Transaction))
|
112
|
+
end
|
113
|
+
def find(
|
114
|
+
id:,
|
115
|
+
order_id: nil,
|
116
|
+
fields: nil,
|
117
|
+
in_shop_currency: nil,
|
118
|
+
session: ShopifyAPI::Context.active_session
|
119
|
+
)
|
120
|
+
result = base_find(
|
121
|
+
session: session,
|
122
|
+
ids: {id: id, order_id: order_id},
|
123
|
+
params: {fields: fields, in_shop_currency: in_shop_currency},
|
124
|
+
)
|
125
|
+
T.cast(result[0], T.nilable(Transaction))
|
126
|
+
end
|
127
|
+
|
128
|
+
sig do
|
129
|
+
params(
|
130
|
+
order_id: T.nilable(T.any(Integer, String)),
|
131
|
+
since_id: T.untyped,
|
132
|
+
fields: T.untyped,
|
133
|
+
in_shop_currency: T.untyped,
|
134
|
+
session: Auth::Session,
|
135
|
+
kwargs: T.untyped
|
136
|
+
).returns(T::Array[Transaction])
|
137
|
+
end
|
138
|
+
def all(
|
139
|
+
order_id: nil,
|
140
|
+
since_id: nil,
|
141
|
+
fields: nil,
|
142
|
+
in_shop_currency: nil,
|
143
|
+
session: ShopifyAPI::Context.active_session,
|
144
|
+
**kwargs
|
145
|
+
)
|
146
|
+
response = base_find(
|
147
|
+
session: session,
|
148
|
+
ids: {order_id: order_id},
|
149
|
+
params: {since_id: since_id, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
|
150
|
+
)
|
151
|
+
|
152
|
+
T.cast(response, T::Array[Transaction])
|
153
|
+
end
|
154
|
+
|
155
|
+
sig do
|
156
|
+
params(
|
157
|
+
order_id: T.nilable(T.any(Integer, String)),
|
158
|
+
session: Auth::Session,
|
159
|
+
kwargs: T.untyped
|
160
|
+
).returns(T.untyped)
|
161
|
+
end
|
162
|
+
def count(
|
163
|
+
order_id: nil,
|
164
|
+
session: ShopifyAPI::Context.active_session,
|
165
|
+
**kwargs
|
166
|
+
)
|
167
|
+
request(
|
168
|
+
http_method: :get,
|
169
|
+
operation: :count,
|
170
|
+
session: session,
|
171
|
+
ids: {order_id: order_id},
|
172
|
+
params: {}.merge(kwargs).compact,
|
173
|
+
body: {},
|
174
|
+
entity: nil,
|
175
|
+
)
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,97 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@created_at = T.let(nil, T.nilable(String))
|
20
|
+
@description = T.let(nil, T.nilable(String))
|
21
|
+
@id = T.let(nil, T.nilable(Integer))
|
22
|
+
@price = T.let(nil, T.nilable(Integer))
|
23
|
+
@recurring_application_charge_id = T.let(nil, T.nilable(Integer))
|
24
|
+
@updated_at = 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: [:recurring_application_charge_id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges.json"},
|
31
|
+
{http_method: :get, operation: :get, ids: [:recurring_application_charge_id, :id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges/<id>.json"},
|
32
|
+
{http_method: :post, operation: :post, ids: [:recurring_application_charge_id], path: "recurring_application_charges/<recurring_application_charge_id>/usage_charges.json"}
|
33
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
34
|
+
|
35
|
+
sig { returns(T.nilable(String)) }
|
36
|
+
attr_reader :created_at
|
37
|
+
sig { returns(T.nilable(String)) }
|
38
|
+
attr_reader :description
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
40
|
+
attr_reader :id
|
41
|
+
sig { returns(T.nilable(Integer)) }
|
42
|
+
attr_reader :price
|
43
|
+
sig { returns(T.nilable(Integer)) }
|
44
|
+
attr_reader :recurring_application_charge_id
|
45
|
+
sig { returns(T.nilable(String)) }
|
46
|
+
attr_reader :updated_at
|
47
|
+
|
48
|
+
class << self
|
49
|
+
sig do
|
50
|
+
params(
|
51
|
+
id: T.any(Integer, String),
|
52
|
+
recurring_application_charge_id: T.nilable(T.any(Integer, String)),
|
53
|
+
fields: T.untyped,
|
54
|
+
session: Auth::Session
|
55
|
+
).returns(T.nilable(UsageCharge))
|
56
|
+
end
|
57
|
+
def find(
|
58
|
+
id:,
|
59
|
+
recurring_application_charge_id: nil,
|
60
|
+
fields: nil,
|
61
|
+
session: ShopifyAPI::Context.active_session
|
62
|
+
)
|
63
|
+
result = base_find(
|
64
|
+
session: session,
|
65
|
+
ids: {id: id, recurring_application_charge_id: recurring_application_charge_id},
|
66
|
+
params: {fields: fields},
|
67
|
+
)
|
68
|
+
T.cast(result[0], T.nilable(UsageCharge))
|
69
|
+
end
|
70
|
+
|
71
|
+
sig do
|
72
|
+
params(
|
73
|
+
recurring_application_charge_id: T.nilable(T.any(Integer, String)),
|
74
|
+
fields: T.untyped,
|
75
|
+
session: Auth::Session,
|
76
|
+
kwargs: T.untyped
|
77
|
+
).returns(T::Array[UsageCharge])
|
78
|
+
end
|
79
|
+
def all(
|
80
|
+
recurring_application_charge_id: nil,
|
81
|
+
fields: nil,
|
82
|
+
session: ShopifyAPI::Context.active_session,
|
83
|
+
**kwargs
|
84
|
+
)
|
85
|
+
response = base_find(
|
86
|
+
session: session,
|
87
|
+
ids: {recurring_application_charge_id: recurring_application_charge_id},
|
88
|
+
params: {fields: fields}.merge(kwargs).compact,
|
89
|
+
)
|
90
|
+
|
91
|
+
T.cast(response, T::Array[UsageCharge])
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,138 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@account_owner = T.let(nil, T.nilable(T::Boolean))
|
20
|
+
@bio = T.let(nil, T.nilable(String))
|
21
|
+
@email = T.let(nil, T.nilable(String))
|
22
|
+
@first_name = T.let(nil, T.nilable(String))
|
23
|
+
@id = T.let(nil, T.nilable(Integer))
|
24
|
+
@im = T.let(nil, T.nilable(String))
|
25
|
+
@last_name = T.let(nil, T.nilable(String))
|
26
|
+
@locale = T.let(nil, T.nilable(String))
|
27
|
+
@permissions = T.let(nil, T.nilable(T::Array[T.untyped]))
|
28
|
+
@phone = T.let(nil, T.nilable(String))
|
29
|
+
@receive_announcements = T.let(nil, T.nilable(Integer))
|
30
|
+
@screen_name = T.let(nil, T.nilable(String))
|
31
|
+
@url = T.let(nil, T.nilable(String))
|
32
|
+
@user_type = T.let(nil, T.nilable(String))
|
33
|
+
end
|
34
|
+
|
35
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
36
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
37
|
+
@paths = T.let([
|
38
|
+
{http_method: :get, operation: :current, ids: [], path: "users/current.json"},
|
39
|
+
{http_method: :get, operation: :get, ids: [], path: "users.json"},
|
40
|
+
{http_method: :get, operation: :get, ids: [:id], path: "users/<id>.json"}
|
41
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
42
|
+
|
43
|
+
sig { returns(T.nilable(T::Boolean)) }
|
44
|
+
attr_reader :account_owner
|
45
|
+
sig { returns(T.nilable(String)) }
|
46
|
+
attr_reader :bio
|
47
|
+
sig { returns(T.nilable(String)) }
|
48
|
+
attr_reader :email
|
49
|
+
sig { returns(T.nilable(String)) }
|
50
|
+
attr_reader :first_name
|
51
|
+
sig { returns(T.nilable(Integer)) }
|
52
|
+
attr_reader :id
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :im
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :last_name
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :locale
|
59
|
+
sig { returns(T.nilable(T::Array[String])) }
|
60
|
+
attr_reader :permissions
|
61
|
+
sig { returns(T.nilable(String)) }
|
62
|
+
attr_reader :phone
|
63
|
+
sig { returns(T.nilable(Integer)) }
|
64
|
+
attr_reader :receive_announcements
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :screen_name
|
67
|
+
sig { returns(T.nilable(String)) }
|
68
|
+
attr_reader :url
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :user_type
|
71
|
+
|
72
|
+
class << self
|
73
|
+
sig do
|
74
|
+
params(
|
75
|
+
id: T.any(Integer, String),
|
76
|
+
session: Auth::Session
|
77
|
+
).returns(T.nilable(User))
|
78
|
+
end
|
79
|
+
def find(
|
80
|
+
id:,
|
81
|
+
session: ShopifyAPI::Context.active_session
|
82
|
+
)
|
83
|
+
result = base_find(
|
84
|
+
session: session,
|
85
|
+
ids: {id: id},
|
86
|
+
params: {},
|
87
|
+
)
|
88
|
+
T.cast(result[0], T.nilable(User))
|
89
|
+
end
|
90
|
+
|
91
|
+
sig do
|
92
|
+
params(
|
93
|
+
limit: T.untyped,
|
94
|
+
page_info: T.untyped,
|
95
|
+
session: Auth::Session,
|
96
|
+
kwargs: T.untyped
|
97
|
+
).returns(T::Array[User])
|
98
|
+
end
|
99
|
+
def all(
|
100
|
+
limit: nil,
|
101
|
+
page_info: nil,
|
102
|
+
session: ShopifyAPI::Context.active_session,
|
103
|
+
**kwargs
|
104
|
+
)
|
105
|
+
response = base_find(
|
106
|
+
session: session,
|
107
|
+
ids: {},
|
108
|
+
params: {limit: limit, page_info: page_info}.merge(kwargs).compact,
|
109
|
+
)
|
110
|
+
|
111
|
+
T.cast(response, T::Array[User])
|
112
|
+
end
|
113
|
+
|
114
|
+
sig do
|
115
|
+
params(
|
116
|
+
session: Auth::Session,
|
117
|
+
kwargs: T.untyped
|
118
|
+
).returns(T.untyped)
|
119
|
+
end
|
120
|
+
def current(
|
121
|
+
session: ShopifyAPI::Context.active_session,
|
122
|
+
**kwargs
|
123
|
+
)
|
124
|
+
request(
|
125
|
+
http_method: :get,
|
126
|
+
operation: :current,
|
127
|
+
session: session,
|
128
|
+
ids: {},
|
129
|
+
params: {}.merge(kwargs).compact,
|
130
|
+
body: {},
|
131
|
+
entity: nil,
|
132
|
+
)
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|