shopify_api 14.6.0 → 14.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +12 -7
  4. data/docs/usage/oauth.md +14 -0
  5. data/docs/usage/rest.md +2 -0
  6. data/docs/usage/webhooks.md +11 -0
  7. data/lib/shopify_api/admin_versions.rb +2 -1
  8. data/lib/shopify_api/clients/rest/admin.rb +5 -0
  9. data/lib/shopify_api/context.rb +12 -3
  10. data/lib/shopify_api/errors/disabled_resource_error.rb +8 -0
  11. data/lib/shopify_api/rest/resources/2024_07/webhook.rb +1 -0
  12. data/lib/shopify_api/rest/resources/2024_10/webhook.rb +1 -0
  13. data/lib/shopify_api/rest/resources/2025_01/abandoned_checkout.rb +194 -0
  14. data/lib/shopify_api/rest/resources/2025_01/access_scope.rb +62 -0
  15. data/lib/shopify_api/rest/resources/2025_01/apple_pay_certificate.rb +109 -0
  16. data/lib/shopify_api/rest/resources/2025_01/application_charge.rb +113 -0
  17. data/lib/shopify_api/rest/resources/2025_01/application_credit.rb +95 -0
  18. data/lib/shopify_api/rest/resources/2025_01/article.rb +269 -0
  19. data/lib/shopify_api/rest/resources/2025_01/asset.rb +122 -0
  20. data/lib/shopify_api/rest/resources/2025_01/assigned_fulfillment_order.rb +92 -0
  21. data/lib/shopify_api/rest/resources/2025_01/balance.rb +58 -0
  22. data/lib/shopify_api/rest/resources/2025_01/blog.rb +166 -0
  23. data/lib/shopify_api/rest/resources/2025_01/cancellation_request.rb +87 -0
  24. data/lib/shopify_api/rest/resources/2025_01/carrier_service.rb +120 -0
  25. data/lib/shopify_api/rest/resources/2025_01/checkout.rb +213 -0
  26. data/lib/shopify_api/rest/resources/2025_01/collect.rb +146 -0
  27. data/lib/shopify_api/rest/resources/2025_01/collection.rb +114 -0
  28. data/lib/shopify_api/rest/resources/2025_01/collection_listing.rb +159 -0
  29. data/lib/shopify_api/rest/resources/2025_01/comment.rb +287 -0
  30. data/lib/shopify_api/rest/resources/2025_01/country.rb +141 -0
  31. data/lib/shopify_api/rest/resources/2025_01/currency.rb +61 -0
  32. data/lib/shopify_api/rest/resources/2025_01/custom_collection.rb +191 -0
  33. data/lib/shopify_api/rest/resources/2025_01/customer.rb +328 -0
  34. data/lib/shopify_api/rest/resources/2025_01/customer_address.rb +215 -0
  35. data/lib/shopify_api/rest/resources/2025_01/deprecated_api_call.rb +61 -0
  36. data/lib/shopify_api/rest/resources/2025_01/discount_code.rb +226 -0
  37. data/lib/shopify_api/rest/resources/2025_01/dispute.rb +115 -0
  38. data/lib/shopify_api/rest/resources/2025_01/dispute_evidence.rb +121 -0
  39. data/lib/shopify_api/rest/resources/2025_01/dispute_file_upload.rb +85 -0
  40. data/lib/shopify_api/rest/resources/2025_01/draft_order.rb +279 -0
  41. data/lib/shopify_api/rest/resources/2025_01/event.rb +152 -0
  42. data/lib/shopify_api/rest/resources/2025_01/fulfillment.rb +235 -0
  43. data/lib/shopify_api/rest/resources/2025_01/fulfillment_event.rb +167 -0
  44. data/lib/shopify_api/rest/resources/2025_01/fulfillment_order.rb +326 -0
  45. data/lib/shopify_api/rest/resources/2025_01/fulfillment_request.rb +116 -0
  46. data/lib/shopify_api/rest/resources/2025_01/fulfillment_service.rb +134 -0
  47. data/lib/shopify_api/rest/resources/2025_01/gift_card.rb +222 -0
  48. data/lib/shopify_api/rest/resources/2025_01/gift_card_adjustment.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2025_01/image.rb +161 -0
  50. data/lib/shopify_api/rest/resources/2025_01/inventory_item.rb +112 -0
  51. data/lib/shopify_api/rest/resources/2025_01/inventory_level.rb +183 -0
  52. data/lib/shopify_api/rest/resources/2025_01/location.rb +171 -0
  53. data/lib/shopify_api/rest/resources/2025_01/locations_for_move.rb +60 -0
  54. data/lib/shopify_api/rest/resources/2025_01/marketing_event.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2025_01/metafield.rb +348 -0
  56. data/lib/shopify_api/rest/resources/2025_01/mobile_platform_application.rb +120 -0
  57. data/lib/shopify_api/rest/resources/2025_01/order.rb +503 -0
  58. data/lib/shopify_api/rest/resources/2025_01/order_risk.rb +148 -0
  59. data/lib/shopify_api/rest/resources/2025_01/page.rb +198 -0
  60. data/lib/shopify_api/rest/resources/2025_01/payment.rb +98 -0
  61. data/lib/shopify_api/rest/resources/2025_01/payment_gateway.rb +147 -0
  62. data/lib/shopify_api/rest/resources/2025_01/payment_transaction.rb +117 -0
  63. data/lib/shopify_api/rest/resources/2025_01/payout.rb +101 -0
  64. data/lib/shopify_api/rest/resources/2025_01/policy.rb +73 -0
  65. data/lib/shopify_api/rest/resources/2025_01/price_rule.rb +227 -0
  66. data/lib/shopify_api/rest/resources/2025_01/product.rb +227 -0
  67. data/lib/shopify_api/rest/resources/2025_01/product_listing.rb +200 -0
  68. data/lib/shopify_api/rest/resources/2025_01/product_resource_feedback.rb +92 -0
  69. data/lib/shopify_api/rest/resources/2025_01/province.rb +136 -0
  70. data/lib/shopify_api/rest/resources/2025_01/recurring_application_charge.rb +184 -0
  71. data/lib/shopify_api/rest/resources/2025_01/redirect.rb +143 -0
  72. data/lib/shopify_api/rest/resources/2025_01/refund.rb +158 -0
  73. data/lib/shopify_api/rest/resources/2025_01/resource_feedback.rb +77 -0
  74. data/lib/shopify_api/rest/resources/2025_01/script_tag.rb +159 -0
  75. data/lib/shopify_api/rest/resources/2025_01/shipping_zone.rb +87 -0
  76. data/lib/shopify_api/rest/resources/2025_01/shop.rb +231 -0
  77. data/lib/shopify_api/rest/resources/2025_01/smart_collection.rb +220 -0
  78. data/lib/shopify_api/rest/resources/2025_01/storefront_access_token.rb +91 -0
  79. data/lib/shopify_api/rest/resources/2025_01/tender_transaction.rb +97 -0
  80. data/lib/shopify_api/rest/resources/2025_01/theme.rb +127 -0
  81. data/lib/shopify_api/rest/resources/2025_01/transaction.rb +194 -0
  82. data/lib/shopify_api/rest/resources/2025_01/usage_charge.rb +106 -0
  83. data/lib/shopify_api/rest/resources/2025_01/user.rb +142 -0
  84. data/lib/shopify_api/rest/resources/2025_01/variant.rb +212 -0
  85. data/lib/shopify_api/rest/resources/2025_01/webhook.rb +173 -0
  86. data/lib/shopify_api/version.rb +1 -1
  87. data/lib/shopify_api/webhooks/registration.rb +17 -3
  88. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +22 -3
  89. data/lib/shopify_api/webhooks/registrations/http.rb +22 -3
  90. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +23 -4
  91. data/lib/shopify_api/webhooks/registry.rb +15 -5
  92. metadata +77 -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,194 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Transaction < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @kind = T.let(nil, T.nilable(String))
