Class: ShopifyAPI::Fulfillment

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

Returns a new instance of Fulfillment.



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

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

  @created_at = T.let(nil, T.nilable(String))
  @id = T.let(nil, T.nilable(Integer))
  @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
  @location_id = T.let(nil, T.nilable(Integer))
  @name = T.let(nil, T.nilable(String))
  @notify_customer = T.let(nil, T.nilable(T::Boolean))
  @order_id = T.let(nil, T.nilable(Integer))
  @origin_address = T.let(nil, T.nilable(T::Array[T.untyped]))
  @receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @service = T.let(nil, T.nilable(String))
  @shipment_status = T.let(nil, T.nilable(String))
  @status = T.let(nil, T.nilable(String))
  @tracking_company = T.let(nil, T.nilable(String))
  @tracking_number = T.let(nil, T.nilable(String))
  @tracking_numbers = T.let(nil, T.nilable(T::Array[T.untyped]))
  @tracking_url = T.let(nil, T.nilable(String))
  @tracking_urls = T.let(nil, T.nilable(T::Array[T.untyped]))
  @updated_at = T.let(nil, T.nilable(String))
  @variant_inventory_management = 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

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



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

def line_items
  @line_items
end

#location_idObject (readonly)

Returns the value of attribute location_id.



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

def location_id
  @location_id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#notify_customerObject (readonly)

Returns the value of attribute notify_customer.



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

def notify_customer
  @notify_customer
end

#order_idObject (readonly)

Returns the value of attribute order_id.



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

def order_id
  @order_id
end

#origin_addressObject (readonly)

Returns the value of attribute origin_address.



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

def origin_address
  @origin_address
end

#receiptObject (readonly)

Returns the value of attribute receipt.



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

def receipt
  @receipt
end

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

#shipment_statusObject (readonly)

Returns the value of attribute shipment_status.



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

def shipment_status
  @shipment_status
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#tracking_companyObject (readonly)

Returns the value of attribute tracking_company.



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

def tracking_company
  @tracking_company
end

#tracking_numberObject (readonly)

Returns the value of attribute tracking_number.



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

def tracking_number
  @tracking_number
end

#tracking_numbersObject (readonly)

Returns the value of attribute tracking_numbers.



86
87
88
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 86

def tracking_numbers
  @tracking_numbers
end

#tracking_urlObject (readonly)

Returns the value of attribute tracking_url.



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

def tracking_url
  @tracking_url
end

#tracking_urlsObject (readonly)

Returns the value of attribute tracking_urls.



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

def tracking_urls
  @tracking_urls
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



92
93
94
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 92

def updated_at
  @updated_at
end

#variant_inventory_managementObject (readonly)

Returns the value of attribute variant_inventory_management.



94
95
96
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 94

def variant_inventory_management
  @variant_inventory_management
end

Class Method Details

.all(fulfillment_order_id: nil, order_id: nil, created_at_max: nil, created_at_min: nil, fields: nil, limit: nil, since_id: nil, updated_at_max: nil, updated_at_min: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 134

def all(
  fulfillment_order_id: nil,
  order_id: nil,
  created_at_max: nil,
  created_at_min: nil,
  fields: nil,
  limit: nil,
  since_id: nil,
  updated_at_max: nil,
  updated_at_min: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {fulfillment_order_id: fulfillment_order_id, order_id: order_id},
    params: {created_at_max: created_at_max, created_at_min: created_at_min, fields: fields, limit: limit, since_id: since_id, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
  )

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

.count(order_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 167

def count(
  order_id: nil,
  created_at_min: nil,
  created_at_max: nil,
  updated_at_min: nil,
  updated_at_max: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :count,
    session: session,
    ids: {order_id: order_id},
    params: {created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end

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



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

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

Instance Method Details

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



195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 195

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

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



216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 216

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

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



237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 237

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

#update_tracking(notify_customer: nil, tracking_info: nil, body: nil, **kwargs) ⇒ Object



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 260

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