class GuestyAPI::Listings

Public Instance Methods

create(params:) click to toggle source
# File lib/guesty_api/listings.rb, line 21
def create(params:)
  response = @client.post url: '/listings', data: params

  check_response! response

  single_entity response
end
list(params: {}) click to toggle source
# File lib/guesty_api/listings.rb, line 5
def list(params: {})
  response = @client.get url: '/listings', data: params

  check_response! response

  collection_entity response
end
retrieve(id:, fields: nil) click to toggle source
# File lib/guesty_api/listings.rb, line 13
def retrieve(id:, fields: nil)
  response = @client.get url: "/listings/#{id}", data: { fields: fields }

  check_response! response

  single_entity response
end
update(id:, params:) click to toggle source
# File lib/guesty_api/listings.rb, line 29
def update(id:, params:)
  response = @client.put url: "/listings/#{id}", data: params

  check_response! response

  single_entity response
end

Private Instance Methods

entity_class() click to toggle source
# File lib/guesty_api/listings.rb, line 39
def entity_class
  Entities::Listing
end