shopify_api 12.3.0 → 12.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +40 -0
  3. data/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +9 -0
  4. data/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +9 -0
  5. data/.github/workflows/build.yml +0 -3
  6. data/.github/workflows/stale.yml +1 -0
  7. data/CHANGELOG.md +8 -1
  8. data/Gemfile.lock +9 -9
  9. data/lib/shopify_api/admin_versions.rb +2 -1
  10. data/lib/shopify_api/rest/base.rb +11 -4
  11. data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +7 -0
  12. data/lib/shopify_api/rest/resources/2022_01/customer.rb +9 -1
  13. data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +5 -1
  14. data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +3 -3
  15. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +7 -0
  16. data/lib/shopify_api/rest/resources/2022_04/customer.rb +9 -1
  17. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +5 -1
  18. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -3
  19. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +7 -0
  21. data/lib/shopify_api/rest/resources/2022_07/customer.rb +9 -1
  22. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +5 -1
  23. data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -3
  24. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +5 -3
  25. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +7 -0
  26. data/lib/shopify_api/rest/resources/2022_10/customer.rb +9 -1
  27. data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +5 -1
  28. data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -3
  29. data/lib/shopify_api/rest/resources/2022_10/metafield.rb +5 -3
  30. data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +190 -0
  31. data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +58 -0
  32. data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +105 -0
  33. data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +104 -0
  34. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +87 -0
  35. data/lib/shopify_api/rest/resources/2023_01/article.rb +265 -0
  36. data/lib/shopify_api/rest/resources/2023_01/asset.rb +118 -0
  37. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +86 -0
  38. data/lib/shopify_api/rest/resources/2023_01/balance.rb +50 -0
  39. data/lib/shopify_api/rest/resources/2023_01/blog.rb +162 -0
  40. data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +83 -0
  41. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +113 -0
  42. data/lib/shopify_api/rest/resources/2023_01/checkout.rb +209 -0
  43. data/lib/shopify_api/rest/resources/2023_01/collect.rb +142 -0
  44. data/lib/shopify_api/rest/resources/2023_01/collection.rb +110 -0
  45. data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +155 -0
  46. data/lib/shopify_api/rest/resources/2023_01/comment.rb +283 -0
  47. data/lib/shopify_api/rest/resources/2023_01/country.rb +137 -0
  48. data/lib/shopify_api/rest/resources/2023_01/currency.rb +57 -0
  49. data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +187 -0
  50. data/lib/shopify_api/rest/resources/2023_01/customer.rb +329 -0
  51. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +201 -0
  52. data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +169 -0
  53. data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +57 -0
  54. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +219 -0
  55. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +111 -0
  56. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +275 -0
  57. data/lib/shopify_api/rest/resources/2023_01/event.rb +148 -0
  58. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +225 -0
  59. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +166 -0
  60. data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +316 -0
  61. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +87 -0
  62. data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +130 -0
  63. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +215 -0
  64. data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +118 -0
  65. data/lib/shopify_api/rest/resources/2023_01/image.rb +157 -0
  66. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +108 -0
  67. data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +179 -0
  68. data/lib/shopify_api/rest/resources/2023_01/location.rb +167 -0
  69. data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +56 -0
  70. data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +209 -0
  71. data/lib/shopify_api/rest/resources/2023_01/metafield.rb +344 -0
  72. data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +110 -0
  73. data/lib/shopify_api/rest/resources/2023_01/order.rb +479 -0
  74. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +135 -0
  75. data/lib/shopify_api/rest/resources/2023_01/page.rb +194 -0
  76. data/lib/shopify_api/rest/resources/2023_01/payment.rb +140 -0
  77. data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +143 -0
  78. data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +107 -0
  79. data/lib/shopify_api/rest/resources/2023_01/payout.rb +97 -0
  80. data/lib/shopify_api/rest/resources/2023_01/policy.rb +69 -0
  81. data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +223 -0
  82. data/lib/shopify_api/rest/resources/2023_01/product.rb +223 -0
  83. data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +196 -0
  84. data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +88 -0
  85. data/lib/shopify_api/rest/resources/2023_01/province.rb +132 -0
  86. data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +167 -0
  87. data/lib/shopify_api/rest/resources/2023_01/redirect.rb +139 -0
  88. data/lib/shopify_api/rest/resources/2023_01/refund.rb +151 -0
  89. data/lib/shopify_api/rest/resources/2023_01/report.rb +121 -0
  90. data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +73 -0
  91. data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +155 -0
  92. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +83 -0
  93. data/lib/shopify_api/rest/resources/2023_01/shop.rb +221 -0
  94. data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +216 -0
  95. data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +87 -0
  96. data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +93 -0
  97. data/lib/shopify_api/rest/resources/2023_01/theme.rb +120 -0
  98. data/lib/shopify_api/rest/resources/2023_01/transaction.rb +181 -0
  99. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +97 -0
  100. data/lib/shopify_api/rest/resources/2023_01/user.rb +138 -0
  101. data/lib/shopify_api/rest/resources/2023_01/variant.rb +212 -0
  102. data/lib/shopify_api/rest/resources/2023_01/webhook.rb +168 -0
  103. data/lib/shopify_api/version.rb +1 -1
  104. metadata +78 -3
  105. data/.github/ISSUE_TEMPLATE.md +0 -35
