Class: ShopifyAPI::FulfillmentEvent

Inherits:
Rest::Base show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb,
lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb,
lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb,
lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb,
lib/shopify_api/rest/resources/2023_04/fulfillment_event.rb,
lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb,
lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb,
lib/shopify_api/rest/resources/2024_01/fulfillment_event.rb,
lib/shopify_api/rest/resources/2024_04/fulfillment_event.rb,
lib/shopify_api/rest/resources/2024_07/fulfillment_event.rb,
lib/shopify_api/rest/resources/2024_10/fulfillment_event.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

api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash

Constructor Details

#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ FulfillmentEvent

Returns a new instance of FulfillmentEvent.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 19

def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @address1 = T.let(nil, T.nilable(String))
  @city = T.let(nil, T.nilable(String))
  @country = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @estimated_delivery_at = T.let(nil, T.nilable(String))
  @fulfillment_id = T.let(nil, T.nilable(Integer))
  @happened_at = T.let(nil, T.nilable(String))
  @id = T.let(nil, T.nilable(Integer))
  @latitude = T.let(nil, T.nilable(Float))
  @longitude = T.let(nil, T.nilable(Float))
  @message = T.let(nil, T.nilable(String))
  @order_id = T.let(nil, T.nilable(Integer))
  @province = T.let(nil, T.nilable(String))
  @shop_id = T.let(nil, T.nilable(Integer))
  @status = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))
  @zip = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end

Dynamic Method Handling

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

Instance Attribute Details

#address1Object (readonly)

Returns the value of attribute address1.



52
53
54
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 52

def address1
  @address1
end

#cityObject (readonly)

Returns the value of attribute city.



54
55
56
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 54

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



56
57
58
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 56

def country
  @country
end

#created_atObject (readonly)

Returns the value of attribute created_at.



58
59
60
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 58

def created_at
  @created_at
end

#estimated_delivery_atObject (readonly)

Returns the value of attribute estimated_delivery_at.



60
61
62
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 60

def estimated_delivery_at
  @estimated_delivery_at
end

#fulfillment_idObject (readonly)

Returns the value of attribute fulfillment_id.



62
63
64
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 62

def fulfillment_id
  @fulfillment_id
end

#happened_atObject (readonly)

Returns the value of attribute happened_at.



64
65
66
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 64

def happened_at
  @happened_at
end

#idObject (readonly)

Returns the value of attribute id.



66
67
68
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 66

def id
  @id
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



68
69
70
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 68

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



70
71
72
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 70

def longitude
  @longitude
end

#messageObject (readonly)

Returns the value of attribute message.



72
73
74
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 72

def message
  @message
end

#order_idObject (readonly)

Returns the value of attribute order_id.



74
75
76
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 74

def order_id
  @order_id
end

#provinceObject (readonly)

Returns the value of attribute province.



76
77
78
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 76

def province
  @province
end

#shop_idObject (readonly)

Returns the value of attribute shop_id.



78
79
80
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 78

def shop_id
  @shop_id
end

#statusObject (readonly)

Returns the value of attribute status.



80
81
82
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 80

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



82
83
84
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 82

def updated_at
  @updated_at
end

#zipObject (readonly)

Returns the value of attribute zip.



84
85
86
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 84

def zip
  @zip
end

Class Method Details

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



149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 149

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

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

.delete(id:, order_id: nil, fulfillment_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 126

def delete(
  id:,
  order_id: nil,
  fulfillment_id: nil,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
    params: {},
  )
end

.find(id:, order_id: nil, fulfillment_id: nil, event_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 103

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

.json_body_nameObject



90
91
92
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb', line 90

def json_body_name()
  "event"
end