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
@@ -5,6 +5,7 @@ module ShopifyAPI
5
5
  module AdminVersions
6
6
  SUPPORTED_ADMIN_VERSIONS = T.let([
7
7
  "unstable",
8
+ "2023-10",
8
9
  "2023-07",
9
10
  "2023-04",
10
11
  "2023-01",
@@ -14,7 +15,7 @@ module ShopifyAPI
14
15
  "2022-01",
15
16
  ], T::Array[String])
16
17
 
17
- LATEST_SUPPORTED_ADMIN_VERSION = T.let("2023-07", String)
18
+ LATEST_SUPPORTED_ADMIN_VERSION = T.let("2023-10", String)
18
19
  end
19
20
 
20
21
  SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
@@ -12,7 +12,9 @@ module ShopifyAPI
12
12
  @is_private = T.let(false, T::Boolean)
13
13
  @private_shop = T.let(nil, T.nilable(String))
14
14
  @is_embedded = T.let(true, T::Boolean)
15
- @logger = T.let(::Logger.new($stdout), ::Logger)
15
+ # Logger can either be a Logger or an ActiveSupport::BroadcastLogger, which is new in Rails 7.1.0. To avoid adding a
16
+ # dependency Active Support >= 7.1.0, we go with T.untyped
17
+ @logger = T.let(::Logger.new($stdout), T.untyped)
16
18
  @log_level = T.let(:info, Symbol)
17
19
  @notified_missing_resources_folder = T.let({}, T::Hash[String, T::Boolean])
18
20
  @active_session = T.let(Concurrent::ThreadLocalVar.new { nil }, T.nilable(Concurrent::ThreadLocalVar))
@@ -33,7 +35,7 @@ module ShopifyAPI
33
35
  is_private: T::Boolean,
34
36
  is_embedded: T::Boolean,
35
37
  log_level: T.any(String, Symbol),
36
- logger: ::Logger,
38
+ logger: T.untyped,
37
39
  host_name: T.nilable(String),
38
40
  host: T.nilable(String),
39
41
  private_shop: T.nilable(String),
@@ -116,7 +118,7 @@ module ShopifyAPI
116
118
  sig { returns(Auth::AuthScopes) }
117
119
  attr_reader :scope
118
120
 
119
- sig { returns(::Logger) }
121
+ sig { returns(T.untyped) }
120
122
  attr_reader :logger
121
123
 
122
124
  sig { returns(Symbol) }
@@ -97,9 +97,9 @@ module ShopifyAPI
97
97
  class_name.underscore
98
98
  end
99
99
 
100
- sig { returns(String) }
101
- def json_response_body_name
102
- class_name
100
+ sig { returns(T::Array[String]) }
101
+ def json_response_body_names
102
+ [class_name]
103
103
  end
104
104
 
105
105
  sig { returns(T.nilable(String)) }
@@ -210,14 +210,16 @@ module ShopifyAPI
210
210
 
211
211
  body = T.cast(response.body, T::Hash[String, T.untyped])
212
212
 
213
- response_name = json_response_body_name
213
+ response_names = json_response_body_names
214
214
 
215
- if body.key?(response_name.pluralize) || (body.key?(response_name) && body[response_name].is_a?(Array))
216
- (body[response_name.pluralize] || body[response_name]).each do |entry|
217
- objects << create_instance(data: entry, session: session)
215
+ response_names.each do |response_name|
216
+ if body.key?(response_name.pluralize) || (body.key?(response_name) && body[response_name].is_a?(Array))
217
+ (body[response_name.pluralize] || body[response_name]).each do |entry|
218
+ objects << create_instance(data: entry, session: session)
219
+ end
220
+ elsif body.key?(response_name)
221
+ objects << create_instance(data: body[response_name], session: session)
218
222
  end
219
- elsif body.key?(response_name)
220
- objects << create_instance(data: body[response_name], session: session)
221
223
  end
222
224
 
223
225
  objects
@@ -347,10 +349,8 @@ module ShopifyAPI
347
349
  )
348
350
 
349
351
  if update_object
350
- self.class.create_instance(
351
- data: response.body[self.class.class_name.downcase],
352
- session: @session, instance: self
353
- )
352
+ response_name = self.class.json_response_body_names & response.body.keys
353
+ self.class.create_instance(data: response.body[response_name.first], session: @session, instance: self)
354
354
  end
