Class: Smartsheet::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/smartsheet/endpoints/webhooks/webhooks.rb

Overview

Webhooks Endpoints

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Webhooks

Returns a new instance of Webhooks.



8
9
10
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#create(body:, params: {}, header_overrides: {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 12

def create(body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks'], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      body: body
  )
  client.make_request(endpoint_spec, request_spec)
end

#delete(webhook_id:, params: {}, header_overrides: {}) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 22

def delete(webhook_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['webhooks', :webhook_id])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      webhook_id: webhook_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#get(webhook_id:, params: {}, header_overrides: {}) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 32

def get(webhook_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks', :webhook_id])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      webhook_id: webhook_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#list(params: {}, header_overrides: {}) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 42

def list(params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks'])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides
  )
  client.make_request(endpoint_spec, request_spec)
end

#reset_shared_secret(webhook_id:, params: {}, header_overrides: {}) ⇒ Object



51
52
53
54
55
56
57
58
59
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 51

def reset_shared_secret(webhook_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks', :webhook_id, 'resetsharedsecret'])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      webhook_id: webhook_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#update(webhook_id:, body:, params: {}, header_overrides: {}) ⇒ Object



61
62
63
64
65
66
67
68
69
70
# File 'lib/smartsheet/endpoints/webhooks/webhooks.rb', line 61

def update(webhook_id:, body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['webhooks', :webhook_id], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      body: body,
      webhook_id: webhook_id
  )
  client.make_request(endpoint_spec, request_spec)
end