Method: Wavefront::Validators#wf_webhook_id?

Defined in:
lib/wavefront-sdk/validators.rb

#wf_webhook_id?(id) ⇒ Boolean

Ensure the given argument is a valid webhook ID.

Parameters:

Returns:

  • (Boolean)

    true if valid

Raises:

  • Wavefront::Exceptions::InvalidWebhook if not valid



431
432
433
434
435
# File 'lib/wavefront-sdk/validators.rb', line 431

def wf_webhook_id?(id)
  return true if id.is_a?(String) && id =~ /^[a-zA-Z0-9]{16}$/

  raise Wavefront::Exception::InvalidWebhookId, id
end