shopify_api 12.5.0 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +2 -2
- data/lib/shopify_api/auth/oauth.rb +0 -2
- data/lib/shopify_api/clients/http_client.rb +13 -9
- data/lib/shopify_api/context.rb +4 -20
- data/lib/shopify_api/rest/base.rb +48 -14
- data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +77 -0
- data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +109 -0
- data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +92 -0
- data/lib/shopify_api/rest/resources/2022_04/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2022_04/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +86 -0
- data/lib/shopify_api/rest/resources/2022_04/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2022_04/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +116 -0
- data/lib/shopify_api/rest/resources/2022_04/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_04/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_04/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_04/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2022_04/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2022_04/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +329 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +222 -0
- data/lib/shopify_api/rest/resources/2022_04/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2022_04/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +278 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +284 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +218 -0
- data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2022_04/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2022_04/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2022_04/metafield.rb +344 -0
- data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2022_04/order.rb +473 -0
- data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +142 -0
- data/lib/shopify_api/rest/resources/2022_04/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2022_04/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2022_04/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2022_04/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_04/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2022_04/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +172 -0
- data/lib/shopify_api/rest/resources/2022_04/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2022_04/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2022_04/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +218 -0
- data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2022_04/theme.rb +123 -0
- data/lib/shopify_api/rest/resources/2022_04/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +102 -0
- data/lib/shopify_api/rest/resources/2022_04/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2022_04/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2022_04/webhook.rb +168 -0
- data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/carrier_service.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_07/discount_code.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/draft_order.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/event.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +6 -0
- data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +8 -5
- data/lib/shopify_api/rest/resources/2022_07/order_risk.rb +9 -2
- data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/theme.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/carrier_service.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_10/discount_code.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_10/dispute.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/draft_order.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/event.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +6 -0
- data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +8 -5
- data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +9 -2
- data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/theme.rb +3 -0
- data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_01/dispute.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/event.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +6 -0
- data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +8 -5
- data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +9 -2
- data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/theme.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/application_credit.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/carrier_service.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_04/discount_code.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_04/dispute.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/draft_order.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/event.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/fulfillment.rb +6 -0
- data/lib/shopify_api/rest/resources/2023_04/gift_card.rb +8 -5
- data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +9 -2
- data/lib/shopify_api/rest/resources/2023_04/shipping_zone.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/theme.rb +3 -0
- data/lib/shopify_api/rest/resources/2023_04/usage_charge.rb +2 -2
- data/lib/shopify_api/utils/graphql_proxy.rb +3 -6
- data/lib/shopify_api/utils/session_utils.rb +0 -84
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +1 -1
- metadata +77 -5
- data/lib/shopify_api/auth/file_session_storage.rb +0 -72
- data/lib/shopify_api/auth/session_storage.rb +0 -30
@@ -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 Collect < 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
|
+
@collection_id = T.let(nil, T.nilable(Integer))
|
20
|
+
@created_at = T.let(nil, T.nilable(String))
|
21
|
+
@id = T.let(nil, T.nilable(Integer))
|
22
|
+
@position = T.let(nil, T.nilable(Integer))
|
23
|
+
@product_id = T.let(nil, T.nilable(Integer))
|
24
|
+
@sort_value = T.let(nil, T.nilable(String))
|
25
|
+
@updated_at = T.let(nil, T.nilable(String))
|
26
|
+
end
|
27
|
+
|
28
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
29
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
30
|
+
@paths = T.let([
|
31
|
+
{http_method: :delete, operation: :delete, ids: [:id], path: "collects/<id>.json"},
|
32
|
+
{http_method: :get, operation: :count, ids: [], path: "collects/count.json"},
|
33
|
+
{http_method: :get, operation: :get, ids: [], path: "collects.json"},
|
34
|
+
{http_method: :get, operation: :get, ids: [:id], path: "collects/<id>.json"},
|
35
|
+
{http_method: :post, operation: :post, ids: [], path: "collects.json"}
|
36
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
37
|
+
|
38
|
+
sig { returns(T.nilable(Integer)) }
|
39
|
+
attr_reader :collection_id
|
40
|
+
sig { returns(T.nilable(String)) }
|
41
|
+
attr_reader :created_at
|
42
|
+
sig { returns(T.nilable(Integer)) }
|
43
|
+
attr_reader :id
|
44
|
+
sig { returns(T.nilable(Integer)) }
|
45
|
+
attr_reader :position
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
47
|
+
attr_reader :product_id
|
48
|
+
sig { returns(T.nilable(String)) }
|
49
|
+
attr_reader :sort_value
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_reader :updated_at
|
52
|
+
|
53
|
+
class << self
|
54
|
+
sig do
|
55
|
+
params(
|
56
|
+
id: T.any(Integer, String),
|
57
|
+
fields: T.untyped,
|
58
|
+
session: Auth::Session
|
59
|
+
).returns(T.nilable(Collect))
|
60
|
+
end
|
61
|
+
def find(
|
62
|
+
id:,
|
63
|
+
fields: nil,
|
64
|
+
session: ShopifyAPI::Context.active_session
|
65
|
+
)
|
66
|
+
result = base_find(
|
67
|
+
session: session,
|
68
|
+
ids: {id: id},
|
69
|
+
params: {fields: fields},
|
70
|
+
)
|
71
|
+
T.cast(result[0], T.nilable(Collect))
|
72
|
+
end
|
73
|
+
|
74
|
+
sig do
|
75
|
+
params(
|
76
|
+
id: T.any(Integer, String),
|
77
|
+
session: Auth::Session
|
78
|
+
).returns(T.untyped)
|
79
|
+
end
|
80
|
+
def delete(
|
81
|
+
id:,
|
82
|
+
session: ShopifyAPI::Context.active_session
|
83
|
+
)
|
84
|
+
request(
|
85
|
+
http_method: :delete,
|
86
|
+
operation: :delete,
|
87
|
+
session: session,
|
88
|
+
ids: {id: id},
|
89
|
+
params: {},
|
90
|
+
)
|
91
|
+
end
|
92
|
+
|
93
|
+
sig do
|
94
|
+
params(
|
95
|
+
limit: T.untyped,
|
96
|
+
since_id: T.untyped,
|
97
|
+
fields: T.untyped,
|
98
|
+
session: Auth::Session,
|
99
|
+
kwargs: T.untyped
|
100
|
+
).returns(T::Array[Collect])
|
101
|
+
end
|
102
|
+
def all(
|
103
|
+
limit: nil,
|
104
|
+
since_id: nil,
|
105
|
+
fields: nil,
|
106
|
+
session: ShopifyAPI::Context.active_session,
|
107
|
+
**kwargs
|
108
|
+
)
|
109
|
+
response = base_find(
|
110
|
+
session: session,
|
111
|
+
ids: {},
|
112
|
+
params: {limit: limit, since_id: since_id, fields: fields}.merge(kwargs).compact,
|
113
|
+
)
|
114
|
+
|
115
|
+
T.cast(response, T::Array[Collect])
|
116
|
+
end
|
117
|
+
|
118
|
+
sig do
|
119
|
+
params(
|
120
|
+
session: Auth::Session,
|
121
|
+
kwargs: T.untyped
|
122
|
+
).returns(T.untyped)
|
123
|
+
end
|
124
|
+
def count(
|
125
|
+
session: ShopifyAPI::Context.active_session,
|
126
|
+
**kwargs
|
127
|
+
)
|
128
|
+
request(
|
129
|
+
http_method: :get,
|
130
|
+
operation: :count,
|
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
|
@@ -0,0 +1,110 @@
|
|
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 Collection < 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
|
+
@title = T.let(nil, T.nilable(String))
|
20
|
+
@body_html = T.let(nil, T.nilable(String))
|
21
|
+
@handle = T.let(nil, T.nilable(String))
|
22
|
+
@id = T.let(nil, T.nilable(Integer))
|
23
|
+
@image = T.let(nil, T.nilable(Image))
|
24
|
+
@published_at = T.let(nil, T.nilable(String))
|
25
|
+
@published_scope = T.let(nil, T.nilable(String))
|
26
|
+
@sort_order = T.let(nil, T.nilable(String))
|
27
|
+
@template_suffix = T.let(nil, T.nilable(String))
|
28
|
+
@updated_at = T.let(nil, T.nilable(String))
|
29
|
+
end
|
30
|
+
|
31
|
+
@has_one = T.let({
|
32
|
+
image: Image
|
33
|
+
}, T::Hash[Symbol, Class])
|
34
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
35
|
+
@paths = T.let([
|
36
|
+
{http_method: :get, operation: :get, ids: [:id], path: "collections/<id>.json"},
|
37
|
+
{http_method: :get, operation: :products, ids: [:id], path: "collections/<id>/products.json"}
|
38
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
39
|
+
|
40
|
+
sig { returns(T.nilable(String)) }
|
41
|
+
attr_reader :title
|
42
|
+
sig { returns(T.nilable(String)) }
|
43
|
+
attr_reader :body_html
|
44
|
+
sig { returns(T.nilable(String)) }
|
45
|
+
attr_reader :handle
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
47
|
+
attr_reader :id
|
48
|
+
sig { returns(T.nilable(Image)) }
|
49
|
+
attr_reader :image
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_reader :published_at
|
52
|
+
sig { returns(T.nilable(String)) }
|
53
|
+
attr_reader :published_scope
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :sort_order
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :template_suffix
|
58
|
+
sig { returns(T.nilable(String)) }
|
59
|
+
attr_reader :updated_at
|
60
|
+
|
61
|
+
class << self
|
62
|
+
sig do
|
63
|
+
params(
|
64
|
+
id: T.any(Integer, String),
|
65
|
+
fields: T.untyped,
|
66
|
+
session: Auth::Session
|
67
|
+
).returns(T.nilable(Collection))
|
68
|
+
end
|
69
|
+
def find(
|
70
|
+
id:,
|
71
|
+
fields: nil,
|
72
|
+
session: ShopifyAPI::Context.active_session
|
73
|
+
)
|
74
|
+
result = base_find(
|
75
|
+
session: session,
|
76
|
+
ids: {id: id},
|
77
|
+
params: {fields: fields},
|
78
|
+
)
|
79
|
+
T.cast(result[0], T.nilable(Collection))
|
80
|
+
end
|
81
|
+
|
82
|
+
sig do
|
83
|
+
params(
|
84
|
+
id: T.any(Integer, String),
|
85
|
+
limit: T.untyped,
|
86
|
+
session: Auth::Session,
|
87
|
+
kwargs: T.untyped
|
88
|
+
).returns(T.untyped)
|
89
|
+
end
|
90
|
+
def products(
|
91
|
+
id:,
|
92
|
+
limit: nil,
|
93
|
+
session: ShopifyAPI::Context.active_session,
|
94
|
+
**kwargs
|
95
|
+
)
|
96
|
+
request(
|
97
|
+
http_method: :get,
|
98
|
+
operation: :products,
|
99
|
+
session: session,
|
100
|
+
ids: {id: id},
|
101
|
+
params: {limit: limit}.merge(kwargs).compact,
|
102
|
+
body: {},
|
103
|
+
entity: nil,
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,155 @@
|
|
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 CollectionListing < 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
|
+
@body_html = T.let(nil, T.nilable(String))
|
20
|
+
@collection_id = T.let(nil, T.nilable(Integer))
|
21
|
+
@default_product_image = T.let(nil, T.nilable(T::Array[T.untyped]))
|
22
|
+
@handle = T.let(nil, T.nilable(String))
|
23
|
+
@image = T.let(nil, T.nilable(Image))
|
24
|
+
@published_at = T.let(nil, T.nilable(String))
|
25
|
+
@sort_order = T.let(nil, T.nilable(String))
|
26
|
+
@title = T.let(nil, T.nilable(String))
|
27
|
+
@updated_at = T.let(nil, T.nilable(String))
|
28
|
+
end
|
29
|
+
|
30
|
+
@has_one = T.let({
|
31
|
+
image: Image
|
32
|
+
}, T::Hash[Symbol, Class])
|
33
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
34
|
+
@paths = T.let([
|
35
|
+
{http_method: :delete, operation: :delete, ids: [:collection_id], path: "collection_listings/<collection_id>.json"},
|
36
|
+
{http_method: :get, operation: :get, ids: [], path: "collection_listings.json"},
|
37
|
+
{http_method: :get, operation: :get, ids: [:collection_id], path: "collection_listings/<collection_id>.json"},
|
38
|
+
{http_method: :get, operation: :product_ids, ids: [:collection_id], path: "collection_listings/<collection_id>/product_ids.json"},
|
39
|
+
{http_method: :put, operation: :put, ids: [:collection_id], path: "collection_listings/<collection_id>.json"}
|
40
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
41
|
+
|
42
|
+
sig { returns(T.nilable(String)) }
|
43
|
+
attr_reader :body_html
|
44
|
+
sig { returns(T.nilable(Integer)) }
|
45
|
+
attr_reader :collection_id
|
46
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
47
|
+
attr_reader :default_product_image
|
48
|
+
sig { returns(T.nilable(String)) }
|
49
|
+
attr_reader :handle
|
50
|
+
sig { returns(T.nilable(Image)) }
|
51
|
+
attr_reader :image
|
52
|
+
sig { returns(T.nilable(String)) }
|
53
|
+
attr_reader :published_at
|
54
|
+
sig { returns(T.nilable(String)) }
|
55
|
+
attr_reader :sort_order
|
56
|
+
sig { returns(T.nilable(String)) }
|
57
|
+
attr_reader :title
|
58
|
+
sig { returns(T.nilable(String)) }
|
59
|
+
attr_reader :updated_at
|
60
|
+
|
61
|
+
class << self
|
62
|
+
sig do
|
63
|
+
returns(String)
|
64
|
+
end
|
65
|
+
def primary_key()
|
66
|
+
"collection_id"
|
67
|
+
end
|
68
|
+
|
69
|
+
sig do
|
70
|
+
params(
|
71
|
+
collection_id: T.any(Integer, String),
|
72
|
+
session: Auth::Session
|
73
|
+
).returns(T.nilable(CollectionListing))
|
74
|
+
end
|
75
|
+
def find(
|
76
|
+
collection_id:,
|
77
|
+
session: ShopifyAPI::Context.active_session
|
78
|
+
)
|
79
|
+
result = base_find(
|
80
|
+
session: session,
|
81
|
+
ids: {collection_id: collection_id},
|
82
|
+
params: {},
|
83
|
+
)
|
84
|
+
T.cast(result[0], T.nilable(CollectionListing))
|
85
|
+
end
|
86
|
+
|
87
|
+
sig do
|
88
|
+
params(
|
89
|
+
collection_id: T.any(Integer, String),
|
90
|
+
session: Auth::Session
|
91
|
+
).returns(T.untyped)
|
92
|
+
end
|
93
|
+
def delete(
|
94
|
+
collection_id:,
|
95
|
+
session: ShopifyAPI::Context.active_session
|
96
|
+
)
|
97
|
+
request(
|
98
|
+
http_method: :delete,
|
99
|
+
operation: :delete,
|
100
|
+
session: session,
|
101
|
+
ids: {collection_id: collection_id},
|
102
|
+
params: {},
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
sig do
|
107
|
+
params(
|
108
|
+
limit: T.untyped,
|
109
|
+
session: Auth::Session,
|
110
|
+
kwargs: T.untyped
|
111
|
+
).returns(T::Array[CollectionListing])
|
112
|
+
end
|
113
|
+
def all(
|
114
|
+
limit: nil,
|
115
|
+
session: ShopifyAPI::Context.active_session,
|
116
|
+
**kwargs
|
117
|
+
)
|
118
|
+
response = base_find(
|
119
|
+
session: session,
|
120
|
+
ids: {},
|
121
|
+
params: {limit: limit}.merge(kwargs).compact,
|
122
|
+
)
|
123
|
+
|
124
|
+
T.cast(response, T::Array[CollectionListing])
|
125
|
+
end
|
126
|
+
|
127
|
+
sig do
|
128
|
+
params(
|
129
|
+
collection_id: T.any(Integer, String),
|
130
|
+
limit: T.untyped,
|
131
|
+
session: Auth::Session,
|
132
|
+
kwargs: T.untyped
|
133
|
+
).returns(T.untyped)
|
134
|
+
end
|
135
|
+
def product_ids(
|
136
|
+
collection_id:,
|
137
|
+
limit: nil,
|
138
|
+
session: ShopifyAPI::Context.active_session,
|
139
|
+
**kwargs
|
140
|
+
)
|
141
|
+
request(
|
142
|
+
http_method: :get,
|
143
|
+
operation: :product_ids,
|
144
|
+
session: session,
|
145
|
+
ids: {collection_id: collection_id},
|
146
|
+
params: {limit: limit}.merge(kwargs).compact,
|
147
|
+
body: {},
|
148
|
+
entity: nil,
|
149
|
+
)
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|
153
|
+
|
154
|
+
end
|
155
|
+
end
|
@@ -0,0 +1,283 @@
|
|
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 Comment < 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
|
+
@article_id = T.let(nil, T.nilable(Integer))
|
20
|
+
@author = T.let(nil, T.nilable(String))
|
21
|
+
@blog_id = T.let(nil, T.nilable(Integer))
|
22
|
+
@body = T.let(nil, T.nilable(String))
|
23
|
+
@body_html = T.let(nil, T.nilable(String))
|
24
|
+
@created_at = T.let(nil, T.nilable(String))
|
25
|
+
@email = T.let(nil, T.nilable(String))
|
26
|
+
@id = T.let(nil, T.nilable(Integer))
|
27
|
+
@ip = T.let(nil, T.nilable(String))
|
28
|
+
@published_at = T.let(nil, T.nilable(String))
|
29
|
+
@status = T.let(nil, T.nilable(String))
|
30
|
+
@updated_at = T.let(nil, T.nilable(String))
|
31
|
+
@user_agent = T.let(nil, T.nilable(String))
|
32
|
+
end
|
33
|
+
|
34
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
35
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
36
|
+
@paths = T.let([
|
37
|
+
{http_method: :get, operation: :count, ids: [], path: "comments/count.json"},
|
38
|
+
{http_method: :get, operation: :get, ids: [], path: "comments.json"},
|
39
|
+
{http_method: :get, operation: :get, ids: [:id], path: "comments/<id>.json"},
|
40
|
+
{http_method: :post, operation: :approve, ids: [:id], path: "comments/<id>/approve.json"},
|
41
|
+
{http_method: :post, operation: :not_spam, ids: [:id], path: "comments/<id>/not_spam.json"},
|
42
|
+
{http_method: :post, operation: :post, ids: [], path: "comments.json"},
|
43
|
+
{http_method: :post, operation: :remove, ids: [:id], path: "comments/<id>/remove.json"},
|
44
|
+
{http_method: :post, operation: :restore, ids: [:id], path: "comments/<id>/restore.json"},
|
45
|
+
{http_method: :post, operation: :spam, ids: [:id], path: "comments/<id>/spam.json"},
|
46
|
+
{http_method: :put, operation: :put, ids: [:id], path: "comments/<id>.json"}
|
47
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
48
|
+
|
49
|
+
sig { returns(T.nilable(Integer)) }
|
50
|
+
attr_reader :article_id
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :author
|
53
|
+
sig { returns(T.nilable(Integer)) }
|
54
|
+
attr_reader :blog_id
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :body
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :body_html
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :created_at
|
61
|
+
sig { returns(T.nilable(String)) }
|
62
|
+
attr_reader :email
|
63
|
+
sig { returns(T.nilable(Integer)) }
|
64
|
+
attr_reader :id
|
65
|
+
sig { returns(T.nilable(String)) }
|
66
|
+
attr_reader :ip
|
67
|
+
sig { returns(T.nilable(String)) }
|
68
|
+
attr_reader :published_at
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :status
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :updated_at
|
73
|
+
sig { returns(T.nilable(String)) }
|
74
|
+
attr_reader :user_agent
|
75
|
+
|
76
|
+
class << self
|
77
|
+
sig do
|
78
|
+
params(
|
79
|
+
id: T.any(Integer, String),
|
80
|
+
fields: T.untyped,
|
81
|
+
session: Auth::Session
|
82
|
+
).returns(T.nilable(Comment))
|
83
|
+
end
|
84
|
+
def find(
|
85
|
+
id:,
|
86
|
+
fields: nil,
|
87
|
+
session: ShopifyAPI::Context.active_session
|
88
|
+
)
|
89
|
+
result = base_find(
|
90
|
+
session: session,
|
91
|
+
ids: {id: id},
|
92
|
+
params: {fields: fields},
|
93
|
+
)
|
94
|
+
T.cast(result[0], T.nilable(Comment))
|
95
|
+
end
|
96
|
+
|
97
|
+
sig do
|
98
|
+
params(
|
99
|
+
limit: T.untyped,
|
100
|
+
since_id: T.untyped,
|
101
|
+
created_at_min: T.untyped,
|
102
|
+
created_at_max: T.untyped,
|
103
|
+
updated_at_min: T.untyped,
|
104
|
+
updated_at_max: T.untyped,
|
105
|
+
published_at_min: T.untyped,
|
106
|
+
published_at_max: T.untyped,
|
107
|
+
fields: T.untyped,
|
108
|
+
published_status: T.untyped,
|
109
|
+
status: T.untyped,
|
110
|
+
session: Auth::Session,
|
111
|
+
kwargs: T.untyped
|
112
|
+
).returns(T::Array[Comment])
|
113
|
+
end
|
114
|
+
def all(
|
115
|
+
limit: nil,
|
116
|
+
since_id: nil,
|
117
|
+
created_at_min: nil,
|
118
|
+
created_at_max: nil,
|
119
|
+
updated_at_min: nil,
|
120
|
+
updated_at_max: nil,
|
121
|
+
published_at_min: nil,
|
122
|
+
published_at_max: nil,
|
123
|
+
fields: nil,
|
124
|
+
published_status: nil,
|
125
|
+
status: nil,
|
126
|
+
session: ShopifyAPI::Context.active_session,
|
127
|
+
**kwargs
|
128
|
+
)
|
129
|
+
response = base_find(
|
130
|
+
session: session,
|
131
|
+
ids: {},
|
132
|
+
params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, fields: fields, published_status: published_status, status: status}.merge(kwargs).compact,
|
133
|
+
)
|
134
|
+
|
135
|
+
T.cast(response, T::Array[Comment])
|
136
|
+
end
|
137
|
+
|
138
|
+
sig do
|
139
|
+
params(
|
140
|
+
created_at_min: T.untyped,
|
141
|
+
created_at_max: T.untyped,
|
142
|
+
updated_at_min: T.untyped,
|
143
|
+
updated_at_max: T.untyped,
|
144
|
+
published_at_min: T.untyped,
|
145
|
+
published_at_max: T.untyped,
|
146
|
+
published_status: T.untyped,
|
147
|
+
status: T.untyped,
|
148
|
+
session: Auth::Session,
|
149
|
+
kwargs: T.untyped
|
150
|
+
).returns(T.untyped)
|
151
|
+
end
|
152
|
+
def count(
|
153
|
+
created_at_min: nil,
|
154
|
+
created_at_max: nil,
|
155
|
+
updated_at_min: nil,
|
156
|
+
updated_at_max: nil,
|
157
|
+
published_at_min: nil,
|
158
|
+
published_at_max: nil,
|
159
|
+
published_status: nil,
|
160
|
+
status: nil,
|
161
|
+
session: ShopifyAPI::Context.active_session,
|
162
|
+
**kwargs
|
163
|
+
)
|
164
|
+
request(
|
165
|
+
http_method: :get,
|
166
|
+
operation: :count,
|
167
|
+
session: session,
|
168
|
+
ids: {},
|
169
|
+
params: {created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status, status: status}.merge(kwargs).compact,
|
170
|
+
body: {},
|
171
|
+
entity: nil,
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
sig do
|
178
|
+
params(
|
179
|
+
body: T.untyped,
|
180
|
+
kwargs: T.untyped
|
181
|
+
).returns(T.untyped)
|
182
|
+
end
|
183
|
+
def approve(
|
184
|
+
body: nil,
|
185
|
+
**kwargs
|
186
|
+
)
|
187
|
+
self.class.request(
|
188
|
+
http_method: :post,
|
189
|
+
operation: :approve,
|
190
|
+
session: @session,
|
191
|
+
ids: {id: @id},
|
192
|
+
params: {}.merge(kwargs).compact,
|
193
|
+
body: body,
|
194
|
+
entity: self,
|
195
|
+
)
|
196
|
+
end
|
197
|
+
|
198
|
+
sig do
|
199
|
+
params(
|
200
|
+
body: T.untyped,
|
201
|
+
kwargs: T.untyped
|
202
|
+
).returns(T.untyped)
|
203
|
+
end
|
204
|
+
def not_spam(
|
205
|
+
body: nil,
|
206
|
+
**kwargs
|
207
|
+
)
|
208
|
+
self.class.request(
|
209
|
+
http_method: :post,
|
210
|
+
operation: :not_spam,
|
211
|
+
session: @session,
|
212
|
+
ids: {id: @id},
|
213
|
+
params: {}.merge(kwargs).compact,
|
214
|
+
body: body,
|
215
|
+
entity: self,
|
216
|
+
)
|
217
|
+
end
|
218
|
+
|
219
|
+
sig do
|
220
|
+
params(
|
221
|
+
body: T.untyped,
|
222
|
+
kwargs: T.untyped
|
223
|
+
).returns(T.untyped)
|
224
|
+
end
|
225
|
+
def remove(
|
226
|
+
body: nil,
|
227
|
+
**kwargs
|
228
|
+
)
|
229
|
+
self.class.request(
|
230
|
+
http_method: :post,
|
231
|
+
operation: :remove,
|
232
|
+
session: @session,
|
233
|
+
ids: {id: @id},
|
234
|
+
params: {}.merge(kwargs).compact,
|
235
|
+
body: body,
|
236
|
+
entity: self,
|
237
|
+
)
|
238
|
+
end
|
239
|
+
|
240
|
+
sig do
|
241
|
+
params(
|
242
|
+
body: T.untyped,
|
243
|
+
kwargs: T.untyped
|
244
|
+
).returns(T.untyped)
|
245
|
+
end
|
246
|
+
def restore(
|
247
|
+
body: nil,
|
248
|
+
**kwargs
|
249
|
+
)
|
250
|
+
self.class.request(
|
251
|
+
http_method: :post,
|
252
|
+
operation: :restore,
|
253
|
+
session: @session,
|
254
|
+
ids: {id: @id},
|
255
|
+
params: {}.merge(kwargs).compact,
|
256
|
+
body: body,
|
257
|
+
entity: self,
|
258
|
+
)
|
259
|
+
end
|
260
|
+
|
261
|
+
sig do
|
262
|
+
params(
|
263
|
+
body: T.untyped,
|
264
|
+
kwargs: T.untyped
|
265
|
+
).returns(T.untyped)
|
266
|
+
end
|
267
|
+
def spam(
|
268
|
+
body: nil,
|
269
|
+
**kwargs
|
270
|
+
)
|
271
|
+
self.class.request(
|
272
|
+
http_method: :post,
|
273
|
+
operation: :spam,
|
274
|
+
session: @session,
|
275
|
+
ids: {id: @id},
|
276
|
+
params: {}.merge(kwargs).compact,
|
277
|
+
body: body,
|
278
|
+
entity: self,
|
279
|
+
)
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
end
|