Class: PhraseApp::RequestParams::WebhookParams

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/phraseapp-ruby.rb

Overview

WebhookParams

Parameters:

active

Whether webhook is active or inactive

callback_url

Callback URL to send requests to

description

Webhook description

events

List of event names to trigger the webhook (separated by comma)

Instance Method Summary collapse

Instance Method Details

#active=(val) ⇒ Object



1774
1775
1776
1777
1778
1779
1780
1781
1782
# File 'lib/phraseapp-ruby.rb', line 1774

def active=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#callback_url=(val) ⇒ Object



1784
1785
1786
# File 'lib/phraseapp-ruby.rb', line 1784

def callback_url=(val)
  super(val)
end

#description=(val) ⇒ Object



1788
1789
1790
# File 'lib/phraseapp-ruby.rb', line 1788

def description=(val)
  super(val)
end

#events=(val) ⇒ Object



1792
1793
1794
# File 'lib/phraseapp-ruby.rb', line 1792

def events=(val)
  super(val)
end

#validateObject



1796
1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/phraseapp-ruby.rb', line 1796

def validate
  
  if callback_url == nil || callback_url == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"callback_url\" of \"WebhookParams\" not set")
  end
  if events == nil || events == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"events\" of \"WebhookParams\" not set")
  end
end