Class: Trycourier::Models::SendMessageParams::Message
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Trycourier::Models::SendMessageParams::Message
- Defined in:
- lib/trycourier/models/send_message_params.rb
Defined Under Namespace
Modules: Content, To Classes: Channel, Delay, Expiry, Metadata, Preferences, Provider, Routing, Timeout
Instance Attribute Summary collapse
- #brand_id ⇒ String?
-
#channels ⇒ Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Channel}?
Define run-time configuration for channels.
-
#content ⇒ Trycourier::Models::ElementalContentSugar, ...
Describes content that will work for email, inbox, push, chat, or any channel id.
- #context ⇒ Trycourier::Models::MessageContext?
- #data ⇒ Hash{Symbol=>Object}?
- #delay ⇒ Trycourier::Models::SendMessageParams::Message::Delay?
- #expiry ⇒ Trycourier::Models::SendMessageParams::Message::Expiry?
- #metadata ⇒ Trycourier::Models::SendMessageParams::Message::Metadata?
- #preferences ⇒ Trycourier::Models::SendMessageParams::Message::Preferences?
- #providers ⇒ Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Provider}?
-
#routing ⇒ Trycourier::Models::SendMessageParams::Message::Routing?
Customize which channels/providers Courier may deliver the message through.
- #template ⇒ String?
- #timeout ⇒ Trycourier::Models::SendMessageParams::Message::Timeout?
-
#to ⇒ Trycourier::Models::UserRecipient, ...
The recipient or a list of recipients of the message.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(utm: nil) ⇒ Object constructor
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(utm: nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/trycourier/models/send_message_params.rb', line 25 class Message < Trycourier::Internal::Type::BaseModel # @!attribute brand_id # # @return [String, nil] optional :brand_id, String, nil?: true # @!attribute channels # Define run-time configuration for channels. Valid ChannelId's: email, sms, push, # inbox, direct_message, banner, webhook. # # @return [Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Channel}, nil] optional :channels, -> { Trycourier::Internal::Type::HashOf[Trycourier::SendMessageParams::Message::Channel] }, nil?: true # @!attribute content # Describes content that will work for email, inbox, push, chat, or any channel # id. # # @return [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent, nil] optional :content, union: -> { Trycourier::SendMessageParams::Message::Content } # @!attribute context # # @return [Trycourier::Models::MessageContext, nil] optional :context, -> { Trycourier::MessageContext }, nil?: true # @!attribute data # # @return [Hash{Symbol=>Object}, nil] optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true # @!attribute delay # # @return [Trycourier::Models::SendMessageParams::Message::Delay, nil] optional :delay, -> { Trycourier::SendMessageParams::Message::Delay }, nil?: true # @!attribute expiry # # @return [Trycourier::Models::SendMessageParams::Message::Expiry, nil] optional :expiry, -> { Trycourier::SendMessageParams::Message::Expiry }, nil?: true # @!attribute metadata # # @return [Trycourier::Models::SendMessageParams::Message::Metadata, nil] optional :metadata, -> { Trycourier::SendMessageParams::Message::Metadata }, nil?: true # @!attribute preferences # # @return [Trycourier::Models::SendMessageParams::Message::Preferences, nil] optional :preferences, -> { Trycourier::SendMessageParams::Message::Preferences }, nil?: true # @!attribute providers # # @return [Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Provider}, nil] optional :providers, -> { Trycourier::Internal::Type::HashOf[Trycourier::SendMessageParams::Message::Provider] }, nil?: true # @!attribute routing # Customize which channels/providers Courier may deliver the message through. # # @return [Trycourier::Models::SendMessageParams::Message::Routing, nil] optional :routing, -> { Trycourier::SendMessageParams::Message::Routing }, nil?: true # @!attribute template # # @return [String, nil] optional :template, String, nil?: true # @!attribute timeout # # @return [Trycourier::Models::SendMessageParams::Message::Timeout, nil] optional :timeout, -> { Trycourier::SendMessageParams::Message::Timeout }, nil?: true # @!attribute to # The recipient or a list of recipients of the message # # @return [Trycourier::Models::UserRecipient, Array<Trycourier::Models::Recipient>, nil] optional :to, union: -> { Trycourier::SendMessageParams::Message::To }, nil?: true # @!method initialize(brand_id: nil, channels: nil, content: nil, context: nil, data: nil, delay: nil, expiry: nil, metadata: nil, preferences: nil, providers: nil, routing: nil, template: nil, timeout: nil, to: nil) # Some parameter documentations has been truncated, see # {Trycourier::Models::SendMessageParams::Message} for more details. # # The message property has the following primary top-level properties. They define # the destination and content of the message. # # @param brand_id [String, nil] # # @param channels [Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Channel}, nil] Define run-time configuration for channels. Valid ChannelId's: email, sms, push, # # @param content [Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent] Describes content that will work for email, inbox, push, chat, or any channel id # # @param context [Trycourier::Models::MessageContext, nil] # # @param data [Hash{Symbol=>Object}, nil] # # @param delay [Trycourier::Models::SendMessageParams::Message::Delay, nil] # # @param expiry [Trycourier::Models::SendMessageParams::Message::Expiry, nil] # # @param metadata [Trycourier::Models::SendMessageParams::Message::Metadata, nil] # # @param preferences [Trycourier::Models::SendMessageParams::Message::Preferences, nil] # # @param providers [Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Provider}, nil] # # @param routing [Trycourier::Models::SendMessageParams::Message::Routing, nil] Customize which channels/providers Courier may deliver the message through. # # @param template [String, nil] # # @param timeout [Trycourier::Models::SendMessageParams::Message::Timeout, nil] # # @param to [Trycourier::Models::UserRecipient, Array<Trycourier::Models::Recipient>, nil] The recipient or a list of recipients of the message class Channel < Trycourier::Internal::Type::BaseModel # @!attribute brand_id # Brand id used for rendering. # # @return [String, nil] optional :brand_id, String, nil?: true # @!attribute if_ # JS conditional with access to data/profile. # # @return [String, nil] optional :if_, String, api_name: :if, nil?: true # @!attribute metadata # # @return [Trycourier::Models::SendMessageParams::Message::Channel::Metadata, nil] optional :metadata, -> { Trycourier::SendMessageParams::Message::Channel::Metadata }, nil?: true # @!attribute override # Channel specific overrides. # # @return [Hash{Symbol=>Object}, nil] optional :override, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true # @!attribute providers # Providers enabled for this channel. # # @return [Array<String>, nil] optional :providers, Trycourier::Internal::Type::ArrayOf[String], nil?: true # @!attribute routing_method # Defaults to `single`. # # @return [Symbol, Trycourier::Models::SendMessageParams::Message::Channel::RoutingMethod, nil] optional :routing_method, enum: -> { Trycourier::SendMessageParams::Message::Channel::RoutingMethod }, nil?: true # @!attribute timeouts # # @return [Trycourier::Models::SendMessageParams::Message::Channel::Timeouts, nil] optional :timeouts, -> { Trycourier::SendMessageParams::Message::Channel::Timeouts }, nil?: true # @!method initialize(brand_id: nil, if_: nil, metadata: nil, override: nil, providers: nil, routing_method: nil, timeouts: nil) # @param brand_id [String, nil] Brand id used for rendering. # # @param if_ [String, nil] JS conditional with access to data/profile. # # @param metadata [Trycourier::Models::SendMessageParams::Message::Channel::Metadata, nil] # # @param override [Hash{Symbol=>Object}, nil] Channel specific overrides. # # @param providers [Array<String>, nil] Providers enabled for this channel. # # @param routing_method [Symbol, Trycourier::Models::SendMessageParams::Message::Channel::RoutingMethod, nil] Defaults to `single`. # # @param timeouts [Trycourier::Models::SendMessageParams::Message::Channel::Timeouts, nil] # @see Trycourier::Models::SendMessageParams::Message::Channel#metadata class Metadata < Trycourier::Internal::Type::BaseModel # @!attribute utm # # @return [Trycourier::Models::Utm, nil] optional :utm, -> { Trycourier::Utm }, nil?: true # @!method initialize(utm: nil) # @param utm [Trycourier::Models::Utm, nil] end # Defaults to `single`. # # @see Trycourier::Models::SendMessageParams::Message::Channel#routing_method module RoutingMethod extend Trycourier::Internal::Type::Enum ALL = :all SINGLE = :single # @!method self.values # @return [Array<Symbol>] end # @see Trycourier::Models::SendMessageParams::Message::Channel#timeouts class Timeouts < Trycourier::Internal::Type::BaseModel # @!attribute channel # # @return [Integer, nil] optional :channel, Integer, nil?: true # @!attribute provider # # @return [Integer, nil] optional :provider, Integer, nil?: true # @!method initialize(channel: nil, provider: nil) # @param channel [Integer, nil] # @param provider [Integer, nil] end end # Describes content that will work for email, inbox, push, chat, or any channel # id. # # @see Trycourier::Models::SendMessageParams::Message#content module Content extend Trycourier::Internal::Type::Union # Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks. variant -> { Trycourier::ElementalContentSugar } variant -> { Trycourier::ElementalContent } # @!method self.variants # @return [Array(Trycourier::Models::ElementalContentSugar, Trycourier::Models::ElementalContent)] end # @see Trycourier::Models::SendMessageParams::Message#delay class Delay < Trycourier::Internal::Type::BaseModel # @!attribute duration # The duration of the delay in milliseconds. # # @return [Integer, nil] optional :duration, Integer, nil?: true # @!attribute until_ # ISO 8601 timestamp or opening_hours-like format. # # @return [String, nil] optional :until_, String, api_name: :until, nil?: true # @!method initialize(duration: nil, until_: nil) # @param duration [Integer, nil] The duration of the delay in milliseconds. # # @param until_ [String, nil] ISO 8601 timestamp or opening_hours-like format. end # @see Trycourier::Models::SendMessageParams::Message#expiry class Expiry < Trycourier::Internal::Type::BaseModel # @!attribute expires_in # Duration in ms or ISO8601 duration (e.g. P1DT4H). # # @return [String, Integer] required :expires_in, union: -> { Trycourier::SendMessageParams::Message::Expiry::ExpiresIn } # @!attribute expires_at # Epoch or ISO8601 timestamp with timezone. # # @return [String, nil] optional :expires_at, String, nil?: true # @!method initialize(expires_in:, expires_at: nil) # @param expires_in [String, Integer] Duration in ms or ISO8601 duration (e.g. P1DT4H). # # @param expires_at [String, nil] Epoch or ISO8601 timestamp with timezone. # Duration in ms or ISO8601 duration (e.g. P1DT4H). # # @see Trycourier::Models::SendMessageParams::Message::Expiry#expires_in module ExpiresIn extend Trycourier::Internal::Type::Union variant String variant Integer # @!method self.variants # @return [Array(String, Integer)] end end # @see Trycourier::Models::SendMessageParams::Message#metadata class Metadata < Trycourier::Internal::Type::BaseModel # @!attribute event # # @return [String, nil] optional :event, String, nil?: true # @!attribute tags # # @return [Array<String>, nil] optional :tags, Trycourier::Internal::Type::ArrayOf[String], nil?: true # @!attribute trace_id # # @return [String, nil] optional :trace_id, String, nil?: true # @!attribute utm # # @return [Trycourier::Models::Utm, nil] optional :utm, -> { Trycourier::Utm }, nil?: true # @!method initialize(event: nil, tags: nil, trace_id: nil, utm: nil) # @param event [String, nil] # @param tags [Array<String>, nil] # @param trace_id [String, nil] # @param utm [Trycourier::Models::Utm, nil] end # @see Trycourier::Models::SendMessageParams::Message#preferences class Preferences < Trycourier::Internal::Type::BaseModel # @!attribute subscription_topic_id # The subscription topic to apply to the message. # # @return [String] required :subscription_topic_id, String # @!method initialize(subscription_topic_id:) # @param subscription_topic_id [String] The subscription topic to apply to the message. end class Provider < Trycourier::Internal::Type::BaseModel # @!attribute if_ # JS conditional with access to data/profile. # # @return [String, nil] optional :if_, String, api_name: :if, nil?: true # @!attribute metadata # # @return [Trycourier::Models::SendMessageParams::Message::Provider::Metadata, nil] optional :metadata, -> { Trycourier::SendMessageParams::Message::Provider::Metadata }, nil?: true # @!attribute override # Provider-specific overrides. # # @return [Hash{Symbol=>Object}, nil] optional :override, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true # @!attribute timeouts # # @return [Integer, nil] optional :timeouts, Integer, nil?: true # @!method initialize(if_: nil, metadata: nil, override: nil, timeouts: nil) # @param if_ [String, nil] JS conditional with access to data/profile. # # @param metadata [Trycourier::Models::SendMessageParams::Message::Provider::Metadata, nil] # # @param override [Hash{Symbol=>Object}, nil] Provider-specific overrides. # # @param timeouts [Integer, nil] # @see Trycourier::Models::SendMessageParams::Message::Provider#metadata class Metadata < Trycourier::Internal::Type::BaseModel # @!attribute utm # # @return [Trycourier::Models::Utm, nil] optional :utm, -> { Trycourier::Utm }, nil?: true # @!method initialize(utm: nil) # @param utm [Trycourier::Models::Utm, nil] end end # @see Trycourier::Models::SendMessageParams::Message#routing class Routing < Trycourier::Internal::Type::BaseModel # @!attribute channels # A list of channels or providers (or nested routing rules). # # @return [Array<String, Trycourier::Models::MessageRouting>] required :channels, -> { Trycourier::Internal::Type::ArrayOf[union: Trycourier::MessageRoutingChannel] } # @!attribute method_ # # @return [Symbol, Trycourier::Models::SendMessageParams::Message::Routing::Method] required :method_, enum: -> { Trycourier::SendMessageParams::Message::Routing::Method }, api_name: :method # @!method initialize(channels:, method_:) # Customize which channels/providers Courier may deliver the message through. # # @param channels [Array<String, Trycourier::Models::MessageRouting>] A list of channels or providers (or nested routing rules). # # @param method_ [Symbol, Trycourier::Models::SendMessageParams::Message::Routing::Method] # @see Trycourier::Models::SendMessageParams::Message::Routing#method_ module Method extend Trycourier::Internal::Type::Enum ALL = :all SINGLE = :single # @!method self.values # @return [Array<Symbol>] end end # @see Trycourier::Models::SendMessageParams::Message#timeout class Timeout < Trycourier::Internal::Type::BaseModel # @!attribute channel # # @return [Hash{Symbol=>Integer}, nil] optional :channel, Trycourier::Internal::Type::HashOf[Integer], nil?: true # @!attribute criteria # # @return [Symbol, Trycourier::Models::SendMessageParams::Message::Timeout::Criteria, nil] optional :criteria, enum: -> { Trycourier::SendMessageParams::Message::Timeout::Criteria }, nil?: true # @!attribute escalation # # @return [Integer, nil] optional :escalation, Integer, nil?: true # @!attribute message # # @return [Integer, nil] optional :message, Integer, nil?: true # @!attribute provider # # @return [Hash{Symbol=>Integer}, nil] optional :provider, Trycourier::Internal::Type::HashOf[Integer], nil?: true # @!method initialize(channel: nil, criteria: nil, escalation: nil, message: nil, provider: nil) # @param channel [Hash{Symbol=>Integer}, nil] # @param criteria [Symbol, Trycourier::Models::SendMessageParams::Message::Timeout::Criteria, nil] # @param escalation [Integer, nil] # @param message [Integer, nil] # @param provider [Hash{Symbol=>Integer}, nil] # @see Trycourier::Models::SendMessageParams::Message::Timeout#criteria module Criteria extend Trycourier::Internal::Type::Enum NO_ESCALATION = :"no-escalation" DELIVERED = :delivered VIEWED = :viewed ENGAGED = :engaged # @!method self.values # @return [Array<Symbol>] end end # The recipient or a list of recipients of the message # # @see Trycourier::Models::SendMessageParams::Message#to module To extend Trycourier::Internal::Type::Union variant -> { Trycourier::UserRecipient } variant -> { Trycourier::Models::SendMessageParams::Message::To::RecipientArray } # @!method self.variants # @return [Array(Trycourier::Models::UserRecipient, Array<Trycourier::Models::Recipient>)] # @type [Trycourier::Internal::Type::Converter] RecipientArray = Trycourier::Internal::Type::ArrayOf[-> { Trycourier::Recipient }] end end |
Instance Attribute Details
#brand_id ⇒ String?
29 |
# File 'lib/trycourier/models/send_message_params.rb', line 29 optional :brand_id, String, nil?: true |
#channels ⇒ Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Channel}?
Define run-time configuration for channels. Valid ChannelId’s: email, sms, push, inbox, direct_message, banner, webhook.
36 37 38 |
# File 'lib/trycourier/models/send_message_params.rb', line 36 optional :channels, -> { Trycourier::Internal::Type::HashOf[Trycourier::SendMessageParams::Message::Channel] }, nil?: true |
#content ⇒ Trycourier::Models::ElementalContentSugar, ...
Describes content that will work for email, inbox, push, chat, or any channel id.
45 |
# File 'lib/trycourier/models/send_message_params.rb', line 45 optional :content, union: -> { Trycourier::SendMessageParams::Message::Content } |
#context ⇒ Trycourier::Models::MessageContext?
50 |
# File 'lib/trycourier/models/send_message_params.rb', line 50 optional :context, -> { Trycourier::MessageContext }, nil?: true |
#data ⇒ Hash{Symbol=>Object}?
55 |
# File 'lib/trycourier/models/send_message_params.rb', line 55 optional :data, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true |
#delay ⇒ Trycourier::Models::SendMessageParams::Message::Delay?
60 |
# File 'lib/trycourier/models/send_message_params.rb', line 60 optional :delay, -> { Trycourier::SendMessageParams::Message::Delay }, nil?: true |
#expiry ⇒ Trycourier::Models::SendMessageParams::Message::Expiry?
65 |
# File 'lib/trycourier/models/send_message_params.rb', line 65 optional :expiry, -> { Trycourier::SendMessageParams::Message::Expiry }, nil?: true |
#metadata ⇒ Trycourier::Models::SendMessageParams::Message::Metadata?
70 |
# File 'lib/trycourier/models/send_message_params.rb', line 70 optional :metadata, -> { Trycourier::SendMessageParams::Message::Metadata }, nil?: true |
#preferences ⇒ Trycourier::Models::SendMessageParams::Message::Preferences?
75 |
# File 'lib/trycourier/models/send_message_params.rb', line 75 optional :preferences, -> { Trycourier::SendMessageParams::Message::Preferences }, nil?: true |
#providers ⇒ Hash{Symbol=>Trycourier::Models::SendMessageParams::Message::Provider}?
80 81 82 |
# File 'lib/trycourier/models/send_message_params.rb', line 80 optional :providers, -> { Trycourier::Internal::Type::HashOf[Trycourier::SendMessageParams::Message::Provider] }, nil?: true |
#routing ⇒ Trycourier::Models::SendMessageParams::Message::Routing?
Customize which channels/providers Courier may deliver the message through.
88 |
# File 'lib/trycourier/models/send_message_params.rb', line 88 optional :routing, -> { Trycourier::SendMessageParams::Message::Routing }, nil?: true |
#template ⇒ String?
93 |
# File 'lib/trycourier/models/send_message_params.rb', line 93 optional :template, String, nil?: true |
#timeout ⇒ Trycourier::Models::SendMessageParams::Message::Timeout?
98 |
# File 'lib/trycourier/models/send_message_params.rb', line 98 optional :timeout, -> { Trycourier::SendMessageParams::Message::Timeout }, nil?: true |
#to ⇒ Trycourier::Models::UserRecipient, ...
The recipient or a list of recipients of the message
104 |
# File 'lib/trycourier/models/send_message_params.rb', line 104 optional :to, union: -> { Trycourier::SendMessageParams::Message::To }, nil?: true |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/trycourier/models/send_message_params.rb', line 431
|
.variants ⇒ Array(String, Integer)
|
|
# File 'lib/trycourier/models/send_message_params.rb', line 255
|