Class: Mailtrap::Webhook

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/webhook.rb

Overview

Data Transfer Object for Webhook

Instance Attribute Summary collapse

Instance Attribute Details

#activeBoolean (readonly)

Whether the webhook is active

Returns:

  • (Boolean)

    the current value of active



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def active
  @active
end

#domain_idInteger? (readonly)

The sending domain ID the webhook is scoped to, or nil for all domains. Applicable only for email_sending webhooks.

Returns:

  • (Integer, nil)

    the current value of domain_id



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def domain_id
  @domain_id
end

#event_typesArray<String> (readonly)

The event types the webhook is subscribed to. Applicable only for email_sending webhooks.

Returns:

  • (Array<String>)

    the current value of event_types



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def event_types
  @event_types
end

#idInteger (readonly)

The webhook ID

Returns:

  • (Integer)

    the current value of id



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def id
  @id
end

#inbound_inbox_idInteger? (readonly)

The inbound inbox ID the webhook is linked to. Applicable only for inbound_receiving webhooks.

Returns:

  • (Integer, nil)

    the current value of inbound_inbox_id



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def inbound_inbox_id
  @inbound_inbox_id
end

#payload_formatString (readonly)

The webhook payload format (json or jsonlines)

Returns:

  • (String)

    the current value of payload_format



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def payload_format
  @payload_format
end

#sending_streamString? (readonly)

The sending stream (transactional or bulk). Applicable only for email_sending webhooks.

Returns:

  • (String, nil)

    the current value of sending_stream



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def sending_stream
  @sending_stream
end

#signing_secretString? (readonly)

HMAC SHA-256 signing secret. Returned only on creation.

Returns:

  • (String, nil)

    the current value of signing_secret



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def signing_secret
  @signing_secret
end

#urlString (readonly)

The URL that will receive webhook payloads

Returns:

  • (String)

    the current value of url



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def url
  @url
end

#webhook_typeString (readonly)

The type of webhook (email_sending, campaigns, audit_log or inbound_receiving)

Returns:

  • (String)

    the current value of webhook_type



21
22
23
# File 'lib/mailtrap/webhook.rb', line 21

def webhook_type
  @webhook_type
end