Sha256: 13bb893f4daaf17224d83128d4c93c4ac1ca77ecf2707f4f76d1685c89dcec42
Contents?: true
Size: 1.39 KB
Versions: 4
Compression:
Stored size: 1.39 KB
Contents
# frozen_string_literal: true require "hashie" module ShipEngine module Domain class Webhooks def initialize @client = ShipEngine::Client.new end def list_webhooks(params: {}) response = @client.get( path: ShipEngine::Constants::PATHS.v1.webhooks.root, options: params ) response.body.map { |webhook| Hashie::Mash.new(webhook) } end def create_webhook(params: {}) response = @client.post( path: ShipEngine::Constants::PATHS.v1.webhooks.root, options: params ) Hashie::Mash.new(response.body) end def webhook_by_id(webhook_id:, params: {}) response = @client.get( path: "#{ShipEngine::Constants::PATHS.v1.webhooks.root}/#{webhook_id}", options: params ) Hashie::Mash.new(response.body) end def update_webhook_by_id(webhook_id:, params: {}) response = @client.put( path: "#{ShipEngine::Constants::PATHS.v1.webhooks.root}/#{webhook_id}", options: params ) Hashie::Mash.new(response.body) end def delete_webhook_by_id(webhook_id:, params: {}) response = @client.delete( path: "#{ShipEngine::Constants::PATHS.v1.webhooks.root}/#{webhook_id}", options: params ) Hashie::Mash.new(response.body) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems