Class: ShopifyAPI::FulfillmentRequest

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

Instance Attribute Summary collapse

Attributes inherited from Rest::Base

#errors, #original_state

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, #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) ⇒ FulfillmentRequest

Returns a new instance of FulfillmentRequest.


12
13
14
15
16
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_request.rb', line 12

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

  @fulfillment_order_id = T.let(nil, T.nilable(Integer))
end

Dynamic Method Handling

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

Instance Attribute Details

#fulfillment_order_idObject (readonly)

Returns the value of attribute fulfillment_order_id.


27
28
29
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_request.rb', line 27

def fulfillment_order_id
  @fulfillment_order_id
end

Instance Method Details

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


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_request.rb', line 39

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

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


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_request.rb', line 62

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