shopify_api 13.0.0 → 13.1.0

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