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,
lib/shopify_api/rest/resources/2023_10/fulfillment.rb,
lib/shopify_api/rest/resources/2024_01/fulfillment.rb,
lib/shopify_api/rest/resources/2024_04/fulfillment.rb,
lib/shopify_api/rest/resources/2024_07/fulfillment.rb,
lib/shopify_api/rest/resources/2024_10/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

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_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?, retry_request_after, #save, #save!, #to_hash

Constructor Details

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

Returns a new instance of Fulfillment.



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

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

  @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))

  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

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#line_itemsObject (readonly)

Returns the value of attribute line_items.



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

def line_items
  @line_items
end

#location_idObject (readonly)

Returns the value of attribute location_id.



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

def location_id
  @location_id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#notify_customerObject (readonly)

Returns the value of attribute notify_customer.



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

def notify_customer
  @notify_customer
end

#order_idObject (readonly)

Returns the value of attribute order_id.



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

def order_id
  @order_id
end

#origin_addressObject (readonly)

Returns the value of attribute origin_address.



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

def origin_address
  @origin_address
end

#receiptObject (readonly)

Returns the value of attribute receipt.



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

def receipt
  @receipt
end

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

#shipment_statusObject (readonly)

Returns the value of attribute shipment_status.



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

def shipment_status
  @shipment_status
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#tracking_companyObject (readonly)

Returns the value of attribute tracking_company.



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

def tracking_company
  @tracking_company
end

#tracking_numberObject (readonly)

Returns the value of attribute tracking_number.



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

def tracking_number
  @tracking_number
end

#tracking_numbersObject (readonly)

Returns the value of attribute tracking_numbers.



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

def tracking_numbers
  @tracking_numbers
end

#tracking_urlObject (readonly)

Returns the value of attribute tracking_url.



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

def tracking_url
  @tracking_url
end

#tracking_urlsObject (readonly)

Returns the value of attribute tracking_urls.



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

def tracking_urls
  @tracking_urls
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#variant_inventory_managementObject (readonly)

Returns the value of attribute variant_inventory_management.



98
99
100
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 98

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



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

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



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 171

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



109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 109

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



199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 199

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



220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 220

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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 241

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



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/shopify_api/rest/resources/2022_04/fulfillment.rb', line 264

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