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

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

Returns a new instance of FulfillmentEvent.



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

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

  @address1 = T.let(nil, T.nilable(String))
  @city = T.let(nil, T.nilable(String))
  @country = T.let(nil, T.nilable(Country))
  @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(Province))
  @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))
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.



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

def address1
  @address1
end

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#estimated_delivery_atObject (readonly)

Returns the value of attribute estimated_delivery_at.



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

def estimated_delivery_at
  @estimated_delivery_at
end

#fulfillment_idObject (readonly)

Returns the value of attribute fulfillment_id.



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

def fulfillment_id
  @fulfillment_id
end

#happened_atObject (readonly)

Returns the value of attribute happened_at.



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

def happened_at
  @happened_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



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

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



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

def longitude
  @longitude
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#order_idObject (readonly)

Returns the value of attribute order_id.



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

def order_id
  @order_id
end

#provinceObject (readonly)

Returns the value of attribute province.



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

def province
  @province
end

#shop_idObject (readonly)

Returns the value of attribute shop_id.



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

def shop_id
  @shop_id
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#zipObject (readonly)

Returns the value of attribute zip.



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

def zip
  @zip
end

Class Method Details

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



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

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



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

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



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

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



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

def json_body_name()
  "event"
end