Class: ShipHero::Services::WebhookService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/ship_hero/services/webhook_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#api_key

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from ShipHero::Services::BaseService

Instance Method Details

#get_webhooksObject



10
11
12
# File 'lib/ship_hero/services/webhook_service.rb', line 10

def get_webhooks()
  get(Util::Config.get('endpoints.get_webhooks'), nil, ShipHero::Responses::GetWebhooks)
end

#register_webhook(request) ⇒ Object



14
15
16
17
# File 'lib/ship_hero/services/webhook_service.rb', line 14

def register_webhook(request)
  raise Exceptions::ServiceException, "Must be a ShipHero::Webhook" unless request.is_a?(ShipHero::Webhook)
  post(Util::Config.get('endpoints.register_webhook'), request)
end

#unregister_webhook(request) ⇒ Object



19
20
21
22
# File 'lib/ship_hero/services/webhook_service.rb', line 19

def unregister_webhook(request)
  raise Exceptions::ServiceException, "Must be a ShipHero::Webhook" unless request.is_a?(ShipHero::Webhook)
  post(Util::Config.get('endpoints.unregister_webhook'), request)
end