class GuestyAPI::Webhooks

Public Instance Methods

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

  check_response! response

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

  check_response! response

  true
end
list() click to toggle source
# File lib/guesty_api/webhooks.rb, line 5
def list
  response = @client.get url: '/webhooks'

  check_response! response

  response.parsed_response.map { |payload| entity_class.new payload }
end
retrieve(id:) click to toggle source
# File lib/guesty_api/webhooks.rb, line 13
def retrieve(id:)
  response = @client.get url: "/webhooks/#{id}"

  check_response! response

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

  check_response! response

  true
end

Private Instance Methods

entity_class() click to toggle source
# File lib/guesty_api/webhooks.rb, line 47
def entity_class
  Entities::Webhook
end