Class: Courier::Models::ProviderCreateParams

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

Overview

See Also:

  • Courier::Resources::Providers#create

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(provider:, alias_: nil, settings: nil, title: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {}) ⇒ ProviderCreateParams

Some parameter documentations has been truncated, see Courier::Models::ProviderCreateParams for more details.

Parameters:

  • provider (String) —

    The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a kno

  • alias_ (String) (defaults to: nil) —

    Optional alias for this configuration.

  • settings (Hash{Symbol=>Object}) (defaults to: nil) —

    Provider-specific settings (snake_case keys). Defaults to an empty object when o

  • title (String) (defaults to: nil) —

    Optional display title. Omit to use "Default Configuration".

  • idempotency_key (String) (defaults to: nil)
  • x_idempotency_expiration (String) (defaults to: nil)
  • request_options (Courier::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})
  • provider: (String)
  • alias_: (String) (defaults to: nil)
  • settings: (::Hash[Symbol, top]) (defaults to: nil)
  • title: (String) (defaults to: nil)
  • idempotency_key: (String) (defaults to: nil)
  • x_idempotency_expiration: (String) (defaults to: nil)
  • request_options: (Courier::request_opts) (defaults to: {})


# File 'lib/courier/models/provider_create_params.rb', line 57

Instance Attribute Details

#alias_ ⇒ String?

Optional alias for this configuration.

Parameters:

  • (String)

Returns:

  • (String, nil)


21
# File 'lib/courier/models/provider_create_params.rb', line 21

optional :alias_, String, api_name: :alias

#idempotency_key ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


50
# File 'lib/courier/models/provider_create_params.rb', line 50

optional :idempotency_key, String

#provider ⇒ String

The provider key identifying the type (e.g. "sendgrid", "twilio"). Must be a known Courier provider — see the catalog endpoint for valid keys.

Parameters:

  • value (String)

Returns:

  • (String)


15
# File 'lib/courier/models/provider_create_params.rb', line 15

required :provider, String

#settings ⇒ Hash{Symbol=>Object}?

Provider-specific settings (snake_case keys). Defaults to an empty object when omitted. Use the catalog endpoint to discover required fields for a given provider — omitting a required field returns a 400 validation error. Set rate_limit to cap this configuration's send rate: { "rate": <number greater than 0>, "period": "second" | "minute" | "hour" }, e.g. { "rate": 0.5, "period": "minute" } for one send every 2 minutes. The interval between sends (period divided by rate) must be from 1 millisecond to 12 hours, otherwise the request returns a 400 InvalidRateLimit error. The limit applies per configuration and per environment (a test-environment configuration has its own limit). Sends above the rate are queued, not dropped, and changes take up to 60 seconds to apply. It has no effect on observability or CDP integrations, which do not send messages. Omit it or set it to null for no limit.

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


39
# File 'lib/courier/models/provider_create_params.rb', line 39

optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]

#title ⇒ String?

Optional display title. Omit to use "Default Configuration".

Parameters:

  • (String)

Returns:

  • (String, nil)


45
# File 'lib/courier/models/provider_create_params.rb', line 45

optional :title, String

#x_idempotency_expiration ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


55
# File 'lib/courier/models/provider_create_params.rb', line 55

optional :x_idempotency_expiration, String

Instance Method Details

#to_hash ⇒ { provider: String, alias_: String, settings: ::Hash[Symbol, top], title: String, idempotency_key: String, x_idempotency_expiration: String, request_options: Courier::RequestOptions }

Returns:

  • ({ provider: String, alias_: String, settings: ::Hash[Symbol, top], title: String, idempotency_key: String, x_idempotency_expiration: String, request_options: Courier::RequestOptions })


50
51
52
53
54
55
56
57
58
# File 'sig/courier/models/provider_create_params.rbs', line 50

def to_hash: -> {
  provider: String,
  alias_: String,
  settings: ::Hash[Symbol, top],
  title: String,
  idempotency_key: String,
  x_idempotency_expiration: String,
  request_options: Courier::RequestOptions
}