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,157 @@
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 Image < 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
+ @created_at = T.let(nil, T.nilable(String))
20
+ @height = T.let(nil, T.nilable(Integer))
21
+ @id = T.let(nil, T.nilable(Integer))
22
+ @position = T.let(nil, T.nilable(Integer))
23
+ @product_id = T.let(nil, T.nilable(Integer))
24
+ @src = T.let(nil, T.nilable(String))
25
+ @updated_at = T.let(nil, T.nilable(String))
26
+ @variant_ids = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @width = T.let(nil, T.nilable(Integer))
28
+ end
29
+
30
+ @has_one = T.let({}, T::Hash[Symbol, Class])
31
+ @has_many = T.let({}, T::Hash[Symbol, Class])
32
+ @paths = T.let([
33
+ {http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"},
34
+ {http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/images/count.json"},
35
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/images.json"},
36
+ {http_method: :get, operation: :get, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"},
37
+ {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/images.json"},
38
+ {http_method: :put, operation: :put, ids: [:product_id, :id], path: "products/<product_id>/images/<id>.json"}
39
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
40
+
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :created_at
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :height
45
+ sig { returns(T.nilable(Integer)) }
46
+ attr_reader :id
47
+ sig { returns(T.nilable(Integer)) }
48
+ attr_reader :position
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :product_id
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :src
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :updated_at
55
+ sig { returns(T.nilable(T::Array[Integer])) }
56
+ attr_reader :variant_ids
57
+ sig { returns(T.nilable(Integer)) }
58
+ attr_reader :width
59
+
60
+ class << self
61
+ sig do
62
+ params(
63
+ id: T.any(Integer, String),
64
+ product_id: T.nilable(T.any(Integer, String)),
65
+ fields: T.untyped,
66
+ session: Auth::Session
67
+ ).returns(T.nilable(Image))
68
+ end
69
+ def find(
70
+ id:,
71
+ product_id: nil,
72
+ fields: nil,
73
+ session: ShopifyAPI::Context.active_session
74
+ )
75
+ result = base_find(
76
+ session: session,
77
+ ids: {id: id, product_id: product_id},
78
+ params: {fields: fields},
79
+ )
80
+ T.cast(result[0], T.nilable(Image))
81
+ end
82
+
83
+ sig do
84
+ params(
85
+ id: T.any(Integer, String),
86
+ product_id: T.nilable(T.any(Integer, String)),
87
+ session: Auth::Session
88
+ ).returns(T.untyped)
89
+ end
90
+ def delete(
91
+ id:,
92
+ product_id: nil,
93
+ session: ShopifyAPI::Context.active_session
94
+ )
95
+ request(
96
+ http_method: :delete,
97
+ operation: :delete,
98
+ session: session,
99
+ ids: {id: id, product_id: product_id},
100
+ params: {},
101
+ )
102
+ end
103
+
104
+ sig do
105
+ params(
106
+ product_id: T.nilable(T.any(Integer, String)),
107
+ since_id: T.untyped,
108
+ fields: T.untyped,
109
+ session: Auth::Session,
110
+ kwargs: T.untyped
111
+ ).returns(T::Array[Image])
112
+ end
113
+ def all(
114
+ product_id: nil,
115
+ since_id: nil,
116
+ fields: nil,
117
+ session: ShopifyAPI::Context.active_session,
118
+ **kwargs
119
+ )
120
+ response = base_find(
121
+ session: session,
122
+ ids: {product_id: product_id},
123
+ params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
124
+ )
125
+
126
+ T.cast(response, T::Array[Image])
127
+ end
128
+
129
+ sig do
130
+ params(
131
+ product_id: T.nilable(T.any(Integer, String)),
132
+ since_id: T.untyped,
133
+ session: Auth::Session,
134
+ kwargs: T.untyped
135
+ ).returns(T.untyped)
136
+ end
137
+ def count(
138
+ product_id: nil,
139
+ since_id: nil,
140
+ session: ShopifyAPI::Context.active_session,
141
+ **kwargs
142
+ )
143
+ request(
144
+ http_method: :get,
145
+ operation: :count,
146
+ session: session,
147
+ ids: {product_id: product_id},
148
+ params: {since_id: since_id}.merge(kwargs).compact,
149
+ body: {},
150
+ entity: nil,
151
+ )
152
+ end
153
+
154
+ end
155
+
156
+ end
157
+ end
@@ -0,0 +1,108 @@
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 InventoryItem < 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
+ @cost = T.let(nil, T.nilable(String))
20
+ @country_code_of_origin = T.let(nil, T.nilable(String))
21
+ @country_harmonized_system_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @harmonized_system_code = T.let(nil, T.nilable(Integer))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @province_code_of_origin = T.let(nil, T.nilable(String))
26
+ @requires_shipping = T.let(nil, T.nilable(T::Boolean))
27
+ @sku = T.let(nil, T.nilable(String))
28
+ @tracked = T.let(nil, T.nilable(T::Boolean))
29
+ @updated_at = T.let(nil, T.nilable(String))
30
+ end
31
+
32
+ @has_one = T.let({}, T::Hash[Symbol, Class])
33
+ @has_many = T.let({}, T::Hash[Symbol, Class])
34
+ @paths = T.let([
35
+ {http_method: :get, operation: :get, ids: [], path: "inventory_items.json"},
36
+ {http_method: :get, operation: :get, ids: [:id], path: "inventory_items/<id>.json"},
37
+ {http_method: :put, operation: :put, ids: [:id], path: "inventory_items/<id>.json"}
38
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
39
+
40
+ sig { returns(T.nilable(String)) }
41
+ attr_reader :cost
42
+ sig { returns(T.nilable(String)) }
43
+ attr_reader :country_code_of_origin
44
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
45
+ attr_reader :country_harmonized_system_codes
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :created_at
48
+ sig { returns(T.nilable(Integer)) }
49
+ attr_reader :harmonized_system_code
50
+ sig { returns(T.nilable(Integer)) }
51
+ attr_reader :id
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :province_code_of_origin
54
+ sig { returns(T.nilable(T::Boolean)) }
55
+ attr_reader :requires_shipping
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :sku
58
+ sig { returns(T.nilable(T::Boolean)) }
59
+ attr_reader :tracked
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :updated_at
62
+
63
+ class << self
64
+ sig do
65
+ params(
66
+ id: T.any(Integer, String),
67
+ session: Auth::Session
68
+ ).returns(T.nilable(InventoryItem))
69
+ end
70
+ def find(
71
+ id:,
72
+ session: ShopifyAPI::Context.active_session
73
+ )
74
+ result = base_find(
75
+ session: session,
76
+ ids: {id: id},
77
+ params: {},
78
+ )
79
+ T.cast(result[0], T.nilable(InventoryItem))
80
+ end
81
+
82
+ sig do
83
+ params(
84
+ ids: T.untyped,
85
+ limit: T.untyped,
86
+ session: Auth::Session,
87
+ kwargs: T.untyped
88
+ ).returns(T::Array[InventoryItem])
89
+ end
90
+ def all(
91
+ ids: nil,
92
+ limit: nil,
93
+ session: ShopifyAPI::Context.active_session,
94
+ **kwargs
95
+ )
96
+ response = base_find(
97
+ session: session,
98
+ ids: {},
99
+ params: {ids: ids, limit: limit}.merge(kwargs).compact,
100
+ )
101
+
102
+ T.cast(response, T::Array[InventoryItem])
103
+ end
104
+
105
+ end
106
+
107
+ end
108
+ end
@@ -0,0 +1,179 @@
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 InventoryLevel < 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
+ @available = T.let(nil, T.nilable(Integer))
20
+ @inventory_item_id = T.let(nil, T.nilable(Integer))
21
+ @location_id = T.let(nil, T.nilable(Integer))
22
+ @updated_at = T.let(nil, T.nilable(String))
23
+ end
24
+
25
+ @has_one = T.let({}, T::Hash[Symbol, Class])
26
+ @has_many = T.let({}, T::Hash[Symbol, Class])
27
+ @paths = T.let([
28
+ {http_method: :delete, operation: :delete, ids: [], path: "inventory_levels.json"},
29
+ {http_method: :get, operation: :get, ids: [], path: "inventory_levels.json"},
30
+ {http_method: :post, operation: :adjust, ids: [], path: "inventory_levels/adjust.json"},
31
+ {http_method: :post, operation: :connect, ids: [], path: "inventory_levels/connect.json"},
32
+ {http_method: :post, operation: :set, ids: [], path: "inventory_levels/set.json"}
33
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
34
+
35
+ sig { returns(T.nilable(Integer)) }
36
+ attr_reader :available
37
+ sig { returns(T.nilable(Integer)) }
38
+ attr_reader :inventory_item_id
39
+ sig { returns(T.nilable(Integer)) }
40
+ attr_reader :location_id
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :updated_at
43
+
44
+ class << self
45
+ sig do
46
+ params(
47
+ inventory_item_id: T.untyped,
48
+ location_id: T.untyped,
49
+ session: Auth::Session
50
+ ).returns(T.untyped)
51
+ end
52
+ def delete(
53
+ inventory_item_id: nil,
54
+ location_id: nil,
55
+ session: ShopifyAPI::Context.active_session
56
+ )
57
+ request(
58
+ http_method: :delete,
59
+ operation: :delete,
60
+ session: session,
61
+ ids: {},
62
+ params: {inventory_item_id: inventory_item_id, location_id: location_id},
63
+ )
64
+ end
65
+
66
+ sig do
67
+ params(
68
+ inventory_item_ids: T.untyped,
69
+ location_ids: T.untyped,
70
+ limit: T.untyped,
71
+ updated_at_min: T.untyped,
72
+ session: Auth::Session,
73
+ kwargs: T.untyped
74
+ ).returns(T::Array[InventoryLevel])
75
+ end
76
+ def all(
77
+ inventory_item_ids: nil,
78
+ location_ids: nil,
79
+ limit: nil,
80
+ updated_at_min: nil,
81
+ session: ShopifyAPI::Context.active_session,
82
+ **kwargs
83
+ )
84
+ response = base_find(
85
+ session: session,
86
+ ids: {},
87
+ params: {inventory_item_ids: inventory_item_ids, location_ids: location_ids, limit: limit, updated_at_min: updated_at_min}.merge(kwargs).compact,
88
+ )
89
+
90
+ T.cast(response, T::Array[InventoryLevel])
91
+ end
92
+
93
+ end
94
+
95
+ sig do
96
+ params(
97
+ inventory_item_id: T.untyped,
98
+ location_id: T.untyped,
99
+ available_adjustment: T.untyped,
100
+ body: T.untyped,
101
+ kwargs: T.untyped
102
+ ).returns(T.untyped)
103
+ end
104
+ def adjust(
105
+ inventory_item_id: nil,
106
+ location_id: nil,
107
+ available_adjustment: nil,
108
+ body: nil,
109
+ **kwargs
110
+ )
111
+ self.class.request(
112
+ http_method: :post,
113
+ operation: :adjust,
114
+ session: @session,
115
+ ids: {},
116
+ params: {inventory_item_id: inventory_item_id, location_id: location_id, available_adjustment: available_adjustment}.merge(kwargs).compact,
117
+ body: body,
118
+ entity: self,
119
+ )
120
+ end
121
+
122
+ sig do
123
+ params(
124
+ inventory_item_id: T.untyped,
125
+ location_id: T.untyped,
126
+ relocate_if_necessary: T.untyped,
127
+ body: T.untyped,
128
+ kwargs: T.untyped
129
+ ).returns(T.untyped)
130
+ end
131
+ def connect(
132
+ inventory_item_id: nil,
133
+ location_id: nil,
134
+ relocate_if_necessary: nil,
135
+ body: nil,
136
+ **kwargs
137
+ )
138
+ self.class.request(
139
+ http_method: :post,
140
+ operation: :connect,
141
+ session: @session,
142
+ ids: {},
143
+ params: {inventory_item_id: inventory_item_id, location_id: location_id, relocate_if_necessary: relocate_if_necessary}.merge(kwargs).compact,
144
+ body: body,
145
+ entity: self,
146
+ )
147
+ end
148
+
149
+ sig do
150
+ params(
151
+ inventory_item_id: T.untyped,
152
+ location_id: T.untyped,
153
+ available: T.untyped,
154
+ disconnect_if_necessary: T.untyped,
155
+ body: T.untyped,
156
+ kwargs: T.untyped
157
+ ).returns(T.untyped)
158
+ end
159
+ def set(
160
+ inventory_item_id: nil,
161
+ location_id: nil,
162
+ available: nil,
163
+ disconnect_if_necessary: nil,
164
+ body: nil,
165
+ **kwargs
166
+ )
167
+ self.class.request(
168
+ http_method: :post,
169
+ operation: :set,
170
+ session: @session,
171
+ ids: {},
172
+ params: {inventory_item_id: inventory_item_id, location_id: location_id, available: available, disconnect_if_necessary: disconnect_if_necessary}.merge(kwargs).compact,
173
+ body: body,
174
+ entity: self,
175
+ )
176
+ end
177
+
178
+ end
179
+ end
@@ -0,0 +1,167 @@
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 Location < 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
+ @active = T.let(nil, T.nilable(T::Boolean))
20
+ @address1 = T.let(nil, T.nilable(String))
21
+ @address2 = T.let(nil, T.nilable(String))
22
+ @city = T.let(nil, T.nilable(String))
23
+ @country = T.let(nil, T.nilable(String))
24
+ @country_code = T.let(nil, T.nilable(String))
25
+ @created_at = T.let(nil, T.nilable(String))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @legacy = T.let(nil, T.nilable(T::Boolean))
28
+ @localized_country_name = T.let(nil, T.nilable(String))
29
+ @localized_province_name = T.let(nil, T.nilable(String))
30
+ @name = T.let(nil, T.nilable(String))
31
+ @phone = T.let(nil, T.nilable(String))
32
+ @province = T.let(nil, T.nilable(String))
33
+ @province_code = T.let(nil, T.nilable(String))
34
+ @updated_at = T.let(nil, T.nilable(String))
35
+ @zip = T.let(nil, T.nilable(String))
36
+ end
37
+
38
+ @has_one = T.let({}, T::Hash[Symbol, Class])
39
+ @has_many = T.let({}, T::Hash[Symbol, Class])
40
+ @paths = T.let([
41
+ {http_method: :get, operation: :count, ids: [], path: "locations/count.json"},
42
+ {http_method: :get, operation: :get, ids: [], path: "locations.json"},
43
+ {http_method: :get, operation: :get, ids: [:id], path: "locations/<id>.json"},
44
+ {http_method: :get, operation: :inventory_levels, ids: [:id], path: "locations/<id>/inventory_levels.json"}
45
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
46
+
47
+ sig { returns(T.nilable(T::Boolean)) }
48
+ attr_reader :active
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :address1
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :address2
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :city
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :country
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :country_code
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :created_at
61
+ sig { returns(T.nilable(Integer)) }
62
+ attr_reader :id
63
+ sig { returns(T.nilable(T::Boolean)) }
64
+ attr_reader :legacy
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :localized_country_name
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :localized_province_name
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :name
71
+ sig { returns(T.nilable(String)) }
72
+ attr_reader :phone
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :province
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :province_code
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :updated_at
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :zip
81
+
82
+ class << self
83
+ sig do
84
+ params(
85
+ id: T.any(Integer, String),
86
+ session: Auth::Session
87
+ ).returns(T.nilable(Location))
88
+ end
89
+ def find(
90
+ id:,
91
+ session: ShopifyAPI::Context.active_session
92
+ )
93
+ result = base_find(
94
+ session: session,
95
+ ids: {id: id},
96
+ params: {},
97
+ )
98
+ T.cast(result[0], T.nilable(Location))
99
+ end
100
+
101
+ sig do
102
+ params(
103
+ session: Auth::Session,
104
+ kwargs: T.untyped
105
+ ).returns(T::Array[Location])
106
+ end
107
+ def all(
108
+ session: ShopifyAPI::Context.active_session,
109
+ **kwargs
110
+ )
111
+ response = base_find(
112
+ session: session,
113
+ ids: {},
114
+ params: {}.merge(kwargs).compact,
115
+ )
116
+
117
+ T.cast(response, T::Array[Location])
118
+ end
119
+
120
+ sig do
121
+ params(
122
+ session: Auth::Session,
123
+ kwargs: T.untyped
124
+ ).returns(T.untyped)
125
+ end
126
+ def count(
127
+ session: ShopifyAPI::Context.active_session,
128
+ **kwargs
129
+ )
130
+ request(
131
+ http_method: :get,
132
+ operation: :count,
133
+ session: session,
134
+ ids: {},
135
+ params: {}.merge(kwargs).compact,
136
+ body: {},
137
+ entity: nil,
138
+ )
139
+ end
140
+
141
+ sig do
142
+ params(
143
+ id: T.any(Integer, String),
144
+ session: Auth::Session,
145
+ kwargs: T.untyped
146
+ ).returns(T.untyped)
147
+ end
148
+ def inventory_levels(
149
+ id:,
150
+ session: ShopifyAPI::Context.active_session,
151
+ **kwargs
152
+ )
153
+ request(
154
+ http_method: :get,
155
+ operation: :inventory_levels,
156
+ session: session,
157
+ ids: {id: id},
158
+ params: {}.merge(kwargs).compact,
159
+ body: {},
160
+ entity: nil,
161
+ )
162
+ end
163
+
164
+ end
165
+
166
+ end
167
+ end
@@ -0,0 +1,56 @@
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 LocationsForMove < 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
+ @locations_for_move = T.let(nil, T.nilable(T::Array[T.untyped]))
20
+ end
21
+
22
+ @has_one = T.let({}, T::Hash[Symbol, Class])
23
+ @has_many = T.let({}, T::Hash[Symbol, Class])
24
+ @paths = T.let([
25
+ {http_method: :get, operation: :get, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/locations_for_move.json"}
26
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
27
+
28
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
29
+ attr_reader :locations_for_move
30
+
31
+ class << self
32
+ sig do
33
+ params(
34
+ fulfillment_order_id: T.nilable(T.any(Integer, String)),
35
+ session: Auth::Session,
36
+ kwargs: T.untyped
37
+ ).returns(T::Array[LocationsForMove])
38
+ end
39
+ def all(
40
+ fulfillment_order_id: nil,
41
+ session: ShopifyAPI::Context.active_session,
42
+ **kwargs
43
+ )
44
+ response = base_find(
45
+ session: session,
46
+ ids: {fulfillment_order_id: fulfillment_order_id},
47
+ params: {}.merge(kwargs).compact,
48
+ )
49
+
50
+ T.cast(response, T::Array[LocationsForMove])
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+ end