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