module ShopifyClient::API::Webhook

Public Instance Methods

create_webhook(attributes) click to toggle source
# File lib/shopify_client/api/webhook.rb, line 18
def create_webhook(attributes)
  response = post("webhooks.json", webhook: attributes)
  ShopifyClient::Webhook.from_response(response)
end
destroy_webhook(id_or_object) click to toggle source
# File lib/shopify_client/api/webhook.rb, line 23
def destroy_webhook(id_or_object)
  id = id_or_object.is_a?(ShopifyClient::Webhook) ? id_or_object.id : id_or_object
  delete("webhooks/#{id}.json")
  true
end
webhook(id, params = {}) click to toggle source
# File lib/shopify_client/api/webhook.rb, line 13
def webhook(id, params = {})
  response = get("webhooks/#{id}.json", params)
  ShopifyClient::Webhook.from_response(response)
end
webhooks(params = {}) click to toggle source
# File lib/shopify_client/api/webhook.rb, line 8
def webhooks(params = {})
  response = get("webhooks.json", params)
  ShopifyClient::Webhook.array_from_response(response)
end