Class: EasyLabs::Resources::Orders

Inherits:
Base
  • Object
show all
Defined in:
lib/easylabs/resources/orders.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from EasyLabs::Resources::Base

Instance Method Details

#list(limit: nil, offset: nil, ids: nil) ⇒ Object



8
9
10
# File 'lib/easylabs/resources/orders.rb', line 8

def list(limit: nil, offset: nil, ids: nil)
  request(:get, "/orders", query: pagination_query(limit: limit, offset: offset, ids: ids))
end

#retrieve(id) ⇒ Object



12
13
14
# File 'lib/easylabs/resources/orders.rb', line 12

def retrieve(id)
  request(:get, "/orders/#{id}")
end

#update_tags(id, tags:) ⇒ Object

PATCH /orders/:id with ‘{ tags }` body. The legacy /orders/:id/tags suffix the older JS SDK used returns 404 on the current API — the suffix has been dropped here.



19
20
21
# File 'lib/easylabs/resources/orders.rb', line 19

def update_tags(id, tags:)
  request(:patch, "/orders/#{id}", body: { tags: tags })
end