355
355
  rescue ShopifyAPI::Errors::HttpResponseError => e
356
356
  @errors.errors << e
@@ -365,10 +365,18 @@ module ShopifyAPI
365
365
  self.class.read_only_attributes&.include?("@#{attribute}".to_sym)
366
366
  end
367
367
 
368
- HashDiff::Comparison.new(
368
+ diff = HashDiff::Comparison.new(
369
369
  deep_stringify_keys(original_state_for_update),
370
370
  deep_stringify_keys(to_hash(true)),
371
371
  ).left_diff
372
+
373
+ diff.each do |attribute, value|
374
+ if value.is_a?(Hash) && value[0] == HashDiff::NO_VALUE
375
+ diff[attribute] = send(attribute)
376
+ end
377
+ end
378
+
379
+ diff
372
380
  end
373
381
 
374
382
  sig { returns(Symbol) }
@@ -51,10 +51,12 @@ module ShopifyAPI
51
51
 
52
52
  class << self
53
53
  sig do
54
- returns(String)
54
+ returns(T::Array[String])
55
55
  end
56
- def json_response_body_name()
57
- "fulfillment_order"
56
+ def json_response_body_names()
57
+ [
58
+ "fulfillment_order"
59
+ ]
58
60
  end
59
61
 
60
62
  sig do
@@ -87,6 +87,16 @@ module ShopifyAPI
87
87
  "address"
88
88
  end
89
89
 
90
+ sig do
91
+ returns(T::Array[String])
92
+ end
93
+ def json_response_body_names()
94
+ [
95
+ "customer_address",
96
+ "address"
97
+ ]
98
+ end
99
+
90
100
  sig do
91
101
  params(
92
102
  id: T.any(Integer, String),
@@ -31,6 +31,16 @@ module ShopifyAPI
31
31
  attr_reader :fulfillment_order_id
32
32
 
33
33
  class << self
34
+ sig do
35
+ returns(T::Array[String])
36
+ end
37
+ def json_response_body_names()
38
+ [
39
+ "submitted_fulfillment_order",
40
+ "fulfillment_order"
41
+ ]
42
+ end
43
+
34
44
  end
35
45
 
36
46
  sig do
@@ -68,10 +68,12 @@ module ShopifyAPI
68
68
  end
69
69
 
70
70
  sig do
71
- returns(String)
71
+ returns(T::Array[String])
72
72
  end
73
- def json_response_body_name()
74
- "risk"
73
+ def json_response_body_names()
74
+ [
75
+ "risk"
76
+ ]
75
77
  end
76
78
 
77
79
  sig do
@@ -51,10 +51,12 @@ module ShopifyAPI
51
51
 
52
52
  class << self
53
53
  sig do
54
- returns(String)
54
+ returns(T::Array[String])
55
55
  end
56
- def json_response_body_name()
57
- "fulfillment_order"
56
+ def json_response_body_names()
57
+ [
58
+ "fulfillment_order"
59
+ ]
58
60
  end
59
61
 
60
62
  sig do
@@ -16,6 +16,7 @@ module ShopifyAPI
16
16
  def initialize(session: ShopifyAPI::Context.active_session)
17
17
  super(session: session)
18
18
 
19
+ @balance = T.let(nil, T.nilable(T::Array[T.untyped]))
19
20
  end
20
21
 
21
22
  @has_one = T.let({}, T::Hash[Symbol, Class])
@@ -24,6 +25,9 @@ module ShopifyAPI
24
25
  {http_method: :get, operation: :get, ids: [], path: "shopify_payments/balance.json"}
25
26
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
26
27
 
28
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
29
+ attr_reader :balance
30
+
27
31
  class << self
28
32
  sig do
29
33
  params(
@@ -87,6 +87,16 @@ module ShopifyAPI
87
87
  "address"
88
88
  end
89
89
 
90
+ sig do
91
+ returns(T::Array[String])
92
+ end
93
+ def json_response_body_names()
94
+ [
95
+ "customer_address",
96
+ "address"
97
+ ]
98
+ end
99
+
90
100
  sig do
91
101
  params(
92
102
  id: T.any(Integer, String),
@@ -31,6 +31,16 @@ module ShopifyAPI
31
31
  attr_reader :fulfillment_order_id
32
32
 
33
33
  class << self
34
+ sig do
35
+ returns(T::Array[String])
36
+ end
37
+ def json_response_body_names()
38
+ [
39
+ "submitted_fulfillment_order",
40
+ "fulfillment_order"
41
+ ]
42
+ end
43
+
34
44
  end
35
45
 
36
46
  sig do
@@ -28,6 +28,7 @@ module ShopifyAPI
28
28
  @client_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
29
  @closed_at = T.let(nil, T.nilable(String))
30
30
  @company = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
31
+ @confirmation_number = T.let(nil, T.nilable(String))
31
32
  @created_at = T.let(nil, T.nilable(String))
32
33
  @currency = T.let(nil, T.nilable(String))
33
34
  @current_subtotal_price = T.let(nil, T.nilable(String))
@@ -142,6 +143,8 @@ module ShopifyAPI
142
143
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
143
144
  attr_reader :company
144
145
  sig { returns(T.nilable(String)) }
146
+ attr_reader :confirmation_number
147
+ sig { returns(T.nilable(String)) }
145
148
  attr_reader :created_at
146
149
  sig { returns(T.nilable(String)) }
147
150
  attr_reader :currency
@@ -68,10 +68,12 @@ module ShopifyAPI
68
68
  end
69
69
 
70
70
  sig do
71
- returns(String)
71
+ returns(T::Array[String])
72
72
  end
73
- def json_response_body_name()
74
- "risk"
73
+ def json_response_body_names()
74
+ [
75
+ "risk"
76
+ ]
75
77
  end
76
78
 
77
79
  sig do
@@ -20,7 +20,6 @@ module ShopifyAPI
20
20
  @address2 = T.let(nil, T.nilable(String))
21
21
  @checkout_api_supported = T.let(nil, T.nilable(T::Boolean))
22
22
  @city = T.let(nil, T.nilable(String))
23
- @cookie_consent_level = T.let(nil, T.nilable(String))
24
23
  @country = T.let(nil, T.nilable(String))
25
24
  @country_code = T.let(nil, T.nilable(String))
26
25
  @country_name = T.let(nil, T.nilable(String))
@@ -89,8 +88,6 @@ module ShopifyAPI
89
88
  sig { returns(T.nilable(String)) }
90
89
  attr_reader :city
91
90
  sig { returns(T.nilable(String)) }
92
- attr_reader :cookie_consent_level
93
- sig { returns(T.nilable(String)) }
94
91
  attr_reader :country
95
92
  sig { returns(T.nilable(String)) }
96
93
  attr_reader :country_code
@@ -27,7 +27,6 @@ module ShopifyAPI
27
27
  @inventory_management = T.let(nil, T.nilable(String))
28
28
  @inventory_policy = T.let(nil, T.nilable(String))
29
29
  @inventory_quantity = T.let(nil, T.nilable(Integer))
30
- @inventory_quantity_adjustment = T.let(nil, T.nilable(Integer))
31
30
  @old_inventory_quantity = T.let(nil, T.nilable(Integer))
32
31
  @option = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
33
32
  @position = T.let(nil, T.nilable(Integer))
@@ -55,8 +54,7 @@ module ShopifyAPI
55
54
  {http_method: :put, operation: :put, ids: [:id], path: "variants/<id>.json"}
56
55
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
57
56
  @read_only_attributes = T.let([
58
- :inventory_quantity,
59
- :inventory_quantity_adjustment
57
+ :inventory_quantity
60
58
  ], T::Array[Symbol])
61
59
 
62
60
  sig { returns(T.nilable(String)) }
@@ -82,8 +80,6 @@ module ShopifyAPI
82
80
  sig { returns(T.nilable(Integer)) }
83
81
  attr_reader :inventory_quantity
84
82
  sig { returns(T.nilable(Integer)) }
85
- attr_reader :inventory_quantity_adjustment
86
- sig { returns(T.nilable(Integer)) }
87
83
  attr_reader :old_inventory_quantity
88
84
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
89
85
  attr_reader :option
@@ -51,10 +51,12 @@ module ShopifyAPI
51
51
 
52
52
  class << self
53
53
  sig do
54
- returns(String)
54
+ returns(T::Array[String])
55
55
  end
56
- def json_response_body_name()
57
- "fulfillment_order"
56
+ def json_response_body_names()
57
+ [
58
+ "fulfillment_order"
59
+ ]
58
60
  end
59
61
 
60
62
  sig do
@@ -16,6 +16,7 @@ module ShopifyAPI
16
16
  def initialize(session: ShopifyAPI::Context.active_session)
17
17
  super(session: session)
18
18
 
19
+ @balance = T.let(nil, T.nilable(T::Array[T.untyped]))
19
20
  end
20
21
 
21
22
  @has_one = T.let({}, T::Hash[Symbol, Class])
@@ -24,6 +25,9 @@ module ShopifyAPI
24
25
  {http_method: :get, operation: :get, ids: [], path: "shopify_payments/balance.json"}
25
26
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
26
27
 
28
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
29
+ attr_reader :balance
30
+
27
31
  class << self
28
32
  sig do
29
33
  params(
@@ -87,6 +87,16 @@ module ShopifyAPI
87
87
  "address"
88
88
  end
89
89
 
90
+ sig do
91
+ returns(T::Array[String])
92
+ end
93
+ def json_response_body_names()
94
+ [
95
+ "customer_address",
96
+ "address"
97
+ ]
98
+ end
99
+
90
100
  sig do
91
101
  params(
92
102
  id: T.any(Integer, String),
@@ -31,6 +31,16 @@ module ShopifyAPI
31
31
  attr_reader :fulfillment_order_id
32
32
 
33
33
  class << self
34
+ sig do
35
+ returns(T::Array[String])
36
+ end
37
+ def json_response_body_names()
38
+ [
39
+ "submitted_fulfillment_order",
40
+ "fulfillment_order"
41
+ ]
42
+ end
43
+
34
44
  end
35
45
 
36
46
  sig do
@@ -28,6 +28,7 @@ module ShopifyAPI
28
28
  @client_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
29
  @closed_at = T.let(nil, T.nilable(String))
30
30
  @company = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
31
+ @confirmation_number = T.let(nil, T.nilable(String))
31
32
  @created_at = T.let(nil, T.nilable(String))
32
33
  @currency = T.let(nil, T.nilable(String))
33
34
  @current_subtotal_price = T.let(nil, T.nilable(String))
@@ -144,6 +145,8 @@ module ShopifyAPI
144
145
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
145
146
  attr_reader :company
146
147
  sig { returns(T.nilable(String)) }
148
+ attr_reader :confirmation_number
149
+ sig { returns(T.nilable(String)) }
147
150
  attr_reader :created_at
148
151
  sig { returns(T.nilable(String)) }
149
152
  attr_reader :currency
@@ -68,10 +68,12 @@ module ShopifyAPI
68
68
  end
69
69
 
70
70
  sig do
71
- returns(String)
71
+ returns(T::Array[String])
72
72
  end
73
- def json_response_body_name()
74
- "risk"
73
+ def json_response_body_names()
74
+ [
75
+ "risk"
76
+ ]
75
77
  end
76
78
 
77
79
  sig do
@@ -20,7 +20,6 @@ module ShopifyAPI
20
20
  @address2 = T.let(nil, T.nilable(String))
21
21
  @checkout_api_supported = T.let(nil, T.nilable(T::Boolean))
22
22
  @city = T.let(nil, T.nilable(String))
23
- @cookie_consent_level = T.let(nil, T.nilable(String))
24
23
  @country = T.let(nil, T.nilable(String))
25
24
  @country_code = T.let(nil, T.nilable(String))
26
25
  @country_name = T.let(nil, T.nilable(String))
@@ -89,8 +88,6 @@ module ShopifyAPI
89
88
  sig { returns(T.nilable(String)) }
90
89
  attr_reader :city
91
90
  sig { returns(T.nilable(String)) }
92
- attr_reader :cookie_consent_level
93
- sig { returns(T.nilable(String)) }
94
91
  attr_reader :country
95
92
  sig { returns(T.nilable(String)) }
96
93
  attr_reader :country_code
@@ -27,7 +27,6 @@ module ShopifyAPI
27
27
  @inventory_management = T.let(nil, T.nilable(String))
28
28
  @inventory_policy = T.let(nil, T.nilable(String))
29
29
  @inventory_quantity = T.let(nil, T.nilable(Integer))
30
- @inventory_quantity_adjustment = T.let(nil, T.nilable(Integer))
31
30
  @old_inventory_quantity = T.let(nil, T.nilable(Integer))
32
31
  @option = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
33
32
  @position = T.let(nil, T.nilable(Integer))
@@ -55,8 +54,7 @@ module ShopifyAPI
55
54
  {http_method: :put, operation: :put, ids: [:id], path: "variants/<id>.json"}
56
55
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
57
56
  @read_only_attributes = T.let([
58
- :inventory_quantity,
59
- :inventory_quantity_adjustment
57
+ :inventory_quantity
60
58
  ], T::Array[Symbol])
61
59
 
62
60
  sig { returns(T.nilable(String)) }
@@ -82,8 +80,6 @@ module ShopifyAPI
82
80
  sig { returns(T.nilable(Integer)) }
83
81
  attr_reader :inventory_quantity
84
82
  sig { returns(T.nilable(Integer)) }
85
- attr_reader :inventory_quantity_adjustment
86
- sig { returns(T.nilable(Integer)) }
87
83
  attr_reader :old_inventory_quantity
88
84
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
89
85
  attr_reader :option
@@ -51,10 +51,12 @@ module ShopifyAPI
51
51
 
52
52
  class << self
53
53
  sig do
54
- returns(String)
54
+ returns(T::Array[String])
55
55
  end
56
- def json_response_body_name()
57
- "fulfillment_order"
56
+ def json_response_body_names()
57
+ [
58
+ "fulfillment_order"
59
+ ]
58
60
  end
59
61
 
60
62
  sig do
@@ -16,6 +16,7 @@ module ShopifyAPI
16
16
  def initialize(session: ShopifyAPI::Context.active_session)
17
17
  super(session: session)
18
18
 
19
+ @balance = T.let(nil, T.nilable(T::Array[T.untyped]))
19
20
  end
20
21
 
21
22
  @has_one = T.let({}, T::Hash[Symbol, Class])
@@ -24,6 +25,9 @@ module ShopifyAPI
24
25
  {http_method: :get, operation: :get, ids: [], path: "shopify_payments/balance.json"}
25
26
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
26
27
 
28
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
29
+ attr_reader :balance
30
+
27
31
  class << self
28
32
  sig do
29
33
  params(
@@ -87,6 +87,16 @@ module ShopifyAPI
87
87
  "address"
88
88
  end
89
89
 
90
+ sig do
91
+ returns(T::Array[String])
92
+ end
93
+ def json_response_body_names()
94
+ [
95
+ "customer_address",
96
+ "address"
97
+ ]
98
+ end
99
+
90
100
  sig do
91
101
  params(
92
102
  id: T.any(Integer, String),
@@ -31,6 +31,16 @@ module ShopifyAPI
31
31
  attr_reader :fulfillment_order_id
32
32
 
33
33
  class << self
34
+ sig do
35
+ returns(T::Array[String])
36
+ end
37
+ def json_response_body_names()
38
+ [
39
+ "submitted_fulfillment_order",
40
+ "fulfillment_order"
41
+ ]
42
+ end
43
+
34
44
  end
35
45
 
36
46
  sig do
@@ -28,6 +28,7 @@ module ShopifyAPI
28
28
  @client_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
29
  @closed_at = T.let(nil, T.nilable(String))
30
30
  @company = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
31
+ @confirmation_number = T.let(nil, T.nilable(String))
31
32
  @created_at = T.let(nil, T.nilable(String))
32
33
  @currency = T.let(nil, T.nilable(String))
33
34
  @current_subtotal_price = T.let(nil, T.nilable(String))
@@ -145,6 +146,8 @@ module ShopifyAPI
145
146
  sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
146
147
  attr_reader :company
147
148
  sig { returns(T.nilable(String)) }
149
+ attr_reader :confirmation_number
150
+ sig { returns(T.nilable(String)) }
148
151
  attr_reader :created_at
149
152
  sig { returns(T.nilable(String)) }
150
153
  attr_reader :currency
@@ -68,10 +68,12 @@ module ShopifyAPI
68
68
  end
69
69
 
70
70
  sig do
71
- returns(String)
71
+ returns(T::Array[String])
72
72
  end
73
- def json_response_body_name()
74
- "risk"
73
+ def json_response_body_names()
74
+ [
75
+ "risk"
76
+ ]
75
77
  end
76
78
 
77
79
  sig do