Class: ShopifyAPI::FulfillmentEvent

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


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 12

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.


47
48
49
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 47

def address1
  @address1
end

#cityObject (readonly)

Returns the value of attribute city.


49
50
51
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 49

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.


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

def country
  @country
end

#created_atObject (readonly)

Returns the value of attribute created_at.


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

def created_at
  @created_at
end

#estimated_delivery_atObject (readonly)

Returns the value of attribute estimated_delivery_at.


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

def estimated_delivery_at
  @estimated_delivery_at
end

#fulfillment_idObject (readonly)

Returns the value of attribute fulfillment_id.


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

def fulfillment_id
  @fulfillment_id
end

#happened_atObject (readonly)

Returns the value of attribute happened_at.


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

def happened_at
  @happened_at
end

#idObject (readonly)

Returns the value of attribute id.


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

def id
  @id
end

#latitudeObject (readonly)

Returns the value of attribute latitude.


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

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.


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

def longitude
  @longitude
end

#messageObject (readonly)

Returns the value of attribute message.


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

def message
  @message
end

#order_idObject (readonly)

Returns the value of attribute order_id.


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

def order_id
  @order_id
end

#provinceObject (readonly)

Returns the value of attribute province.


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

def province
  @province
end

#shop_idObject (readonly)

Returns the value of attribute shop_id.


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

def shop_id
  @shop_id
end

#statusObject (readonly)

Returns the value of attribute status.


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

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.


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

def updated_at
  @updated_at
end

#zipObject (readonly)

Returns the value of attribute zip.


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

def zip
  @zip
end

Class Method Details

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


144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 144

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


121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 121

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


98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 98

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


85
86
87
# File 'lib/shopify_api/rest/resources/2021_07/fulfillment_event.rb', line 85

def json_body_name()
  "event"
end