Class: PhraseApp::RequestParams::WebhookParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::WebhookParams
- 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
- #active=(val) ⇒ Object
- #callback_url=(val) ⇒ Object
- #description=(val) ⇒ Object
- #events=(val) ⇒ Object
- #validate ⇒ Object
Instance Method Details
#active=(val) ⇒ Object
1264 1265 1266 1267 1268 1269 1270 1271 1272 |
# File 'lib/phraseapp-ruby.rb', line 1264 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
1274 1275 1276 |
# File 'lib/phraseapp-ruby.rb', line 1274 def callback_url=(val) super(val) end |
#description=(val) ⇒ Object
1278 1279 1280 |
# File 'lib/phraseapp-ruby.rb', line 1278 def description=(val) super(val) end |
#events=(val) ⇒ Object
1282 1283 1284 |
# File 'lib/phraseapp-ruby.rb', line 1282 def events=(val) super(val) end |
#validate ⇒ Object
1286 1287 1288 1289 1290 1291 1292 1293 1294 |
# File 'lib/phraseapp-ruby.rb', line 1286 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 |