Class: ShopifyAPI::FulfillmentOrder

Inherits:
Rest::Base show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb,
lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb,
lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb,
lib/shopify_api/rest/resources/2023_04/fulfillment_order.rb

Instance Attribute Summary collapse

Attributes inherited from Rest::Base

#errors, #original_state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rest::Base

base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, json_body_name, json_response_body_name, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, #save, #save!, #to_hash

Constructor Details

#initialize(session: ShopifyAPI::Context.active_session) ⇒ FulfillmentOrder

Returns a new instance of FulfillmentOrder.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 16

def initialize(session: ShopifyAPI::Context.active_session)
  super(session: session)

  @assigned_location = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @assigned_location_id = T.let(nil, T.nilable(Integer))
  @delivery_method = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @destination = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @fulfill_at = T.let(nil, T.nilable(String))
  @fulfill_by = T.let(nil, T.nilable(String))
  @fulfillment_holds = T.let(nil, T.nilable(T::Array[T.untyped]))
  @id = T.let(nil, T.nilable(Integer))
  @international_duties = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
  @merchant_requests = T.let(nil, T.nilable(T::Array[T.untyped]))
  @order_id = T.let(nil, T.nilable(Integer))
  @request_status = T.let(nil, T.nilable(String))
  @shop_id = T.let(nil, T.nilable(Integer))
  @status = T.let(nil, T.nilable(String))
  @supported_actions = T.let(nil, T.nilable(T::Array[T.untyped]))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base

Instance Attribute Details

#assigned_locationObject (readonly)

Returns the value of attribute assigned_location.



53
54
55
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 53

def assigned_location
  @assigned_location
end

#assigned_location_idObject (readonly)

Returns the value of attribute assigned_location_id.



55
56
57
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 55

def assigned_location_id
  @assigned_location_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



59
60
61
# File 'lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb', line 59

def created_at
  @created_at
end

#delivery_methodObject (readonly)

Returns the value of attribute delivery_method.



57
58
59
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 57

def delivery_method
  @delivery_method
end

#destinationObject (readonly)

Returns the value of attribute destination.



59
60
61
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 59

def destination
  @destination
end

#fulfill_atObject (readonly)

Returns the value of attribute fulfill_at.



61
62
63
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 61

def fulfill_at
  @fulfill_at
end

#fulfill_byObject (readonly)

Returns the value of attribute fulfill_by.



63
64
65
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 63

def fulfill_by
  @fulfill_by
end

#fulfillment_holdsObject (readonly)

Returns the value of attribute fulfillment_holds.



65
66
67
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 65

def fulfillment_holds
  @fulfillment_holds
end

#idObject (readonly)

Returns the value of attribute id.



67
68
69
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 67

def id
  @id
end

#international_dutiesObject (readonly)

Returns the value of attribute international_duties.



69
70
71
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 69

def international_duties
  @international_duties
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



71
72
73
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 71

def line_items
  @line_items
end

#merchant_requestsObject (readonly)

Returns the value of attribute merchant_requests.



73
74
75
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 73

def merchant_requests
  @merchant_requests
end

#order_idObject (readonly)

Returns the value of attribute order_id.



75
76
77
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 75

def order_id
  @order_id
end

#request_statusObject (readonly)

Returns the value of attribute request_status.



77
78
79
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 77

def request_status
  @request_status
end

#shop_idObject (readonly)

Returns the value of attribute shop_id.



79
80
81
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 79

def shop_id
  @shop_id
end

#statusObject (readonly)

Returns the value of attribute status.



81
82
83
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 81

def status
  @status
end

#supported_actionsObject (readonly)

Returns the value of attribute supported_actions.



83
84
85
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 83

def supported_actions
  @supported_actions
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



89
90
91
# File 'lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb', line 89

def updated_at
  @updated_at
end

Class Method Details

.all(order_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 111

def all(
  order_id: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {order_id: order_id},
    params: {}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[FulfillmentOrder])
end

.find(id:, session: ShopifyAPI::Context.active_session) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 92

def find(
  id:,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id},
    params: {},
  )
  T.cast(result[0], T.nilable(FulfillmentOrder))
end

Instance Method Details

#cancel(body: nil, **kwargs) ⇒ Object



133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 133

def cancel(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :cancel,
    session: @session,
    ids: {id: @id},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#close(message: nil, body: nil, **kwargs) ⇒ Object



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 155

def close(
  message: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :close,
    session: @session,
    ids: {id: @id},
    params: {message: message}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#hold(fulfillment_hold: nil, body: nil, **kwargs) ⇒ Object



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 180

def hold(
  reason: nil,
  reason_notes: nil,
  notify_merchant: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :hold,
    session: @session,
    ids: {id: @id},
    params: {reason: reason, reason_notes: reason_notes, notify_merchant: notify_merchant}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#move(fulfillment_order: nil, body: nil, **kwargs) ⇒ Object



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 205

def move(
  fulfillment_order: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :move,
    session: @session,
    ids: {id: @id},
    params: {fulfillment_order: fulfillment_order}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#open(body: nil, **kwargs) ⇒ Object



227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 227

def open(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :open,
    session: @session,
    ids: {id: @id},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#release_hold(body: nil, **kwargs) ⇒ Object



248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 248

def release_hold(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :release_hold,
    session: @session,
    ids: {id: @id},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#reschedule(body: nil, **kwargs) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 269

def reschedule(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :reschedule,
    session: @session,
    ids: {id: @id},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end

#set_fulfillment_orders_deadline(fulfillment_order_ids: nil, fulfillment_deadline: nil, body: nil, **kwargs) ⇒ Object



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb', line 292

def set_fulfillment_orders_deadline(
  fulfillment_order_ids: nil,
  fulfillment_deadline: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :set_fulfillment_orders_deadline,
    session: @session,
    ids: {},
    params: {fulfillment_order_ids: fulfillment_order_ids, fulfillment_deadline: fulfillment_deadline}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end