Class: Zavudev::Models::SenderCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/zavudev/models/sender_create_params.rb,
sig/zavudev/models/sender_create_params.rbs

Overview

See Also:

  • Zavudev::Resources::Senders#create

Defined Under Namespace

Modules: WebhookSignatureVersion

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(name:, email_address: nil, email_domain_id: nil, email_from_name: nil, email_receiving_enabled: nil, enable_sms_oneway: nil, enable_voice: nil, phone_number: nil, set_as_default: nil, webhook_events: nil, webhook_signature_version: nil, webhook_url: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Zavudev::Models::SenderCreateParams for more details.

Parameters:

  • name (String)
  • email_address (String) (defaults to: nil)

    From-address for the email channel (e.g. noreply@yourdomain.com). The address's

  • email_domain_id (String) (defaults to: nil)

    ID of the verified email domain to attach. Optional — resolved from `emailAddres

  • email_from_name (String) (defaults to: nil)

    Display name shown in the recipient's inbox for the email channel.

  • email_receiving_enabled (Boolean) (defaults to: nil)

    Enable inbound email receiving on this sender. Requires a verified MX record on

  • enable_sms_oneway (Boolean) (defaults to: nil)

    Enable the one-way SMS channel (sms_oneway). Needs nothing else — no phone num

  • enable_voice (Boolean) (defaults to: nil)

    Let this sender place and answer phone calls. Requires phoneNumber; enabling i

  • phone_number (String) (defaults to: nil)

    Phone number in E.164 format, and it must be a number your project already owns

  • set_as_default (Boolean) (defaults to: nil)
  • webhook_events (Array<Symbol, Zavudev::Models::WebhookEvent>) (defaults to: nil)

    Events to subscribe to.

  • webhook_signature_version (Symbol, Zavudev::Models::SenderCreateParams::WebhookSignatureVersion) (defaults to: nil)

    Which X-Zavu-Signature scheme this receiver is sent.

  • webhook_url (String) (defaults to: nil)

    HTTPS URL for webhook events.

  • request_options (Zavudev::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/zavudev/models/sender_create_params.rb', line 108

Instance Attribute Details

#email_addressString?

From-address for the email channel (e.g. noreply@yourdomain.com). The address's domain must be a verified email domain in your project. Setting this attaches the email channel to the sender.

Parameters:

  • (String)

Returns:

  • (String, nil)


21
# File 'lib/zavudev/models/sender_create_params.rb', line 21

optional :email_address, String, api_name: :emailAddress

#email_domain_idString?

ID of the verified email domain to attach. Optional — resolved from emailAddress's domain when omitted.

Parameters:

  • (String)

Returns:

  • (String, nil)


28
# File 'lib/zavudev/models/sender_create_params.rb', line 28

optional :email_domain_id, String, api_name: :emailDomainId

#email_from_nameString?

Display name shown in the recipient's inbox for the email channel.

Parameters:

  • (String)

Returns:

  • (String, nil)


34
# File 'lib/zavudev/models/sender_create_params.rb', line 34

optional :email_from_name, String, api_name: :emailFromName

#email_receiving_enabledBoolean?

Enable inbound email receiving on this sender. Requires a verified MX record on the domain; ignored otherwise.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


41
# File 'lib/zavudev/models/sender_create_params.rb', line 41

optional :email_receiving_enabled, Zavudev::Internal::Type::Boolean, api_name: :emailReceivingEnabled

#enable_sms_onewayBoolean?

Enable the one-way SMS channel (sms_oneway). Needs nothing else — no phone number, no credential — so it is the fastest way to get a sender that can send. Recipients cannot reply. Confirm with sms_oneway in the channels array on the response.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


50
# File 'lib/zavudev/models/sender_create_params.rb', line 50

optional :enable_sms_oneway, Zavudev::Internal::Type::Boolean, api_name: :enableSmsOneway

#enable_voiceBoolean?

Let this sender place and answer phone calls. Requires phoneNumber; enabling it without one returns 400. Check the channels array on the response to confirm voice is on.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


58
# File 'lib/zavudev/models/sender_create_params.rb', line 58

optional :enable_voice, Zavudev::Internal::Type::Boolean, api_name: :enableVoice

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/zavudev/models/sender_create_params.rb', line 13

required :name, String

#phone_numberString?

Phone number in E.164 format, and it must be a number your project already owns (see GET /v1/phone-numbers). The number is routed to the sender as part of this call, which is what turns the SMS channel on. Passing a number the project does not own, or one already attached to another sender, returns 400 rather than creating a sender that cannot send. Omit for an email-only sender.

Parameters:

  • (String)

Returns:

  • (String, nil)


68
# File 'lib/zavudev/models/sender_create_params.rb', line 68

optional :phone_number, String, api_name: :phoneNumber

#set_as_defaultBoolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


73
# File 'lib/zavudev/models/sender_create_params.rb', line 73

optional :set_as_default, Zavudev::Internal::Type::Boolean, api_name: :setAsDefault

#webhook_eventsArray<Symbol, Zavudev::Models::WebhookEvent>?

Events to subscribe to.

Returns:



79
80
81
# File 'lib/zavudev/models/sender_create_params.rb', line 79

optional :webhook_events,
-> { Zavudev::Internal::Type::ArrayOf[enum: Zavudev::WebhookEvent] },
api_name: :webhookEvents

#webhook_signature_versionSymbol, ...

Which X-Zavu-Signature scheme this receiver is sent.

  • v1: v1=HMAC_SHA256(secret, body). The scheme used before this was configurable. Existing webhooks stay on it until you move them.
  • v2: v2=HMAC_SHA256(secret, "{t}.{body}"). The current scheme, and the default for new senders. It signs the timestamp together with the body.
  • v1+v2: both signatures, sharing one t. The migration setting: a receiver reading either one works, so you can deploy and confirm your new verifier before switching over.

Moving from v1 straight to v2 returns 400. Set v1+v2 first. See https://docs.zavu.dev/guides/receiving-messages/signature-migration



98
99
100
# File 'lib/zavudev/models/sender_create_params.rb', line 98

optional :webhook_signature_version,
enum: -> { Zavudev::SenderCreateParams::WebhookSignatureVersion },
api_name: :webhookSignatureVersion

#webhook_urlString?

HTTPS URL for webhook events.

Parameters:

  • (String)

Returns:

  • (String, nil)


106
# File 'lib/zavudev/models/sender_create_params.rb', line 106

optional :webhook_url, String, api_name: :webhookUrl

Instance Method Details

#to_hash{

Returns:

  • ({)


90
# File 'sig/zavudev/models/sender_create_params.rbs', line 90

def to_hash: -> {