shopify_api 13.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/BREAKING_CHANGES_FOR_V10.md +231 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile.lock +5 -5
  5. data/README.md +10 -34
  6. data/docs/README.md +0 -1
  7. data/docs/getting_started.md +20 -3
  8. data/docs/usage/custom_apps.md +75 -0
  9. data/docs/usage/graphql.md +63 -18
  10. data/docs/usage/oauth.md +160 -27
  11. data/docs/usage/rest.md +204 -62
  12. data/docs/usage/webhooks.md +22 -4
  13. data/lib/shopify_api/admin_versions.rb +2 -1
  14. data/lib/shopify_api/context.rb +5 -3
  15. data/lib/shopify_api/rest/base.rb +22 -14
  16. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
  17. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
  18. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
  19. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
  21. data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
  22. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
  23. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
  24. data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
  25. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
  26. data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
  27. data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
  28. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
  29. data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
  30. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
  31. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
  32. data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
  33. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
  34. data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
  35. data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
  36. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
  37. data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
  39. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
  40. data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
  41. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
  42. data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
  43. data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
  44. data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
  45. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
  46. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
  47. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
  48. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
  49. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
  50. data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
  51. data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
  52. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
  53. data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
  54. data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
  55. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
  56. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
  57. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
  58. data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
  59. data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
  60. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
  61. data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
  62. data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
  63. data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
  64. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
  65. data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
  66. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
  67. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
  68. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
  69. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
  70. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
  71. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
  72. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
  73. data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
  74. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
  75. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
  76. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
  77. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
  78. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
  79. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
  80. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
  81. data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
  82. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
  83. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
  84. data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
  85. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
  86. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
  87. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
  88. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
  89. data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
  90. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
  91. data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
  92. data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
  93. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
  94. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
  95. data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
  96. data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
  97. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
  98. data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
  99. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
  100. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
  101. data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
  102. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
  103. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
  104. data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
  105. data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
  106. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
  107. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
  108. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
  109. data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
  110. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
  111. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
  112. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
  113. data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
  114. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
  115. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
  116. data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
  117. data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
  118. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
  119. data/lib/shopify_api/version.rb +1 -1
  120. data/lib/shopify_api/webhooks/registration.rb +19 -4
  121. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
  122. data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
  123. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
  124. data/lib/shopify_api/webhooks/registry.rb +9 -5
  125. metadata +80 -6
  126. data/.github/workflows/stale.yml +0 -43
  127. data/docs/issues.md +0 -39
  128. data/docs/usage/session_storage.md +0 -46
