class GuestyAPI::Guests

Public Instance Methods

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

  check_response! response

  single_entity response
end
delete(id:) click to toggle source
# File lib/guesty_api/guests.rb, line 39
def delete(id:)
  response = @client.delete url: "/guests/#{id}"

  check_response! response

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

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

  check_response! response

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

  check_response! response

  single_entity response
end

Private Instance Methods

entity_class() click to toggle source
# File lib/guesty_api/guests.rb, line 49
def entity_class
  Entities::Guest
end