shopify_api 14.0.0 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +23 -17
  3. data/.github/workflows/build.yml +2 -0
  4. data/.rubocop.yml +0 -1
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +13 -0
  7. data/Gemfile +13 -1
  8. data/Gemfile.lock +24 -22
  9. data/dev.yml +1 -1
  10. data/docs/usage/custom_apps.md +3 -3
  11. data/docs/usage/graphql_storefront.md +13 -6
  12. data/docs/usage/rest.md +1 -1
  13. data/docs/usage/webhooks.md +2 -2
  14. data/lib/shopify_api/admin_versions.rb +2 -1
  15. data/lib/shopify_api/auth/session.rb +3 -3
  16. data/lib/shopify_api/clients/graphql/storefront.rb +26 -4
  17. data/lib/shopify_api/logger.rb +1 -1
  18. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +5 -8
  19. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +2 -2
  20. data/lib/shopify_api/rest/resources/2022_04/variant.rb +6 -6
  21. data/lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb +5 -8
  22. data/lib/shopify_api/rest/resources/2022_07/inventory_item.rb +2 -2
  23. data/lib/shopify_api/rest/resources/2022_07/variant.rb +6 -6
  24. data/lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb +5 -8
  25. data/lib/shopify_api/rest/resources/2022_10/inventory_item.rb +2 -2
  26. data/lib/shopify_api/rest/resources/2022_10/variant.rb +4 -4
  27. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +5 -8
  28. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +2 -2
  29. data/lib/shopify_api/rest/resources/2023_01/variant.rb +4 -4
  30. data/lib/shopify_api/rest/resources/2023_04/fulfillment_event.rb +5 -8
  31. data/lib/shopify_api/rest/resources/2023_04/inventory_item.rb +2 -2
  32. data/lib/shopify_api/rest/resources/2023_04/variant.rb +4 -4
  33. data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +5 -8
  34. data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +2 -2
  35. data/lib/shopify_api/rest/resources/2023_07/variant.rb +4 -4
  36. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +5 -8
  37. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +2 -2
  38. data/lib/shopify_api/rest/resources/2023_10/variant.rb +4 -4
  39. data/lib/shopify_api/rest/resources/2024_01/fulfillment_event.rb +5 -8
  40. data/lib/shopify_api/rest/resources/2024_01/inventory_item.rb +2 -2
  41. data/lib/shopify_api/rest/resources/2024_01/variant.rb +4 -4
  42. data/lib/shopify_api/rest/resources/2024_04/abandoned_checkout.rb +194 -0
  43. data/lib/shopify_api/rest/resources/2024_04/access_scope.rb +62 -0
  44. data/lib/shopify_api/rest/resources/2024_04/apple_pay_certificate.rb +109 -0
  45. data/lib/shopify_api/rest/resources/2024_04/application_charge.rb +113 -0
  46. data/lib/shopify_api/rest/resources/2024_04/application_credit.rb +95 -0
  47. data/lib/shopify_api/rest/resources/2024_04/article.rb +269 -0
  48. data/lib/shopify_api/rest/resources/2024_04/asset.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2024_04/assigned_fulfillment_order.rb +92 -0
  50. data/lib/shopify_api/rest/resources/2024_04/balance.rb +58 -0
  51. data/lib/shopify_api/rest/resources/2024_04/blog.rb +166 -0
  52. data/lib/shopify_api/rest/resources/2024_04/cancellation_request.rb +87 -0
  53. data/lib/shopify_api/rest/resources/2024_04/carrier_service.rb +120 -0
  54. data/lib/shopify_api/rest/resources/2024_04/checkout.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2024_04/collect.rb +146 -0
  56. data/lib/shopify_api/rest/resources/2024_04/collection.rb +114 -0
  57. data/lib/shopify_api/rest/resources/2024_04/collection_listing.rb +159 -0
  58. data/lib/shopify_api/rest/resources/2024_04/comment.rb +287 -0
  59. data/lib/shopify_api/rest/resources/2024_04/country.rb +141 -0
  60. data/lib/shopify_api/rest/resources/2024_04/currency.rb +61 -0
  61. data/lib/shopify_api/rest/resources/2024_04/custom_collection.rb +191 -0
  62. data/lib/shopify_api/rest/resources/2024_04/customer.rb +333 -0
  63. data/lib/shopify_api/rest/resources/2024_04/customer_address.rb +215 -0
  64. data/lib/shopify_api/rest/resources/2024_04/deprecated_api_call.rb +61 -0
  65. data/lib/shopify_api/rest/resources/2024_04/discount_code.rb +226 -0
  66. data/lib/shopify_api/rest/resources/2024_04/dispute.rb +115 -0
  67. data/lib/shopify_api/rest/resources/2024_04/dispute_evidence.rb +121 -0
  68. data/lib/shopify_api/rest/resources/2024_04/dispute_file_upload.rb +85 -0
  69. data/lib/shopify_api/rest/resources/2024_04/draft_order.rb +279 -0
  70. data/lib/shopify_api/rest/resources/2024_04/event.rb +152 -0
  71. data/lib/shopify_api/rest/resources/2024_04/fulfillment.rb +235 -0
  72. data/lib/shopify_api/rest/resources/2024_04/fulfillment_event.rb +167 -0
  73. data/lib/shopify_api/rest/resources/2024_04/fulfillment_order.rb +326 -0
  74. data/lib/shopify_api/rest/resources/2024_04/fulfillment_request.rb +101 -0
  75. data/lib/shopify_api/rest/resources/2024_04/fulfillment_service.rb +134 -0
  76. data/lib/shopify_api/rest/resources/2024_04/gift_card.rb +222 -0
  77. data/lib/shopify_api/rest/resources/2024_04/gift_card_adjustment.rb +122 -0
  78. data/lib/shopify_api/rest/resources/2024_04/image.rb +161 -0
  79. data/lib/shopify_api/rest/resources/2024_04/inventory_item.rb +112 -0
  80. data/lib/shopify_api/rest/resources/2024_04/inventory_level.rb +183 -0
  81. data/lib/shopify_api/rest/resources/2024_04/location.rb +171 -0
  82. data/lib/shopify_api/rest/resources/2024_04/locations_for_move.rb +60 -0
  83. data/lib/shopify_api/rest/resources/2024_04/marketing_event.rb +213 -0
  84. data/lib/shopify_api/rest/resources/2024_04/metafield.rb +348 -0
  85. data/lib/shopify_api/rest/resources/2024_04/mobile_platform_application.rb +114 -0
  86. data/lib/shopify_api/rest/resources/2024_04/order.rb +489 -0
  87. data/lib/shopify_api/rest/resources/2024_04/order_risk.rb +148 -0
  88. data/lib/shopify_api/rest/resources/2024_04/page.rb +198 -0
  89. data/lib/shopify_api/rest/resources/2024_04/payment.rb +144 -0
  90. data/lib/shopify_api/rest/resources/2024_04/payment_gateway.rb +147 -0
  91. data/lib/shopify_api/rest/resources/2024_04/payment_transaction.rb +114 -0
  92. data/lib/shopify_api/rest/resources/2024_04/payout.rb +101 -0
  93. data/lib/shopify_api/rest/resources/2024_04/policy.rb +73 -0
  94. data/lib/shopify_api/rest/resources/2024_04/price_rule.rb +227 -0
  95. data/lib/shopify_api/rest/resources/2024_04/product.rb +227 -0
  96. data/lib/shopify_api/rest/resources/2024_04/product_listing.rb +200 -0
  97. data/lib/shopify_api/rest/resources/2024_04/product_resource_feedback.rb +92 -0
  98. data/lib/shopify_api/rest/resources/2024_04/province.rb +136 -0
  99. data/lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb +176 -0
  100. data/lib/shopify_api/rest/resources/2024_04/redirect.rb +143 -0
  101. data/lib/shopify_api/rest/resources/2024_04/refund.rb +155 -0
  102. data/lib/shopify_api/rest/resources/2024_04/resource_feedback.rb +77 -0
  103. data/lib/shopify_api/rest/resources/2024_04/script_tag.rb +159 -0
  104. data/lib/shopify_api/rest/resources/2024_04/shipping_zone.rb +87 -0
  105. data/lib/shopify_api/rest/resources/2024_04/shop.rb +222 -0
  106. data/lib/shopify_api/rest/resources/2024_04/smart_collection.rb +220 -0
  107. data/lib/shopify_api/rest/resources/2024_04/storefront_access_token.rb +91 -0
  108. data/lib/shopify_api/rest/resources/2024_04/tender_transaction.rb +97 -0
  109. data/lib/shopify_api/rest/resources/2024_04/theme.rb +127 -0
  110. data/lib/shopify_api/rest/resources/2024_04/transaction.rb +188 -0
  111. data/lib/shopify_api/rest/resources/2024_04/usage_charge.rb +106 -0
  112. data/lib/shopify_api/rest/resources/2024_04/user.rb +142 -0
  113. data/lib/shopify_api/rest/resources/2024_04/variant.rb +212 -0
  114. data/lib/shopify_api/rest/resources/2024_04/webhook.rb +172 -0
  115. data/lib/shopify_api/version.rb +1 -1
  116. data/lib/shopify_api/webhooks/registry.rb +6 -6
  117. data/lib/shopify_api.rb +1 -0
  118. data/shopify_api.gemspec +0 -8
  119. metadata +77 -101
