shopify_api 14.1.0 → 14.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/BREAKING_CHANGES_FOR_V15.md +42 -0
- data/CHANGELOG.md +36 -1
- data/Gemfile.lock +15 -11
- data/README.md +3 -0
- data/docs/getting_started.md +17 -2
- data/docs/usage/custom_apps.md +32 -1
- data/docs/usage/oauth.md +88 -16
- data/docs/usage/webhooks.md +3 -2
- data/lib/shopify_api/admin_versions.rb +3 -1
- data/lib/shopify_api/auth/jwt_payload.rb +11 -3
- data/lib/shopify_api/auth/session.rb +11 -0
- data/lib/shopify_api/clients/graphql/client.rb +14 -3
- data/lib/shopify_api/clients/graphql/storefront.rb +12 -2
- data/lib/shopify_api/rest/base.rb +7 -1
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2022_07/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2022_10/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2022_10/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2023_01/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2023_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2023_07/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_07/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_07/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2023_10/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2023_10/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2024_01/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2024_01/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2024_01/shop.rb +14 -4
- data/lib/shopify_api/rest/resources/2024_04/customer.rb +1 -0
- data/lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb +9 -0
- data/lib/shopify_api/rest/resources/2024_04/shop.rb +14 -4
- 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 +335 -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 +184 -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 +232 -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/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 +172 -0
- data/lib/shopify_api/utils/attributes_comparator.rb +21 -4
- data/lib/shopify_api/utils/session_utils.rb +24 -17
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +5 -4
- data/sorbet/rbi/shims/hash.rb +3 -0
- metadata +154 -6
@@ -2,6 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "active_support/inflector"
|
5
|
+
require "active_support/core_ext/hash/indifferent_access"
|
5
6
|
|
6
7
|
module ShopifyAPI
|
7
8
|
module Rest
|
@@ -16,6 +17,7 @@ module ShopifyAPI
|
|
16
17
|
@paths = T.let([], T::Array[T::Hash[Symbol, T.any(T::Array[Symbol], String, Symbol)]])
|
17
18
|
@custom_prefix = T.let(nil, T.nilable(String))
|
18
19
|
@read_only_attributes = T.let([], T.nilable(T::Array[Symbol]))
|
20
|
+
@atomic_hash_attributes = T.let([], T::Array[Symbol])
|
19
21
|
@aliased_properties = T.let({}, T::Hash[String, String])
|
20
22
|
|
21
23
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
@@ -61,6 +63,9 @@ module ShopifyAPI
|
|
61
63
|
sig { returns(T::Hash[Symbol, T::Class[T.anything]]) }
|
62
64
|
attr_reader :has_one
|
63
65
|
|
66
|
+
sig { returns(T.nilable(T::Array[Symbol])) }
|
67
|
+
attr_reader :atomic_hash_attributes
|
68
|
+
|
64
69
|
sig { returns(T.nilable(T::Hash[T.any(Symbol, String), String])) }
|
65
70
|
attr_accessor :headers
|
66
71
|
|
@@ -248,7 +253,7 @@ module ShopifyAPI
|
|
248
253
|
def create_instances_from_response(response:, session:)
|
249
254
|
objects = []
|
250
255
|
|
251
|
-
body = T.cast(response.body, T::Hash[String, T.untyped])
|
256
|
+
body = T.cast(response.body, T::Hash[String, T.untyped]).with_indifferent_access
|
252
257
|
|
253
258
|
response_names = json_response_body_names
|
254
259
|
|
@@ -417,6 +422,7 @@ module ShopifyAPI
|
|
417
422
|
ShopifyAPI::Utils::AttributesComparator.compare(
|
418
423
|
stringified_updatable_attributes,
|
419
424
|
stringified_new_attributes,
|
425
|
+
atomic_hash_attributes: self.class.atomic_hash_attributes || [],
|
420
426
|
)
|
421
427
|
end
|
422
428
|
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -38,7 +38,7 @@ module ShopifyAPI
|
|
38
38
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
40
40
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
41
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
41
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
44
44
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -123,7 +123,7 @@ module ShopifyAPI
|
|
123
123
|
attr_reader :force_ssl
|
124
124
|
sig { returns(T.nilable(String)) }
|
125
125
|
attr_reader :google_apps_domain
|
126
|
-
sig { returns(T.nilable(
|
126
|
+
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :google_apps_login_enabled
|
128
128
|
sig { returns(T.nilable(T::Boolean)) }
|
129
129
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -38,7 +38,7 @@ module ShopifyAPI
|
|
38
38
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
40
40
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
41
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
41
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
44
44
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -123,7 +123,7 @@ module ShopifyAPI
|
|
123
123
|
attr_reader :force_ssl
|
124
124
|
sig { returns(T.nilable(String)) }
|
125
125
|
attr_reader :google_apps_domain
|
126
|
-
sig { returns(T.nilable(
|
126
|
+
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :google_apps_login_enabled
|
128
128
|
sig { returns(T.nilable(T::Boolean)) }
|
129
129
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|
@@ -55,6 +55,7 @@ module ShopifyAPI
|
|
55
55
|
metafield: Metafield
|
56
56
|
}, T::Hash[Symbol, Class])
|
57
57
|
@has_many = T.let({}, T::Hash[Symbol, Class])
|
58
|
+
@atomic_hash_attributes = [:email_marketing_consent]
|
58
59
|
@paths = T.let([
|
59
60
|
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
|
60
61
|
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
|
@@ -149,6 +149,15 @@ module ShopifyAPI
|
|
149
149
|
T.cast(response, T::Array[RecurringApplicationCharge])
|
150
150
|
end
|
151
151
|
|
152
|
+
sig do
|
153
|
+
params(session: Auth::Session)
|
154
|
+
.returns(T.nilable(RecurringApplicationCharge))
|
155
|
+
end
|
156
|
+
def current(session: ShopifyAPI::Context.active_session)
|
157
|
+
charges = all(session: session)
|
158
|
+
charges.select { |charge| charge.status == "active" }.first
|
159
|
+
end
|
160
|
+
|
152
161
|
end
|
153
162
|
|
154
163
|
sig do
|
@@ -37,7 +37,7 @@ module ShopifyAPI
|
|
37
37
|
@finances = T.let(nil, T.nilable(T::Boolean))
|
38
38
|
@force_ssl = T.let(nil, T.nilable(T::Boolean))
|
39
39
|
@google_apps_domain = T.let(nil, T.nilable(String))
|
40
|
-
@google_apps_login_enabled = T.let(nil, T.nilable(
|
40
|
+
@google_apps_login_enabled = T.let(nil, T.nilable(T::Boolean))
|
41
41
|
@has_discounts = T.let(nil, T.nilable(T::Boolean))
|
42
42
|
@has_gift_cards = T.let(nil, T.nilable(T::Boolean))
|
43
43
|
@has_storefront = T.let(nil, T.nilable(T::Boolean))
|
@@ -66,7 +66,7 @@ module ShopifyAPI
|
|
66
66
|
@setup_required = T.let(nil, T.nilable(T::Boolean))
|
67
67
|
@shop_owner = T.let(nil, T.nilable(String))
|
68
68
|
@source = T.let(nil, T.nilable(String))
|
69
|
-
@tax_shipping = T.let(nil, T.nilable(
|
69
|
+
@tax_shipping = T.let(nil, T.nilable(T::Boolean))
|
70
70
|
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
71
71
|
@timezone = T.let(nil, T.nilable(String))
|
72
72
|
@transactional_sms_disabled = T.let(nil, T.nilable(T::Boolean))
|
@@ -121,7 +121,7 @@ module ShopifyAPI
|
|
121
121
|
attr_reader :force_ssl
|
122
122
|
sig { returns(T.nilable(String)) }
|
123
123
|
attr_reader :google_apps_domain
|
124
|
-
sig { returns(T.nilable(
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
125
125
|
attr_reader :google_apps_login_enabled
|
126
126
|
sig { returns(T.nilable(T::Boolean)) }
|
127
127
|
attr_reader :has_discounts
|
@@ -179,7 +179,7 @@ module ShopifyAPI
|
|
179
179
|
attr_reader :shop_owner
|
180
180
|
sig { returns(T.nilable(String)) }
|
181
181
|
attr_reader :source
|
182
|
-
sig { returns(T.nilable(
|
182
|
+
sig { returns(T.nilable(T::Boolean)) }
|
183
183
|
attr_reader :tax_shipping
|
184
184
|
sig { returns(T.nilable(T::Boolean)) }
|
185
185
|
attr_reader :taxes_included
|
@@ -216,6 +216,16 @@ module ShopifyAPI
|
|
216
216
|
T.cast(response, T::Array[Shop])
|
217
217
|
end
|
218
218
|
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
fields: T.untyped,
|
222
|
+
session: Auth::Session,
|
223
|
+
).returns(T.nilable(Shop))
|
224
|
+
end
|
225
|
+
def current(fields: nil, session: ShopifyAPI::Context.active_session)
|
226
|
+
all(session: session, fields: fields).first
|
227
|
+
end
|
228
|
+
|
219
229
|
end
|
220
230
|
|
221
231
|
end
|