shopify_api 12.5.0 → 13.0.0

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