@@ -0,0 +1,489 @@
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 Order < 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
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @app_id = T.let(nil, T.nilable(Integer))
23
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
24
+ @browser_ip = T.let(nil, T.nilable(String))
25
+ @buyer_accepts_marketing = T.let(nil, T.nilable(T::Boolean))
26
+ @cancel_reason = T.let(nil, T.nilable(String))
27
+ @cancelled_at = T.let(nil, T.nilable(String))
28
+ @cart_token = T.let(nil, T.nilable(String))
29
+ @checkout_token = T.let(nil, T.nilable(String))
30
+ @client_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
31
+ @closed_at = T.let(nil, T.nilable(String))
32
+ @company = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
33
+ @confirmation_number = T.let(nil, T.nilable(String))
34
+ @created_at = T.let(nil, T.nilable(String))
35
+ @currency = T.let(nil, T.nilable(String))
36
+ @current_subtotal_price = T.let(nil, T.nilable(String))
37
+ @current_subtotal_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
38
+ @current_total_additional_fees_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
39
+ @current_total_discounts = T.let(nil, T.nilable(String))
40
+ @current_total_discounts_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
41
+ @current_total_duties_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
42
+ @current_total_price = T.let(nil, T.nilable(String))
43
+ @current_total_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
44
+ @current_total_tax = T.let(nil, T.nilable(String))
45
+ @current_total_tax_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
46
+ @customer = T.let(nil, T.nilable(Customer))
47
+ @customer_locale = T.let(nil, T.nilable(String))
48
+ @discount_applications = T.let(nil, T.nilable(T::Array[T.untyped]))
49
+ @discount_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
50
+ @email = T.let(nil, T.nilable(String))
51
+ @estimated_taxes = T.let(nil, T.nilable(T::Boolean))
52
+ @financial_status = T.let(nil, T.nilable(String))
53
+ @fulfillment_status = T.let(nil, T.nilable(String))
54
+ @fulfillments = T.let(nil, T.nilable(T::Array[T.untyped]))
55
+ @gateway = T.let(nil, T.nilable(String))
56
+ @id = T.let(nil, T.nilable(Integer))
57
+ @landing_site = T.let(nil, T.nilable(String))
58
+ @location_id = T.let(nil, T.nilable(Integer))
59
+ @merchant_of_record_app_id = T.let(nil, T.nilable(Integer))
60
+ @name = T.let(nil, T.nilable(String))
61
+ @note = T.let(nil, T.nilable(String))
62
+ @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
63
+ @number = T.let(nil, T.nilable(Integer))
64
+ @order_number = T.let(nil, T.nilable(Integer))
65
+ @order_status_url = T.let(nil, T.nilable(String))
66
+ @original_total_additional_fees_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
67
+ @original_total_duties_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
68
+ @payment_gateway_names = T.let(nil, T.nilable(T::Array[T.untyped]))
69
+ @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
70
+ @phone = T.let(nil, T.nilable(String))
71
+ @po_number = T.let(nil, T.nilable(String))
72
+ @presentment_currency = T.let(nil, T.nilable(String))
73
+ @processed_at = T.let(nil, T.nilable(String))
74
+ @referring_site = T.let(nil, T.nilable(String))
75
+ @refunds = T.let(nil, T.nilable(T::Array[T.untyped]))
76
+ @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
77
+ @shipping_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
78
+ @source_identifier = T.let(nil, T.nilable(String))
79
+ @source_name = T.let(nil, T.nilable(String))
80
+ @source_url = T.let(nil, T.nilable(String))
81
+ @subtotal_price = T.let(nil, T.nilable(String))
82
+ @subtotal_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
83
+ @tags = T.let(nil, T.nilable(String))
84
+ @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
85
+ @taxes_included = T.let(nil, T.nilable(T::Boolean))
86
+ @test = T.let(nil, T.nilable(T::Boolean))
87
+ @token = T.let(nil, T.nilable(String))
88
+ @total_discounts = T.let(nil, T.nilable(String))
89
+ @total_discounts_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
90
+ @total_line_items_price = T.let(nil, T.nilable(String))
91
+ @total_line_items_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
92
+ @total_outstanding = T.let(nil, T.nilable(String))
93
+ @total_price = T.let(nil, T.nilable(String))
94
+ @total_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
95
+ @total_shipping_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
96
+ @total_tax = T.let(nil, T.nilable(T.any(String, Float)))
97
+ @total_tax_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
98
+ @total_tip_received = T.let(nil, T.nilable(String))
99
+ @total_weight = T.let(nil, T.nilable(Integer))
100
+ @updated_at = T.let(nil, T.nilable(String))
101
+ @user_id = T.let(nil, T.nilable(Integer))
102
+
103
+ super(session: session, from_hash: from_hash)
104
+ end
105
+
106
+ @has_one = T.let({
107
+ customer: Customer
108
+ }, T::Hash[Symbol, Class])
109
+ @has_many = T.let({
110
+ discount_codes: DiscountCode,
111
+ fulfillments: Fulfillment,
112
+ refunds: Refund
113
+ }, T::Hash[Symbol, Class])
114
+ @paths = T.let([
115
+ {http_method: :delete, operation: :delete, ids: [:id], path: "orders/<id>.json"},
116
+ {http_method: :get, operation: :count, ids: [], path: "orders/count.json"},
117
+ {http_method: :get, operation: :get, ids: [], path: "orders.json"},
118
+ {http_method: :get, operation: :get, ids: [:id], path: "orders/<id>.json"},
119
+ {http_method: :post, operation: :cancel, ids: [:id], path: "orders/<id>/cancel.json"},
120
+ {http_method: :post, operation: :close, ids: [:id], path: "orders/<id>/close.json"},
121
+ {http_method: :post, operation: :open, ids: [:id], path: "orders/<id>/open.json"},
122
+ {http_method: :post, operation: :post, ids: [], path: "orders.json"},
123
+ {http_method: :put, operation: :put, ids: [:id], path: "orders/<id>.json"}
124
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
125
+
126
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
127
+ attr_reader :line_items
128
+ sig { returns(T.nilable(Integer)) }
129
+ attr_reader :app_id
130
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
131
+ attr_reader :billing_address
132
+ sig { returns(T.nilable(String)) }
133
+ attr_reader :browser_ip
134
+ sig { returns(T.nilable(T::Boolean)) }
135
+ attr_reader :buyer_accepts_marketing
136
+ sig { returns(T.nilable(String)) }
137
+ attr_reader :cancel_reason
138
+ sig { returns(T.nilable(String)) }
139
+ attr_reader :cancelled_at
140
+ sig { returns(T.nilable(String)) }
141
+ attr_reader :cart_token
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :checkout_token
144
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
145
+ attr_reader :client_details
146
+ sig { returns(T.nilable(String)) }
147
+ attr_reader :closed_at
148
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
149
+ attr_reader :company
150
+ sig { returns(T.nilable(String)) }
151
+ attr_reader :confirmation_number
152
+ sig { returns(T.nilable(String)) }
153
+ attr_reader :created_at
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :currency
156
+ sig { returns(T.nilable(String)) }
157
+ attr_reader :current_subtotal_price
158
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
159
+ attr_reader :current_subtotal_price_set
160
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
161
+ attr_reader :current_total_additional_fees_set
162
+ sig { returns(T.nilable(String)) }
163
+ attr_reader :current_total_discounts
164
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
165
+ attr_reader :current_total_discounts_set
166
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
167
+ attr_reader :current_total_duties_set
168
+ sig { returns(T.nilable(String)) }
169
+ attr_reader :current_total_price
170
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
171
+ attr_reader :current_total_price_set
172
+ sig { returns(T.nilable(String)) }
173
+ attr_reader :current_total_tax
174
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
175
+ attr_reader :current_total_tax_set
176
+ sig { returns(T.nilable(Customer)) }
177
+ attr_reader :customer
178
+ sig { returns(T.nilable(String)) }
179
+ attr_reader :customer_locale
180
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
181
+ attr_reader :discount_applications
182
+ sig { returns(T.nilable(T::Array[DiscountCode])) }
183
+ attr_reader :discount_codes
184
+ sig { returns(T.nilable(String)) }
185
+ attr_reader :email
186
+ sig { returns(T.nilable(T::Boolean)) }
187
+ attr_reader :estimated_taxes
188
+ sig { returns(T.nilable(String)) }
189
+ attr_reader :financial_status
190
+ sig { returns(T.nilable(String)) }
191
+ attr_reader :fulfillment_status
192
+ sig { returns(T.nilable(T::Array[Fulfillment])) }
193
+ attr_reader :fulfillments
194
+ sig { returns(T.nilable(String)) }
195
+ attr_reader :gateway
196
+ sig { returns(T.nilable(Integer)) }
197
+ attr_reader :id
198
+ sig { returns(T.nilable(String)) }
199
+ attr_reader :landing_site
200
+ sig { returns(T.nilable(Integer)) }
201
+ attr_reader :location_id
202
+ sig { returns(T.nilable(Integer)) }
203
+ attr_reader :merchant_of_record_app_id
204
+ sig { returns(T.nilable(String)) }
205
+ attr_reader :name
206
+ sig { returns(T.nilable(String)) }
207
+ attr_reader :note
208
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
209
+ attr_reader :note_attributes
210
+ sig { returns(T.nilable(Integer)) }
211
+ attr_reader :number
212
+ sig { returns(T.nilable(Integer)) }
213
+ attr_reader :order_number
214
+ sig { returns(T.nilable(String)) }
215
+ attr_reader :order_status_url
216
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
217
+ attr_reader :original_total_additional_fees_set
218
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
219
+ attr_reader :original_total_duties_set
220
+ sig { returns(T.nilable(T::Array[String])) }
221
+ attr_reader :payment_gateway_names
222
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
223
+ attr_reader :payment_terms
224
+ sig { returns(T.nilable(String)) }
225
+ attr_reader :phone
226
+ sig { returns(T.nilable(String)) }
227
+ attr_reader :po_number
228
+ sig { returns(T.nilable(String)) }
229
+ attr_reader :presentment_currency
230
+ sig { returns(T.nilable(String)) }
231
+ attr_reader :processed_at
232
+ sig { returns(T.nilable(String)) }
233
+ attr_reader :referring_site
234
+ sig { returns(T.nilable(T::Array[Refund])) }
235
+ attr_reader :refunds
236
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
237
+ attr_reader :shipping_address
238
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
239
+ attr_reader :shipping_lines
240
+ sig { returns(T.nilable(String)) }
241
+ attr_reader :source_identifier
242
+ sig { returns(T.nilable(String)) }
243
+ attr_reader :source_name
244
+ sig { returns(T.nilable(String)) }
245
+ attr_reader :source_url
246
+ sig { returns(T.nilable(String)) }
247
+ attr_reader :subtotal_price
248
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
249
+ attr_reader :subtotal_price_set
250
+ sig { returns(T.nilable(String)) }
251
+ attr_reader :tags
252
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
253
+ attr_reader :tax_lines
254
+ sig { returns(T.nilable(T::Boolean)) }
255
+ attr_reader :taxes_included
256
+ sig { returns(T.nilable(T::Boolean)) }
257
+ attr_reader :test
258
+ sig { returns(T.nilable(String)) }
259
+ attr_reader :token
260
+ sig { returns(T.nilable(String)) }
261
+ attr_reader :total_discounts
262
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
263
+ attr_reader :total_discounts_set
264
+ sig { returns(T.nilable(String)) }
265
+ attr_reader :total_line_items_price
266
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
267
+ attr_reader :total_line_items_price_set
268
+ sig { returns(T.nilable(String)) }
269
+ attr_reader :total_outstanding
270
+ sig { returns(T.nilable(String)) }
271
+ attr_reader :total_price
272
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
273
+ attr_reader :total_price_set
274
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
275
+ attr_reader :total_shipping_price_set
276
+ sig { returns(T.nilable(T.any(String, Float))) }
277
+ attr_reader :total_tax
278
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
279
+ attr_reader :total_tax_set
280
+ sig { returns(T.nilable(String)) }
281
+ attr_reader :total_tip_received
282
+ sig { returns(T.nilable(Integer)) }
283
+ attr_reader :total_weight
284
+ sig { returns(T.nilable(String)) }
285
+ attr_reader :updated_at
286
+ sig { returns(T.nilable(Integer)) }
287
+ attr_reader :user_id
288
+
289
+ class << self
290
+ sig do
291
+ params(
292
+ id: T.any(Integer, String),
293
+ fields: T.untyped,
294
+ session: Auth::Session
295
+ ).returns(T.nilable(Order))
296
+ end
297
+ def find(
298
+ id:,
299
+ fields: nil,
300
+ session: ShopifyAPI::Context.active_session
301
+ )
302
+ result = base_find(
303
+ session: session,
304
+ ids: {id: id},
305
+ params: {fields: fields},
306
+ )
307
+ T.cast(result[0], T.nilable(Order))
308
+ end
309
+
310
+ sig do
311
+ params(
312
+ id: T.any(Integer, String),
313
+ session: Auth::Session
314
+ ).returns(T.untyped)
315
+ end
316
+ def delete(
317
+ id:,
318
+ session: ShopifyAPI::Context.active_session
319
+ )
320
+ request(
321
+ http_method: :delete,
322
+ operation: :delete,
323
+ session: session,
324
+ ids: {id: id},
325
+ params: {},
326
+ )
327
+ end
328
+
329
+ sig do
330
+ params(
331
+ ids: T.untyped,
332
+ limit: T.untyped,
333
+ since_id: T.untyped,
334
+ created_at_min: T.untyped,
335
+ created_at_max: T.untyped,
336
+ updated_at_min: T.untyped,
337
+ updated_at_max: T.untyped,
338
+ processed_at_min: T.untyped,
339
+ processed_at_max: T.untyped,
340
+ attribution_app_id: T.untyped,
341
+ status: T.untyped,
342
+ financial_status: T.untyped,
343
+ fulfillment_status: T.untyped,
344
+ fields: T.untyped,
345
+ session: Auth::Session,
346
+ kwargs: T.untyped
347
+ ).returns(T::Array[Order])
348
+ end
349
+ def all(
350
+ ids: nil,
351
+ limit: nil,
352
+ since_id: nil,
353
+ created_at_min: nil,
354
+ created_at_max: nil,
355
+ updated_at_min: nil,
356
+ updated_at_max: nil,
357
+ processed_at_min: nil,
358
+ processed_at_max: nil,
359
+ attribution_app_id: nil,
360
+ status: nil,
361
+ financial_status: nil,
362
+ fulfillment_status: nil,
363
+ fields: nil,
364
+ session: ShopifyAPI::Context.active_session,
365
+ **kwargs
366
+ )
367
+ response = base_find(
368
+ session: session,
369
+ ids: {},
370
+ params: {ids: ids, 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, processed_at_min: processed_at_min, processed_at_max: processed_at_max, attribution_app_id: attribution_app_id, status: status, financial_status: financial_status, fulfillment_status: fulfillment_status, fields: fields}.merge(kwargs).compact,
371
+ )
372
+
373
+ T.cast(response, T::Array[Order])
374
+ end
375
+
376
+ sig do
377
+ params(
378
+ created_at_min: T.untyped,
379
+ created_at_max: T.untyped,
380
+ updated_at_min: T.untyped,
381
+ updated_at_max: T.untyped,
382
+ status: T.untyped,
383
+ financial_status: T.untyped,
384
+ fulfillment_status: T.untyped,
385
+ session: Auth::Session,
386
+ kwargs: T.untyped
387
+ ).returns(T.untyped)
388
+ end
389
+ def count(
390
+ created_at_min: nil,
391
+ created_at_max: nil,
392
+ updated_at_min: nil,
393
+ updated_at_max: nil,
394
+ status: nil,
395
+ financial_status: nil,
396
+ fulfillment_status: nil,
397
+ session: ShopifyAPI::Context.active_session,
398
+ **kwargs
399
+ )
400
+ request(
401
+ http_method: :get,
402
+ operation: :count,
403
+ session: session,
404
+ ids: {},
405
+ 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, status: status, financial_status: financial_status, fulfillment_status: fulfillment_status}.merge(kwargs).compact,
406
+ body: {},
407
+ entity: nil,
408
+ )
409
+ end
410
+
411
+ end
412
+
413
+ sig do
414
+ params(
415
+ amount: T.untyped,
416
+ currency: T.untyped,
417
+ restock: T.untyped,
418
+ reason: T.untyped,
419
+ email: T.untyped,
420
+ refund: T.untyped,
421
+ body: T.untyped,
422
+ kwargs: T.untyped
423
+ ).returns(T.untyped)
424
+ end
425
+ def cancel(
426
+ amount: nil,
427
+ currency: nil,
428
+ restock: nil,
429
+ reason: nil,
430
+ email: nil,
431
+ refund: nil,
432
+ body: nil,
433
+ **kwargs
434
+ )
435
+ self.class.request(
436
+ http_method: :post,
437
+ operation: :cancel,
438
+ session: @session,
439
+ ids: {id: @id},
440
+ params: {amount: amount, currency: currency, restock: restock, reason: reason, email: email, refund: refund}.merge(kwargs).compact,
441
+ body: body,
442
+ entity: self,
443
+ )
444
+ end
445
+
446
+ sig do
447
+ params(
448
+ body: T.untyped,
449
+ kwargs: T.untyped
450
+ ).returns(T.untyped)
451
+ end
452
+ def close(
453
+ body: nil,
454
+ **kwargs
455
+ )
456
+ self.class.request(
457
+ http_method: :post,
458
+ operation: :close,
459
+ session: @session,
460
+ ids: {id: @id},
461
+ params: {}.merge(kwargs).compact,
462
+ body: body,
463
+ entity: self,
464
+ )
465
+ end
466
+
467
+ sig do
468
+ params(
469
+ body: T.untyped,
470
+ kwargs: T.untyped
471
+ ).returns(T.untyped)
472
+ end
473
+ def open(
474
+ body: nil,
475
+ **kwargs
476
+ )
477
+ self.class.request(
478
+ http_method: :post,
479
+ operation: :open,
480
+ session: @session,
481
+ ids: {id: @id},
482
+ params: {}.merge(kwargs).compact,
483
+ body: body,
484
+ entity: self,
485
+ )
486
+ end
487
+
488
+ end
489
+ end
@@ -0,0 +1,148 @@
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 OrderRisk < 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
+ @cause_cancel = T.let(nil, T.nilable(T::Boolean))
22
+ @checkout_id = T.let(nil, T.nilable(Integer))
23
+ @display = T.let(nil, T.nilable(T::Boolean))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @merchant_message = T.let(nil, T.nilable(String))
26
+ @message = T.let(nil, T.nilable(String))
27
+ @order_id = T.let(nil, T.nilable(Integer))
28
+ @recommendation = T.let(nil, T.nilable(String))
29
+ @score = T.let(nil, T.nilable(String))
30
+ @source = T.let(nil, T.nilable(String))
31
+
32
+ super(session: session, from_hash: from_hash)
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: :delete, operation: :delete, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"},
39
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/risks.json"},
40
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"},
41
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/risks.json"},
42
+ {http_method: :put, operation: :put, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"}
43
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
44
+
45
+ sig { returns(T.nilable(T::Boolean)) }
46
+ attr_reader :cause_cancel
47
+ sig { returns(T.nilable(Integer)) }
48
+ attr_reader :checkout_id
49
+ sig { returns(T.nilable(T::Boolean)) }
50
+ attr_reader :display
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :id
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :merchant_message
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :message
57
+ sig { returns(T.nilable(Integer)) }
58
+ attr_reader :order_id
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :recommendation
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :score
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :source
65
+
66
+ class << self
67
+ sig do
68
+ returns(String)
69
+ end
70
+ def json_body_name()
71
+ "risk"
72
+ end
73
+
74
+ sig do
75
+ returns(T::Array[String])
76
+ end
77
+ def json_response_body_names()
78
+ [
79
+ "risk"
80
+ ]
81
+ end
82
+
83
+ sig do
84
+ params(
85
+ id: T.any(Integer, String),
86
+ order_id: T.nilable(T.any(Integer, String)),
87
+ session: Auth::Session
88
+ ).returns(T.nilable(OrderRisk))
89
+ end
90
+ def find(
91
+ id:,
92
+ order_id: nil,
93
+ session: ShopifyAPI::Context.active_session
94
+ )
95
+ result = base_find(
96
+ session: session,
97
+ ids: {id: id, order_id: order_id},
98
+ params: {},
99
+ )
100
+ T.cast(result[0], T.nilable(OrderRisk))
101
+ end
102
+
103
+ sig do
104
+ params(
105
+ id: T.any(Integer, String),
106
+ order_id: T.nilable(T.any(Integer, String)),
107
+ session: Auth::Session
108
+ ).returns(T.untyped)
109
+ end
110
+ def delete(
111
+ id:,
112
+ order_id: nil,
113
+ session: ShopifyAPI::Context.active_session
114
+ )
115
+ request(
116
+ http_method: :delete,
117
+ operation: :delete,
118
+ session: session,
119
+ ids: {id: id, order_id: order_id},
120
+ params: {},
121
+ )
122
+ end
123
+
124
+ sig do
125
+ params(
126
+ order_id: T.nilable(T.any(Integer, String)),
127
+ session: Auth::Session,
128
+ kwargs: T.untyped
129
+ ).returns(T::Array[OrderRisk])
130
+ end
131
+ def all(
132
+ order_id: nil,
133
+ session: ShopifyAPI::Context.active_session,
134
+ **kwargs
135
+ )
136
+ response = base_find(
137
+ session: session,
138
+ ids: {order_id: order_id},
139
+ params: {}.merge(kwargs).compact,
140
+ )
141
+
142
+ T.cast(response, T::Array[OrderRisk])
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+ end