@@ -0,0 +1,166 @@
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 FulfillmentEvent < 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
+ @address1 = T.let(nil, T.nilable(String))
20
+ @city = T.let(nil, T.nilable(String))
21
+ @country = T.let(nil, T.nilable(Country))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @estimated_delivery_at = T.let(nil, T.nilable(String))
24
+ @fulfillment_id = T.let(nil, T.nilable(Integer))
25
+ @happened_at = T.let(nil, T.nilable(String))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @latitude = T.let(nil, T.nilable(Float))
28
+ @longitude = T.let(nil, T.nilable(Float))
29
+ @message = T.let(nil, T.nilable(String))
30
+ @order_id = T.let(nil, T.nilable(Integer))
31
+ @province = T.let(nil, T.nilable(Province))
32
+ @shop_id = T.let(nil, T.nilable(Integer))
33
+ @status = 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({
39
+ country: Country,
40
+ province: Province
41
+ }, T::Hash[Symbol, Class])
42
+ @has_many = T.let({}, T::Hash[Symbol, Class])
43
+ @paths = T.let([
44
+ {http_method: :delete, operation: :delete, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
45
+ {http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"},
46
+ {http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
47
+ {http_method: :post, operation: :post, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"}
48
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
49
+
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :address1
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :city
54
+ sig { returns(T.nilable(Country)) }
55
+ attr_reader :country
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :created_at
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :estimated_delivery_at
60
+ sig { returns(T.nilable(Integer)) }
61
+ attr_reader :fulfillment_id
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :happened_at
64
+ sig { returns(T.nilable(Integer)) }
65
+ attr_reader :id
66
+ sig { returns(T.nilable(Float)) }
67
+ attr_reader :latitude
68
+ sig { returns(T.nilable(Float)) }
69
+ attr_reader :longitude
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :message
72
+ sig { returns(T.nilable(Integer)) }
73
+ attr_reader :order_id
74
+ sig { returns(T.nilable(Province)) }
75
+ attr_reader :province
76
+ sig { returns(T.nilable(Integer)) }
77
+ attr_reader :shop_id
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :status
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :updated_at
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :zip
84
+
85
+ class << self
86
+ sig do
87
+ returns(String)
88
+ end
89
+ def json_body_name()
90
+ "event"
91
+ end
92
+
93
+ sig do
94
+ params(
95
+ id: T.any(Integer, String),
96
+ order_id: T.nilable(T.any(Integer, String)),
97
+ fulfillment_id: T.nilable(T.any(Integer, String)),
98
+ event_id: T.untyped,
99
+ session: Auth::Session
100
+ ).returns(T.nilable(FulfillmentEvent))
101
+ end
102
+ def find(
103
+ id:,
104
+ order_id: nil,
105
+ fulfillment_id: nil,
106
+ event_id: nil,
107
+ session: ShopifyAPI::Context.active_session
108
+ )
109
+ result = base_find(
110
+ session: session,
111
+ ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
112
+ params: {event_id: event_id},
113
+ )
114
+ T.cast(result[0], T.nilable(FulfillmentEvent))
115
+ end
116
+
117
+ sig do
118
+ params(
119
+ id: T.any(Integer, String),
120
+ order_id: T.nilable(T.any(Integer, String)),
121
+ fulfillment_id: T.nilable(T.any(Integer, String)),
122
+ session: Auth::Session
123
+ ).returns(T.untyped)
124
+ end
125
+ def delete(
126
+ id:,
127
+ order_id: nil,
128
+ fulfillment_id: nil,
129
+ session: ShopifyAPI::Context.active_session
130
+ )
131
+ request(
132
+ http_method: :delete,
133
+ operation: :delete,
134
+ session: session,
135
+ ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
136
+ params: {},
137
+ )
138
+ end
139
+
140
+ sig do
141
+ params(
142
+ order_id: T.nilable(T.any(Integer, String)),
143
+ fulfillment_id: T.nilable(T.any(Integer, String)),
144
+ session: Auth::Session,
145
+ kwargs: T.untyped
146
+ ).returns(T::Array[FulfillmentEvent])
147
+ end
148
+ def all(
149
+ order_id: nil,
150
+ fulfillment_id: nil,
151
+ session: ShopifyAPI::Context.active_session,
152
+ **kwargs
153
+ )
154
+ response = base_find(
155
+ session: session,
156
+ ids: {order_id: order_id, fulfillment_id: fulfillment_id},
157
+ params: {}.merge(kwargs).compact,
158
+ )
159
+
160
+ T.cast(response, T::Array[FulfillmentEvent])
161
+ end
162
+
163
+ end
164
+
165
+ end
166
+ end
@@ -0,0 +1,316 @@
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 FulfillmentOrder < 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
+ @assigned_location = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
20
+ @assigned_location_id = T.let(nil, T.nilable(Integer))
21
+ @created_at = T.let(nil, T.nilable(String))
22
+ @delivery_method = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @destination = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
24
+ @fulfill_at = T.let(nil, T.nilable(String))
25
+ @fulfill_by = T.let(nil, T.nilable(String))
26
+ @fulfillment_holds = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @id = T.let(nil, T.nilable(Integer))
28
+ @international_duties = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
30
+ @merchant_requests = T.let(nil, T.nilable(T::Array[T.untyped]))
31
+ @order_id = T.let(nil, T.nilable(Integer))
32
+ @request_status = T.let(nil, T.nilable(String))
33
+ @shop_id = T.let(nil, T.nilable(Integer))
34
+ @status = T.let(nil, T.nilable(String))
35
+ @supported_actions = T.let(nil, T.nilable(T::Array[T.untyped]))
36
+ @updated_at = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
37
+ end
38
+
39
+ @has_one = T.let({}, T::Hash[Symbol, Class])
40
+ @has_many = T.let({}, T::Hash[Symbol, Class])
41
+ @paths = T.let([
42
+ {http_method: :get, operation: :get, ids: [:id], path: "fulfillment_orders/<id>.json"},
43
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillment_orders.json"},
44
+ {http_method: :post, operation: :cancel, ids: [:id], path: "fulfillment_orders/<id>/cancel.json"},
45
+ {http_method: :post, operation: :close, ids: [:id], path: "fulfillment_orders/<id>/close.json"},
46
+ {http_method: :post, operation: :hold, ids: [:id], path: "fulfillment_orders/<id>/hold.json"},
47
+ {http_method: :post, operation: :move, ids: [:id], path: "fulfillment_orders/<id>/move.json"},
48
+ {http_method: :post, operation: :open, ids: [:id], path: "fulfillment_orders/<id>/open.json"},
49
+ {http_method: :post, operation: :release_hold, ids: [:id], path: "fulfillment_orders/<id>/release_hold.json"},
50
+ {http_method: :post, operation: :reschedule, ids: [:id], path: "fulfillment_orders/<id>/reschedule.json"},
51
+ {http_method: :post, operation: :set_fulfillment_orders_deadline, ids: [], path: "fulfillment_orders/set_fulfillment_orders_deadline.json"}
52
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
53
+
54
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
55
+ attr_reader :assigned_location
56
+ sig { returns(T.nilable(Integer)) }
57
+ attr_reader :assigned_location_id
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :created_at
60
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
61
+ attr_reader :delivery_method
62
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
63
+ attr_reader :destination
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :fulfill_at
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :fulfill_by
68
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
69
+ attr_reader :fulfillment_holds
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_reader :id
72
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
73
+ attr_reader :international_duties
74
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
75
+ attr_reader :line_items
76
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
77
+ attr_reader :merchant_requests
78
+ sig { returns(T.nilable(Integer)) }
79
+ attr_reader :order_id
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :request_status
82
+ sig { returns(T.nilable(Integer)) }
83
+ attr_reader :shop_id
84
+ sig { returns(T.nilable(String)) }
85
+ attr_reader :status
86
+ sig { returns(T.nilable(T::Array[String])) }
87
+ attr_reader :supported_actions
88
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
89
+ attr_reader :updated_at
90
+
91
+ class << self
92
+ sig do
93
+ params(
94
+ id: T.any(Integer, String),
95
+ session: Auth::Session
96
+ ).returns(T.nilable(FulfillmentOrder))
97
+ end
98
+ def find(
99
+ id:,
100
+ session: ShopifyAPI::Context.active_session
101
+ )
102
+ result = base_find(
103
+ session: session,
104
+ ids: {id: id},
105
+ params: {},
106
+ )
107
+ T.cast(result[0], T.nilable(FulfillmentOrder))
108
+ end
109
+
110
+ sig do
111
+ params(
112
+ order_id: T.nilable(T.any(Integer, String)),
113
+ session: Auth::Session,
114
+ kwargs: T.untyped
115
+ ).returns(T::Array[FulfillmentOrder])
116
+ end
117
+ def all(
118
+ order_id: nil,
119
+ session: ShopifyAPI::Context.active_session,
120
+ **kwargs
121
+ )
122
+ response = base_find(
123
+ session: session,
124
+ ids: {order_id: order_id},
125
+ params: {}.merge(kwargs).compact,
126
+ )
127
+
128
+ T.cast(response, T::Array[FulfillmentOrder])
129
+ end
130
+
131
+ end
132
+
133
+ sig do
134
+ params(
135
+ body: T.untyped,
136
+ kwargs: T.untyped
137
+ ).returns(T.untyped)
138
+ end
139
+ def cancel(
140
+ body: nil,
141
+ **kwargs
142
+ )
143
+ self.class.request(
144
+ http_method: :post,
145
+ operation: :cancel,
146
+ session: @session,
147
+ ids: {id: @id},
148
+ params: {}.merge(kwargs).compact,
149
+ body: body,
150
+ entity: self,
151
+ )
152
+ end
153
+
154
+ sig do
155
+ params(
156
+ message: T.untyped,
157
+ body: T.untyped,
158
+ kwargs: T.untyped
159
+ ).returns(T.untyped)
160
+ end
161
+ def close(
162
+ message: nil,
163
+ body: nil,
164
+ **kwargs
165
+ )
166
+ self.class.request(
167
+ http_method: :post,
168
+ operation: :close,
169
+ session: @session,
170
+ ids: {id: @id},
171
+ params: {message: message}.merge(kwargs).compact,
172
+ body: body,
173
+ entity: self,
174
+ )
175
+ end
176
+
177
+ sig do
178
+ params(
179
+ reason: T.untyped,
180
+ reason_notes: T.untyped,
181
+ notify_merchant: T.untyped,
182
+ body: T.untyped,
183
+ kwargs: T.untyped
184
+ ).returns(T.untyped)
185
+ end
186
+ def hold(
187
+ reason: nil,
188
+ reason_notes: nil,
189
+ notify_merchant: nil,
190
+ body: nil,
191
+ **kwargs
192
+ )
193
+ self.class.request(
194
+ http_method: :post,
195
+ operation: :hold,
196
+ session: @session,
197
+ ids: {id: @id},
198
+ params: {reason: reason, reason_notes: reason_notes, notify_merchant: notify_merchant}.merge(kwargs).compact,
199
+ body: body,
200
+ entity: self,
201
+ )
202
+ end
203
+
204
+ sig do
205
+ params(
206
+ fulfillment_order: T.untyped,
207
+ body: T.untyped,
208
+ kwargs: T.untyped
209
+ ).returns(T.untyped)
210
+ end
211
+ def move(
212
+ fulfillment_order: nil,
213
+ body: nil,
214
+ **kwargs
215
+ )
216
+ self.class.request(
217
+ http_method: :post,
218
+ operation: :move,
219
+ session: @session,
220
+ ids: {id: @id},
221
+ params: {fulfillment_order: fulfillment_order}.merge(kwargs).compact,
222
+ body: body,
223
+ entity: self,
224
+ )
225
+ end
226
+
227
+ sig do
228
+ params(
229
+ body: T.untyped,
230
+ kwargs: T.untyped
231
+ ).returns(T.untyped)
232
+ end
233
+ def open(
234
+ body: nil,
235
+ **kwargs
236
+ )
237
+ self.class.request(
238
+ http_method: :post,
239
+ operation: :open,
240
+ session: @session,
241
+ ids: {id: @id},
242
+ params: {}.merge(kwargs).compact,
243
+ body: body,
244
+ entity: self,
245
+ )
246
+ end
247
+
248
+ sig do
249
+ params(
250
+ body: T.untyped,
251
+ kwargs: T.untyped
252
+ ).returns(T.untyped)
253
+ end
254
+ def release_hold(
255
+ body: nil,
256
+ **kwargs
257
+ )
258
+ self.class.request(
259
+ http_method: :post,
260
+ operation: :release_hold,
261
+ session: @session,
262
+ ids: {id: @id},
263
+ params: {}.merge(kwargs).compact,
264
+ body: body,
265
+ entity: self,
266
+ )
267
+ end
268
+
269
+ sig do
270
+ params(
271
+ body: T.untyped,
272
+ kwargs: T.untyped
273
+ ).returns(T.untyped)
274
+ end
275
+ def reschedule(
276
+ body: nil,
277
+ **kwargs
278
+ )
279
+ self.class.request(
280
+ http_method: :post,
281
+ operation: :reschedule,
282
+ session: @session,
283
+ ids: {id: @id},
284
+ params: {}.merge(kwargs).compact,
285
+ body: body,
286
+ entity: self,
287
+ )
288
+ end
289
+
290
+ sig do
291
+ params(
292
+ fulfillment_order_ids: T.untyped,
293
+ fulfillment_deadline: T.untyped,
294
+ body: T.untyped,
295
+ kwargs: T.untyped
296
+ ).returns(T.untyped)
297
+ end
298
+ def set_fulfillment_orders_deadline(
299
+ fulfillment_order_ids: nil,
300
+ fulfillment_deadline: nil,
301
+ body: nil,
302
+ **kwargs
303
+ )
304
+ self.class.request(
305
+ http_method: :post,
306
+ operation: :set_fulfillment_orders_deadline,
307
+ session: @session,
308
+ ids: {},
309
+ params: {fulfillment_order_ids: fulfillment_order_ids, fulfillment_deadline: fulfillment_deadline}.merge(kwargs).compact,
310
+ body: body,
311
+ entity: self,
312
+ )
313
+ end
314
+
315
+ end
316
+ end
@@ -0,0 +1,87 @@
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 FulfillmentRequest < 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
+ @fulfillment_order_id = T.let(nil, T.nilable(Integer))
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: :post, operation: :accept, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/accept.json"},
26
+ {http_method: :post, operation: :post, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request.json"},
27
+ {http_method: :post, operation: :reject, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/reject.json"}
28
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
29
+
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :fulfillment_order_id
32
+
33
+ class << self
34
+ end
35
+
36
+ sig do
37
+ params(
38
+ message: T.untyped,
39
+ body: T.untyped,
40
+ kwargs: T.untyped
41
+ ).returns(T.untyped)
42
+ end
43
+ def accept(
44
+ message: nil,
45
+ body: nil,
46
+ **kwargs
47
+ )
48
+ self.class.request(
49
+ http_method: :post,
50
+ operation: :accept,
51
+ session: @session,
52
+ ids: {fulfillment_order_id: @fulfillment_order_id},
53
+ params: {message: message}.merge(kwargs).compact,
54
+ body: body,
55
+ entity: self,
56
+ )
57
+ end
58
+
59
+ sig do
60
+ params(
61
+ message: T.untyped,
62
+ reason: T.untyped,
63
+ line_items: T.untyped,
64
+ body: T.untyped,
65
+ kwargs: T.untyped
66
+ ).returns(T.untyped)
67
+ end
68
+ def reject(
69
+ message: nil,
70
+ reason: nil,
71
+ line_items: nil,
72
+ body: nil,
73
+ **kwargs
74
+ )
75
+ self.class.request(
76
+ http_method: :post,
77
+ operation: :reject,
78
+ session: @session,
79
+ ids: {fulfillment_order_id: @fulfillment_order_id},
80
+ params: {message: message, reason: reason, line_items: line_items}.merge(kwargs).compact,
81
+ body: body,
82
+ entity: self,
83
+ )
84
+ end
85
+
86
+ end
87
+ end
@@ -0,0 +1,130 @@
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 FulfillmentService < 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
+ @admin_graphql_api_id = T.let(nil, T.nilable(String))
20
+ @callback_url = T.let(nil, T.nilable(String))
21
+ @fulfillment_orders_opt_in = T.let(nil, T.nilable(T::Boolean))
22
+ @handle = T.let(nil, T.nilable(String))
23
+ @id = T.let(nil, T.nilable(Integer))
24
+ @inventory_management = T.let(nil, T.nilable(T::Boolean))
25
+ @location_id = T.let(nil, T.nilable(Integer))
26
+ @name = T.let(nil, T.nilable(String))
27
+ @permits_sku_sharing = T.let(nil, T.nilable(T::Boolean))
28
+ @provider_id = T.let(nil, T.nilable(String))
29
+ @requires_shipping_method = T.let(nil, T.nilable(T::Boolean))
30
+ @tracking_support = T.let(nil, T.nilable(T::Boolean))
31
+ end
32
+
33
+ @has_one = T.let({}, T::Hash[Symbol, Class])
34
+ @has_many = T.let({}, T::Hash[Symbol, Class])
35
+ @paths = T.let([
36
+ {http_method: :delete, operation: :delete, ids: [:id], path: "fulfillment_services/<id>.json"},
37
+ {http_method: :get, operation: :get, ids: [], path: "fulfillment_services.json"},
38
+ {http_method: :get, operation: :get, ids: [:id], path: "fulfillment_services/<id>.json"},
39
+ {http_method: :post, operation: :post, ids: [], path: "fulfillment_services.json"},
40
+ {http_method: :put, operation: :put, ids: [:id], path: "fulfillment_services/<id>.json"}
41
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
42
+
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :admin_graphql_api_id
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :callback_url
47
+ sig { returns(T.nilable(T::Boolean)) }
48
+ attr_reader :fulfillment_orders_opt_in
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :handle
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :id
53
+ sig { returns(T.nilable(T::Boolean)) }
54
+ attr_reader :inventory_management
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :location_id
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :name
59
+ sig { returns(T.nilable(T::Boolean)) }
60
+ attr_reader :permits_sku_sharing
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :provider_id
63
+ sig { returns(T.nilable(T::Boolean)) }
64
+ attr_reader :requires_shipping_method
65
+ sig { returns(T.nilable(T::Boolean)) }
66
+ attr_reader :tracking_support
67
+
68
+ class << self
69
+ sig do
70
+ params(
71
+ id: T.any(Integer, String),
72
+ session: Auth::Session
73
+ ).returns(T.nilable(FulfillmentService))
74
+ end
75
+ def find(
76
+ id:,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ result = base_find(
80
+ session: session,
81
+ ids: {id: id},
82
+ params: {},
83
+ )
84
+ T.cast(result[0], T.nilable(FulfillmentService))
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ id: T.any(Integer, String),
90
+ session: Auth::Session
91
+ ).returns(T.untyped)
92
+ end
93
+ def delete(
94
+ id:,
95
+ session: ShopifyAPI::Context.active_session
96
+ )
97
+ request(
98
+ http_method: :delete,
99
+ operation: :delete,
100
+ session: session,
101
+ ids: {id: id},
102
+ params: {},
103
+ )
104
+ end
105
+
106
+ sig do
107
+ params(
108
+ scope: T.untyped,
109
+ session: Auth::Session,
110
+ kwargs: T.untyped
111
+ ).returns(T::Array[FulfillmentService])
112
+ end
113
+ def all(
114
+ scope: nil,
115
+ session: ShopifyAPI::Context.active_session,
116
+ **kwargs
117
+ )
118
+ response = base_find(
119
+ session: session,
120
+ ids: {},
121
+ params: {scope: scope}.merge(kwargs).compact,
122
+ )
123
+
124
+ T.cast(response, T::Array[FulfillmentService])
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+ end