@@ -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 Page < 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
+ @admin_graphql_api_id = T.let(nil, T.nilable(String))
20
+ @author = T.let(nil, T.nilable(String))
21
+ @body_html = T.let(nil, T.nilable(String))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @handle = T.let(nil, T.nilable(String))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @metafield = T.let(nil, T.nilable(Metafield))
26
+ @published_at = T.let(nil, T.nilable(String))
27
+ @shop_id = T.let(nil, T.nilable(Integer))
28
+ @template_suffix = T.let(nil, T.nilable(String))
29
+ @title = T.let(nil, T.nilable(String))
30
+ @updated_at = T.let(nil, T.nilable(String))
31
+ end
32
+
33
+ @has_one = T.let({
34
+ metafield: Metafield
35
+ }, T::Hash[Symbol, Class])
36
+ @has_many = T.let({}, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :delete, operation: :delete, ids: [:id], path: "pages/<id>.json"},
39
+ {http_method: :get, operation: :count, ids: [], path: "pages/count.json"},
40
+ {http_method: :get, operation: :get, ids: [], path: "pages.json"},
41
+ {http_method: :get, operation: :get, ids: [:id], path: "pages/<id>.json"},
42
+ {http_method: :post, operation: :post, ids: [], path: "pages.json"},
43
+ {http_method: :put, operation: :put, ids: [:id], path: "pages/<id>.json"}
44
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
45
+
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :admin_graphql_api_id
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :author
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :body_html
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :created_at
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :handle
56
+ sig { returns(T.nilable(Integer)) }
57
+ attr_reader :id
58
+ sig { returns(T.nilable(Metafield)) }
59
+ attr_reader :metafield
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :published_at
62
+ sig { returns(T.nilable(Integer)) }
63
+ attr_reader :shop_id
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :template_suffix
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :title
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :updated_at
70
+
71
+ class << self
72
+ sig do
73
+ params(
74
+ id: T.any(Integer, String),
75
+ fields: T.untyped,
76
+ session: Auth::Session
77
+ ).returns(T.nilable(Page))
78
+ end
79
+ def find(
80
+ id:,
81
+ fields: nil,
82
+ session: ShopifyAPI::Context.active_session
83
+ )
84
+ result = base_find(
85
+ session: session,
86
+ ids: {id: id},
87
+ params: {fields: fields},
88
+ )
89
+ T.cast(result[0], T.nilable(Page))
90
+ end
91
+
92
+ sig do
93
+ params(
94
+ id: T.any(Integer, String),
95
+ session: Auth::Session
96
+ ).returns(T.untyped)
97
+ end
98
+ def delete(
99
+ id:,
100
+ session: ShopifyAPI::Context.active_session
101
+ )
102
+ request(
103
+ http_method: :delete,
104
+ operation: :delete,
105
+ session: session,
106
+ ids: {id: id},
107
+ params: {},
108
+ )
109
+ end
110
+
111
+ sig do
112
+ params(
113
+ limit: T.untyped,
114
+ since_id: T.untyped,
115
+ title: T.untyped,
116
+ handle: T.untyped,
117
+ created_at_min: T.untyped,
118
+ created_at_max: T.untyped,
119
+ updated_at_min: T.untyped,
120
+ updated_at_max: T.untyped,
121
+ published_at_min: T.untyped,
122
+ published_at_max: T.untyped,
123
+ fields: T.untyped,
124
+ published_status: T.untyped,
125
+ session: Auth::Session,
126
+ kwargs: T.untyped
127
+ ).returns(T::Array[Page])
128
+ end
129
+ def all(
130
+ limit: nil,
131
+ since_id: nil,
132
+ title: nil,
133
+ handle: nil,
134
+ created_at_min: nil,
135
+ created_at_max: nil,
136
+ updated_at_min: nil,
137
+ updated_at_max: nil,
138
+ published_at_min: nil,
139
+ published_at_max: nil,
140
+ fields: nil,
141
+ published_status: nil,
142
+ session: ShopifyAPI::Context.active_session,
143
+ **kwargs
144
+ )
145
+ response = base_find(
146
+ session: session,
147
+ ids: {},
148
+ params: {limit: limit, since_id: since_id, title: title, handle: handle, 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}.merge(kwargs).compact,
149
+ )
150
+
151
+ T.cast(response, T::Array[Page])
152
+ end
153
+
154
+ sig do
155
+ params(
156
+ title: T.untyped,
157
+ created_at_min: T.untyped,
158
+ created_at_max: T.untyped,
159
+ updated_at_min: T.untyped,
160
+ updated_at_max: T.untyped,
161
+ published_at_min: T.untyped,
162
+ published_at_max: T.untyped,
163
+ published_status: T.untyped,
164
+ session: Auth::Session,
165
+ kwargs: T.untyped
166
+ ).returns(T.untyped)
167
+ end
168
+ def count(
169
+ title: nil,
170
+ created_at_min: nil,
171
+ created_at_max: nil,
172
+ updated_at_min: nil,
173
+ updated_at_max: nil,
174
+ published_at_min: nil,
175
+ published_at_max: nil,
176
+ published_status: nil,
177
+ session: ShopifyAPI::Context.active_session,
178
+ **kwargs
179
+ )
180
+ request(
181
+ http_method: :get,
182
+ operation: :count,
183
+ session: session,
184
+ ids: {},
185
+ params: {title: title, 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}.merge(kwargs).compact,
186
+ body: {},
187
+ entity: nil,
188
+ )
189
+ end
190
+
191
+ end
192
+
193
+ end
194
+ end
@@ -0,0 +1,140 @@
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 Payment < 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
+ @checkout = T.let(nil, T.nilable(Checkout))
20
+ @credit_card = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
21
+ @id = T.let(nil, T.nilable(Integer))
22
+ @next_action = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @payment_processing_error_message = T.let(nil, T.nilable(String))
24
+ @transaction = T.let(nil, T.nilable(Transaction))
25
+ @unique_token = T.let(nil, T.nilable(String))
26
+ end
27
+
28
+ @has_one = T.let({
29
+ transaction: Transaction,
30
+ checkout: Checkout
31
+ }, T::Hash[Symbol, Class])
32
+ @has_many = T.let({}, T::Hash[Symbol, Class])
33
+ @paths = T.let([
34
+ {http_method: :get, operation: :count, ids: [:checkout_id], path: "checkouts/<checkout_id>/payments/count.json"},
35
+ {http_method: :get, operation: :get, ids: [:checkout_id], path: "checkouts/<checkout_id>/payments.json"},
36
+ {http_method: :get, operation: :get, ids: [:checkout_id, :id], path: "checkouts/<checkout_id>/payments/<id>.json"},
37
+ {http_method: :post, operation: :post, ids: [:checkout_id], path: "checkouts/<checkout_id>/payments.json"}
38
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
39
+
40
+ sig { returns(T.nilable(Checkout)) }
41
+ attr_reader :checkout
42
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
43
+ attr_reader :credit_card
44
+ sig { returns(T.nilable(Integer)) }
45
+ attr_reader :id
46
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
47
+ attr_reader :next_action
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :payment_processing_error_message
50
+ sig { returns(T.nilable(Transaction)) }
51
+ attr_reader :transaction
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :unique_token
54
+
55
+ class << self
56
+ sig do
57
+ params(
58
+ id: T.any(Integer, String),
59
+ checkout_id: T.nilable(T.any(Integer, String)),
60
+ session: Auth::Session
61
+ ).returns(T.nilable(Payment))
62
+ end
63
+ def find(
64
+ id:,
65
+ checkout_id: nil,
66
+ session: ShopifyAPI::Context.active_session
67
+ )
68
+ result = base_find(
69
+ session: session,
70
+ ids: {id: id, checkout_id: checkout_id},
71
+ params: {},
72
+ )
73
+ T.cast(result[0], T.nilable(Payment))
74
+ end
75
+
76
+ sig do
77
+ params(
78
+ checkout_id: T.nilable(T.any(Integer, String)),
79
+ session: Auth::Session,
80
+ kwargs: T.untyped
81
+ ).returns(T::Array[Payment])
82
+ end
83
+ def all(
84
+ checkout_id: nil,
85
+ session: ShopifyAPI::Context.active_session,
86
+ **kwargs
87
+ )
88
+ response = base_find(
89
+ session: session,
90
+ ids: {checkout_id: checkout_id},
91
+ params: {}.merge(kwargs).compact,
92
+ )
93
+
94
+ T.cast(response, T::Array[Payment])
95
+ end
96
+
97
+ sig do
98
+ params(
99
+ checkout_id: T.nilable(T.any(Integer, String)),
100
+ session: Auth::Session,
101
+ kwargs: T.untyped
102
+ ).returns(T.untyped)
103
+ end
104
+ def count(
105
+ checkout_id: nil,
106
+ session: ShopifyAPI::Context.active_session,
107
+ **kwargs
108
+ )
109
+ request(
110
+ http_method: :get,
111
+ operation: :count,
112
+ session: session,
113
+ ids: {checkout_id: checkout_id},
114
+ params: {}.merge(kwargs).compact,
115
+ body: {},
116
+ entity: nil,
117
+ )
118
+ end
119
+
120
+ end
121
+
122
+ sig do
123
+ returns(T.untyped)
124
+ end
125
+ def checkout_id()
126
+ @checkout&.token
127
+ end
128
+
129
+ sig do
130
+ params(
131
+ val: T.untyped
132
+ ).void
133
+ end
134
+ def checkout_id=(val)
135
+ @checkout = @checkout || Checkout.new(session: @session)
136
+ T.unsafe(@checkout).token = val
137
+ end
138
+
139
+ end
140
+ end
@@ -0,0 +1,143 @@
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 PaymentGateway < 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
+ @attachment = T.let(nil, T.nilable(String))
20
+ @created_at = T.let(nil, T.nilable(String))
21
+ @credential1 = T.let(nil, T.nilable(String))
22
+ @credential2 = T.let(nil, T.nilable(String))
23
+ @credential3 = T.let(nil, T.nilable(String))
24
+ @credential4 = T.let(nil, T.nilable(String))
25
+ @disabled = T.let(nil, T.nilable(T::Boolean))
26
+ @enabled_card_brands = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @id = T.let(nil, T.nilable(Integer))
28
+ @name = T.let(nil, T.nilable(String))
29
+ @processing_method = T.let(nil, T.nilable(String))
30
+ @provider_id = T.let(nil, T.nilable(Integer))
31
+ @sandbox = T.let(nil, T.nilable(T::Boolean))
32
+ @service_name = T.let(nil, T.nilable(String))
33
+ @supports_network_tokenization = T.let(nil, T.nilable(T::Boolean))
34
+ @type = T.let(nil, T.nilable(String))
35
+ @updated_at = T.let(nil, T.nilable(String))
36
+ end
37
+
38
+ @has_one = T.let({}, T::Hash[Symbol, Class])
39
+ @has_many = T.let({}, T::Hash[Symbol, Class])
40
+ @paths = T.let([
41
+ {http_method: :delete, operation: :delete, ids: [:id], path: "payment_gateways/<id>.json"},
42
+ {http_method: :get, operation: :get, ids: [], path: "payment_gateways.json"},
43
+ {http_method: :get, operation: :get, ids: [:id], path: "payment_gateways/<id>.json"},
44
+ {http_method: :post, operation: :post, ids: [], path: "payment_gateways.json"},
45
+ {http_method: :put, operation: :put, ids: [:id], path: "payment_gateways/<id>.json"}
46
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
47
+
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :attachment
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :created_at
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :credential1
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :credential2
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :credential3
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :credential4
60
+ sig { returns(T.nilable(T::Boolean)) }
61
+ attr_reader :disabled
62
+ sig { returns(T.nilable(T::Array[String])) }
63
+ attr_reader :enabled_card_brands
64
+ sig { returns(T.nilable(Integer)) }
65
+ attr_reader :id
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :name
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :processing_method
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_reader :provider_id
72
+ sig { returns(T.nilable(T::Boolean)) }
73
+ attr_reader :sandbox
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :service_name
76
+ sig { returns(T.nilable(T::Boolean)) }
77
+ attr_reader :supports_network_tokenization
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :type
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :updated_at
82
+
83
+ class << self
84
+ sig do
85
+ params(
86
+ id: T.any(Integer, String),
87
+ session: Auth::Session
88
+ ).returns(T.nilable(PaymentGateway))
89
+ end
90
+ def find(
91
+ id:,
92
+ session: ShopifyAPI::Context.active_session
93
+ )
94
+ result = base_find(
95
+ session: session,
96
+ ids: {id: id},
97
+ params: {},
98
+ )
99
+ T.cast(result[0], T.nilable(PaymentGateway))
100
+ end
101
+
102
+ sig do
103
+ params(
104
+ id: T.any(Integer, String),
105
+ session: Auth::Session
106
+ ).returns(T.untyped)
107
+ end
108
+ def delete(
109
+ id:,
110
+ session: ShopifyAPI::Context.active_session
111
+ )
112
+ request(
113
+ http_method: :delete,
114
+ operation: :delete,
115
+ session: session,
116
+ ids: {id: id},
117
+ params: {},
118
+ )
119
+ end
120
+
121
+ sig do
122
+ params(
123
+ session: Auth::Session,
124
+ kwargs: T.untyped
125
+ ).returns(T::Array[PaymentGateway])
126
+ end
127
+ def all(
128
+ session: ShopifyAPI::Context.active_session,
129
+ **kwargs
130
+ )
131
+ response = base_find(
132
+ session: session,
133
+ ids: {},
134
+ params: {}.merge(kwargs).compact,
135
+ )
136
+
137
+ T.cast(response, T::Array[PaymentGateway])
138
+ end
139
+
140
+ end
141
+
142
+ end
143
+ end
@@ -0,0 +1,107 @@
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 PaymentTransaction < 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
+ @amount = T.let(nil, T.nilable(String))
20
+ @currency = T.let(nil, T.nilable(Currency))
21
+ @fee = T.let(nil, T.nilable(String))
22
+ @id = T.let(nil, T.nilable(Integer))
23
+ @net = T.let(nil, T.nilable(String))
24
+ @payout_id = T.let(nil, T.nilable(Integer))
25
+ @payout_status = T.let(nil, T.nilable(String))
26
+ @processed_at = T.let(nil, T.nilable(String))
27
+ @source_id = T.let(nil, T.nilable(Integer))
28
+ @source_order_id = T.let(nil, T.nilable(Integer))
29
+ @source_order_transaction_id = T.let(nil, T.nilable(Integer))
30
+ @source_type = T.let(nil, T.nilable(String))
31
+ @test = T.let(nil, T.nilable(T::Boolean))
32
+ @type = T.let(nil, T.nilable(String))
33
+ end
34
+
35
+ @has_one = T.let({
36
+ currency: Currency
37
+ }, T::Hash[Symbol, Class])
38
+ @has_many = T.let({}, T::Hash[Symbol, Class])
39
+ @paths = T.let([
40
+ {http_method: :get, operation: :transactions, ids: [], path: "shopify_payments/balance/transactions.json"}
41
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
42
+
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :amount
45
+ sig { returns(T.nilable(Currency)) }
46
+ attr_reader :currency
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :fee
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :id
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :net
53
+ sig { returns(T.nilable(Integer)) }
54
+ attr_reader :payout_id
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :payout_status
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :processed_at
59
+ sig { returns(T.nilable(Integer)) }
60
+ attr_reader :source_id
61
+ sig { returns(T.nilable(Integer)) }
62
+ attr_reader :source_order_id
63
+ sig { returns(T.nilable(Integer)) }
64
+ attr_reader :source_order_transaction_id
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :source_type
67
+ sig { returns(T.nilable(T::Boolean)) }
68
+ attr_reader :test
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :type
71
+
72
+ class << self
73
+ sig do
74
+ params(
75
+ since_id: T.untyped,
76
+ last_id: T.untyped,
77
+ test: T.untyped,
78
+ payout_id: T.untyped,
79
+ payout_status: T.untyped,
80
+ session: Auth::Session,
81
+ kwargs: T.untyped
82
+ ).returns(T.untyped)
83
+ end
84
+ def transactions(
85
+ since_id: nil,
86
+ last_id: nil,
87
+ test: nil,
88
+ payout_id: nil,
89
+ payout_status: nil,
90
+ session: ShopifyAPI::Context.active_session,
91
+ **kwargs
92
+ )
93
+ request(
94
+ http_method: :get,
95
+ operation: :transactions,
96
+ session: session,
97
+ ids: {},
98
+ params: {since_id: since_id, last_id: last_id, test: test, payout_id: payout_id, payout_status: payout_status}.merge(kwargs).compact,
99
+ body: {},
100
+ entity: nil,
101
+ )
102
+ end
103
+
104
+ end
105
+
106
+ end
107
+ end
@@ -0,0 +1,97 @@
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 Payout < 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
+ @amount = T.let(nil, T.nilable(String))
20
+ @currency = T.let(nil, T.nilable(String))
21
+ @date = T.let(nil, T.nilable(String))
22
+ @id = T.let(nil, T.nilable(Integer))
23
+ @status = T.let(nil, T.nilable(String))
24
+ end
25
+
26
+ @has_one = T.let({}, T::Hash[Symbol, Class])
27
+ @has_many = T.let({}, T::Hash[Symbol, Class])
28
+ @paths = T.let([
29
+ {http_method: :get, operation: :get, ids: [], path: "shopify_payments/payouts.json"},
30
+ {http_method: :get, operation: :get, ids: [:id], path: "shopify_payments/payouts/<id>.json"}
31
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
32
+
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :amount
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :currency
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :date
39
+ sig { returns(T.nilable(Integer)) }
40
+ attr_reader :id
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :status
43
+
44
+ class << self
45
+ sig do
46
+ params(
47
+ id: T.any(Integer, String),
48
+ session: Auth::Session
49
+ ).returns(T.nilable(Payout))
50
+ end
51
+ def find(
52
+ id:,
53
+ session: ShopifyAPI::Context.active_session
54
+ )
55
+ result = base_find(
56
+ session: session,
57
+ ids: {id: id},
58
+ params: {},
59
+ )
60
+ T.cast(result[0], T.nilable(Payout))
61
+ end
62
+
63
+ sig do
64
+ params(
65
+ since_id: T.untyped,
66
+ last_id: T.untyped,
67
+ date_min: T.untyped,
68
+ date_max: T.untyped,
69
+ date: T.untyped,
70
+ status: T.untyped,
71
+ session: Auth::Session,
72
+ kwargs: T.untyped
73
+ ).returns(T::Array[Payout])
74
+ end
75
+ def all(
76
+ since_id: nil,
77
+ last_id: nil,
78
+ date_min: nil,
79
+ date_max: nil,
80
+ date: nil,
81
+ status: nil,
82
+ session: ShopifyAPI::Context.active_session,
83
+ **kwargs
84
+ )
85
+ response = base_find(
86
+ session: session,
87
+ ids: {},
88
+ params: {since_id: since_id, last_id: last_id, date_min: date_min, date_max: date_max, date: date, status: status}.merge(kwargs).compact,
89
+ )
90
+
91
+ T.cast(response, T::Array[Payout])
92
+ end
93
+
94
+ end
95
+
96
+ end
97
+ end