22
+ @amount = T.let(nil, T.nilable(String))
23
+ @amount_rounding = T.let(nil, T.nilable(String))
24
+ @authorization = T.let(nil, T.nilable(String))
25
+ @authorization_expires_at = T.let(nil, T.nilable(String))
26
+ @created_at = T.let(nil, T.nilable(String))
27
+ @currency = T.let(nil, T.nilable(String))
28
+ @currency_exchange_adjustment = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
+ @device_id = T.let(nil, T.nilable(Integer))
30
+ @error_code = T.let(nil, T.nilable(String))
31
+ @extended_authorization_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
32
+ @gateway = T.let(nil, T.nilable(String))
33
+ @id = T.let(nil, T.nilable(Integer))
34
+ @location_id = T.let(nil, T.nilable(Integer))
35
+ @manual_payment_gateway = T.let(nil, T.nilable(T::Boolean))
36
+ @message = T.let(nil, T.nilable(String))
37
+ @order_id = T.let(nil, T.nilable(Integer))
38
+ @parent_id = T.let(nil, T.nilable(Integer))
39
+ @payment_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
40
+ @payments_refund_attributes = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
41
+ @processed_at = T.let(nil, T.nilable(String))
42
+ @receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
43
+ @source_name = T.let(nil, T.nilable(String))
44
+ @status = T.let(nil, T.nilable(String))
45
+ @test = T.let(nil, T.nilable(T::Boolean))
46
+ @total_unsettled_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
47
+ @user_id = T.let(nil, T.nilable(Integer))
48
+
49
+ super(session: session, from_hash: from_hash)
50
+ end
51
+
52
+ @has_one = T.let({}, T::Hash[Symbol, Class])
53
+ @has_many = T.let({}, T::Hash[Symbol, Class])
54
+ @paths = T.let([
55
+ {http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/transactions/count.json"},
56
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/transactions.json"},
57
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/transactions/<id>.json"},
58
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/transactions.json"}
59
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
60
+
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :kind
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :amount
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :amount_rounding
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :authorization
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :authorization_expires_at
71
+ sig { returns(T.nilable(String)) }
72
+ attr_reader :created_at
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :currency
75
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
76
+ attr_reader :currency_exchange_adjustment
77
+ sig { returns(T.nilable(Integer)) }
78
+ attr_reader :device_id
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :error_code
81
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
82
+ attr_reader :extended_authorization_attributes
83
+ sig { returns(T.nilable(String)) }
84
+ attr_reader :gateway
85
+ sig { returns(T.nilable(Integer)) }
86
+ attr_reader :id
87
+ sig { returns(T.nilable(Integer)) }
88
+ attr_reader :location_id
89
+ sig { returns(T.nilable(T::Boolean)) }
90
+ attr_reader :manual_payment_gateway
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :message
93
+ sig { returns(T.nilable(Integer)) }
94
+ attr_reader :order_id
95
+ sig { returns(T.nilable(Integer)) }
96
+ attr_reader :parent_id
97
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
98
+ attr_reader :payment_details
99
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100
+ attr_reader :payments_refund_attributes
101
+ sig { returns(T.nilable(String)) }
102
+ attr_reader :processed_at
103
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
104
+ attr_reader :receipt
105
+ sig { returns(T.nilable(String)) }
106
+ attr_reader :source_name
107
+ sig { returns(T.nilable(String)) }
108
+ attr_reader :status
109
+ sig { returns(T.nilable(T::Boolean)) }
110
+ attr_reader :test
111
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
112
+ attr_reader :total_unsettled_set
113
+ sig { returns(T.nilable(Integer)) }
114
+ attr_reader :user_id
115
+
116
+ class << self
117
+ sig do
118
+ params(
119
+ id: T.any(Integer, String),
120
+ order_id: T.nilable(T.any(Integer, String)),
121
+ fields: T.untyped,
122
+ in_shop_currency: T.untyped,
123
+ session: Auth::Session
124
+ ).returns(T.nilable(Transaction))
125
+ end
126
+ def find(
127
+ id:,
128
+ order_id: nil,
129
+ fields: nil,
130
+ in_shop_currency: nil,
131
+ session: ShopifyAPI::Context.active_session
132
+ )
133
+ result = base_find(
134
+ session: session,
135
+ ids: {id: id, order_id: order_id},
136
+ params: {fields: fields, in_shop_currency: in_shop_currency},
137
+ )
138
+ T.cast(result[0], T.nilable(Transaction))
139
+ end
140
+
141
+ sig do
142
+ params(
143
+ order_id: T.nilable(T.any(Integer, String)),
144
+ since_id: T.untyped,
145
+ fields: T.untyped,
146
+ in_shop_currency: T.untyped,
147
+ session: Auth::Session,
148
+ kwargs: T.untyped
149
+ ).returns(T::Array[Transaction])
150
+ end
151
+ def all(
152
+ order_id: nil,
153
+ since_id: nil,
154
+ fields: nil,
155
+ in_shop_currency: nil,
156
+ session: ShopifyAPI::Context.active_session,
157
+ **kwargs
158
+ )
159
+ response = base_find(
160
+ session: session,
161
+ ids: {order_id: order_id},
162
+ params: {since_id: since_id, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
163
+ )
164
+
165
+ T.cast(response, T::Array[Transaction])
166
+ end
167
+
168
+ sig do
169
+ params(
170
+ order_id: T.nilable(T.any(Integer, String)),
171
+ session: Auth::Session,
172
+ kwargs: T.untyped
173
+ ).returns(T.untyped)
174
+ end
175
+ def count(
176
+ order_id: nil,
177
+ session: ShopifyAPI::Context.active_session,
178
+ **kwargs
179
+ )
180
+ request(
181
+ http_method: :get,
182
+ operation: :count,
183
+ session: session,
184
+ ids: {order_id: order_id},
185
+ params: {}.merge(kwargs).compact,
186
+ body: {},
187
+ entity: nil,
188
+ )
189
+ end
190
+
191
+ end
192
+
193
+ end
194
+ 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