Class: EasyLabs::Resources::ProductPrices

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#archive(id) ⇒ Object



27
28
29
# File 'lib/easylabs/resources/product_prices.rb', line 27

def archive(id)
  request(:patch, "/product-prices/#{id}/archive")
end

#create(**body) ⇒ Object

Parameters:

  • body (Hash)

    expects a recurring or one-off price hash. See the JS SDK’s ‘CreatePrice` type for the union shape.



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

def create(**body)
  request(:post, "/product-prices", body: body)
end

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



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

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

#retrieve(id) ⇒ Object



13
14
15
# File 'lib/easylabs/resources/product_prices.rb', line 13

def retrieve(id)
  request(:get, "/product-prices/#{id}")
end

#update(id, **body) ⇒ Object



23
24
25
# File 'lib/easylabs/resources/product_prices.rb', line 23

def update(id, **body)
  request(:patch, "/product-prices/#{id}", body: body)
end