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,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,188 @@
|
|
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
|
+
@authorization = T.let(nil, T.nilable(String))
|
24
|
+
@authorization_expires_at = T.let(nil, T.nilable(String))
|
25
|
+
@created_at = T.let(nil, T.nilable(String))
|
26
|
+
@currency = T.let(nil, T.nilable(String))
|
27
|
+
@currency_exchange_adjustment = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
28
|
+
@device_id = T.let(nil, T.nilable(Integer))
|
29
|
+
@error_code = T.let(nil, T.nilable(String))
|
30
|
+
@extended_authorization_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
31
|
+
@gateway = T.let(nil, T.nilable(String))
|
32
|
+
@id = T.let(nil, T.nilable(Integer))
|
33
|
+
@location_id = T.let(nil, T.nilable(Integer))
|
34
|
+
@message = T.let(nil, T.nilable(String))
|
35
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
36
|
+
@parent_id = T.let(nil, T.nilable(Integer))
|
37
|
+
@payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
38
|
+
@payments_refund_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
39
|
+
@processed_at = T.let(nil, T.nilable(String))
|
40
|
+
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
41
|
+
@source_name = T.let(nil, T.nilable(String))
|
42
|
+
@status = T.let(nil, T.nilable(String))
|
43
|
+
@test = T.let(nil, T.nilable(T::Boolean))
|
44
|
+
@total_unsettled_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
45
|
+
@user_id = T.let(nil, T.nilable(Integer))
|
46
|
+
|
47
|
+
super(session: session, from_hash: from_hash)
|
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: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/transactions/count.json"},
|
54
|
+
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/transactions.json"},
|
55
|
+
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/transactions/<id>.json"},
|
56
|
+
{http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/transactions.json"}
|
57
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
58
|
+
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :kind
|
61
|
+
sig { returns(T.nilable(String)) }
|
62
|
+
attr_reader :amount
|
63
|
+
sig { returns(T.nilable(String)) }
|
64
|
+
attr_reader :authorization
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :authorization_expires_at
|
67
|
+
sig { returns(T.nilable(String)) }
|
68
|
+
attr_reader :created_at
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :currency
|
71
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
72
|
+
attr_reader :currency_exchange_adjustment
|
73
|
+
sig { returns(T.nilable(Integer)) }
|
74
|
+
attr_reader :device_id
|
75
|
+
sig { returns(T.nilable(String)) }
|
76
|
+
attr_reader :error_code
|
77
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
78
|
+
attr_reader :extended_authorization_attributes
|
79
|
+
sig { returns(T.nilable(String)) }
|
80
|
+
attr_reader :gateway
|
81
|
+
sig { returns(T.nilable(Integer)) }
|
82
|
+
attr_reader :id
|
83
|
+
sig { returns(T.nilable(Integer)) }
|
84
|
+
attr_reader :location_id
|
85
|
+
sig { returns(T.nilable(String)) }
|
86
|
+
attr_reader :message
|
87
|
+
sig { returns(T.nilable(Integer)) }
|
88
|
+
attr_reader :order_id
|
89
|
+
sig { returns(T.nilable(Integer)) }
|
90
|
+
attr_reader :parent_id
|
91
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
92
|
+
attr_reader :payment_details
|
93
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
94
|
+
attr_reader :payments_refund_attributes
|
95
|
+
sig { returns(T.nilable(String)) }
|
96
|
+
attr_reader :processed_at
|
97
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
98
|
+
attr_reader :receipt
|
99
|
+
sig { returns(T.nilable(String)) }
|
100
|
+
attr_reader :source_name
|
101
|
+
sig { returns(T.nilable(String)) }
|
102
|
+
attr_reader :status
|
103
|
+
sig { returns(T.nilable(T::Boolean)) }
|
104
|
+
attr_reader :test
|
105
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
106
|
+
attr_reader :total_unsettled_set
|
107
|
+
sig { returns(T.nilable(Integer)) }
|
108
|
+
attr_reader :user_id
|
109
|
+
|
110
|
+
class << self
|
111
|
+
sig do
|
112
|
+
params(
|
113
|
+
id: T.any(Integer, String),
|
114
|
+
order_id: T.nilable(T.any(Integer, String)),
|
115
|
+
fields: T.untyped,
|
116
|
+
in_shop_currency: T.untyped,
|
117
|
+
session: Auth::Session
|
118
|
+
).returns(T.nilable(Transaction))
|
119
|
+
end
|
120
|
+
def find(
|
121
|
+
id:,
|
122
|
+
order_id: nil,
|
123
|
+
fields: nil,
|
124
|
+
in_shop_currency: nil,
|
125
|
+
session: ShopifyAPI::Context.active_session
|
126
|
+
)
|
127
|
+
result = base_find(
|
128
|
+
session: session,
|
129
|
+
ids: {id: id, order_id: order_id},
|
130
|
+
params: {fields: fields, in_shop_currency: in_shop_currency},
|
131
|
+
)
|
132
|
+
T.cast(result[0], T.nilable(Transaction))
|
133
|
+
end
|
134
|
+
|
135
|
+
sig do
|
136
|
+
params(
|
137
|
+
order_id: T.nilable(T.any(Integer, String)),
|
138
|
+
since_id: T.untyped,
|
139
|
+
fields: T.untyped,
|
140
|
+
in_shop_currency: T.untyped,
|
141
|
+
session: Auth::Session,
|
142
|
+
kwargs: T.untyped
|
143
|
+
).returns(T::Array[Transaction])
|
144
|
+
end
|
145
|
+
def all(
|
146
|
+
order_id: nil,
|
147
|
+
since_id: nil,
|
148
|
+
fields: nil,
|
149
|
+
in_shop_currency: nil,
|
150
|
+
session: ShopifyAPI::Context.active_session,
|
151
|
+
**kwargs
|
152
|
+
)
|
153
|
+
response = base_find(
|
154
|
+
session: session,
|
155
|
+
ids: {order_id: order_id},
|
156
|
+
params: {since_id: since_id, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
|
157
|
+
)
|
158
|
+
|
159
|
+
T.cast(response, T::Array[Transaction])
|
160
|
+
end
|
161
|
+
|
162
|
+
sig do
|
163
|
+
params(
|
164
|
+
order_id: T.nilable(T.any(Integer, String)),
|
165
|
+
session: Auth::Session,
|
166
|
+
kwargs: T.untyped
|
167
|
+
).returns(T.untyped)
|
168
|
+
end
|
169
|
+
def count(
|
170
|
+
order_id: nil,
|
171
|
+
session: ShopifyAPI::Context.active_session,
|
172
|
+
**kwargs
|
173
|
+
)
|
174
|
+
request(
|
175
|
+
http_method: :get,
|
176
|
+
operation: :count,
|
177
|
+
session: session,
|
178
|
+
ids: {order_id: order_id},
|
179
|
+
params: {}.merge(kwargs).compact,
|
180
|
+
body: {},
|
181
|
+
entity: nil,
|
182
|
+
)
|
183
|
+
end
|
184
|
+
|
185
|
+
end
|
186
|
+
|
187
|
+
end
|
188
|
+
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
|