lib/pixela/client/webhook_methods.rb in pixela-0.5.2 vs lib/pixela/client/webhook_methods.rb in pixela-1.0.0
- old
+ new
@@ -2,11 +2,11 @@
# Create a new Webhook.
#
# @param graph_id [String]
# @param type [String]
#
- # @return [Hashie::Mash]
+ # @return [Pixela::Response]
#
# @raise [Pixela::PixelaError] API is failed
#
# @see https://docs.pixe.la/#/post-webhook
#
@@ -17,11 +17,11 @@
graphID: graph_id,
type: type,
}
with_error_handling do
- connection.post("users/#{username}/webhooks", params, user_token_headers).body
+ connection.post("users/#{username}/webhooks", params).body
end
end
# Get all predefined webhooks definitions.
#
@@ -33,45 +33,45 @@
#
# @example
# client.get_webhooks
def get_webhooks
with_error_handling do
- connection.get("users/#{username}/webhooks", nil, user_token_headers).body.webhooks
+ connection.get("users/#{username}/webhooks").body.webhooks
end
end
# Invoke the webhook registered in advance.
#
# @param webhook_hash [String]
#
- # @return [Hashie::Mash]
+ # @return [Pixela::Response]
#
# @raise [Pixela::PixelaError] API is failed
#
# @see https://docs.pixe.la/#/invoke-webhook
#
# @example
# client.invoke_webhook(webhook_hash: "<webhookHash>")
def invoke_webhook(webhook_hash:)
with_error_handling do
- connection.post("users/#{username}/webhooks/#{webhook_hash}", nil, default_headers).body
+ connection(default_headers).post("users/#{username}/webhooks/#{webhook_hash}").body
end
end
# Delete the registered Webhook.
#
# @param webhook_hash [String]
#
- # @return [Hashie::Mash]
+ # @return [Pixela::Response]
#
# @raise [Pixela::PixelaError] API is failed
#
# @see https://docs.pixe.la/#/delete-webhook
#
# @example
# client.delete_webhook(webhook_hash: "<webhookHash>")
def delete_webhook(webhook_hash:)
with_error_handling do
- connection.delete("users/#{username}/webhooks/#{webhook_hash}", nil, user_token_headers).body
+ connection.delete("users/#{username}/webhooks/#{webhook_hash}").body
end
end
end