Class: Zavudev::Models::MessageContent::Referral

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/zavudev/models/message_content.rb,
sig/zavudev/models/message_content.rbs

Overview

See Also:

  • Zavudev::Models::MessageContent#referral

Defined Under Namespace

Modules: MediaType, SourceType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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(body: nil, ctwa_clid: nil, headline: nil, image_url: nil, media_type: nil, source_id: nil, source_type: nil, source_url: nil, thumbnail_url: nil, video_url: nil) ⇒ Object

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

Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came from.

WhatsApp only. Present on the first inbound message of a conversation opened from a Meta ad or post, and on no message after it — so store it when it arrives rather than expecting it again. Organic conversations never carry it.

Field names are camelCased to match the rest of this API; Meta sends them as snake_case (ctwa_clid, source_id, ...). Fields that do not apply are omitted: a post source has no click id, and an image ad has no videoUrl.

Parameters:

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

    Body copy of the ad or post.

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

    Click-to-WhatsApp click identifier. This is the value Meta's Conversions API nee

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

    Headline of the ad or post.

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

    Image of the ad. Present when mediaType is image.

  • media_type (Symbol, Zavudev::Models::MessageContent::Referral::MediaType) (defaults to: nil) —

    Type of media on the ad, when it had any.

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

    Identifier of the ad or post that produced the click.

  • source_type (Symbol, Zavudev::Models::MessageContent::Referral::SourceType) (defaults to: nil) —

    Where the click came from.

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

    Meta permalink to the ad or post.

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

    Thumbnail of the ad media.

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

    Video of the ad. Present when mediaType is video.



# File 'lib/zavudev/models/message_content.rb', line 408

Instance Attribute Details

#body ⇒ String?

Body copy of the ad or post.

Parameters:

  • (String)

Returns:

  • (String, nil)


346
# File 'lib/zavudev/models/message_content.rb', line 346

optional :body, String

#ctwa_clid ⇒ String?

Click-to-WhatsApp click identifier. This is the value Meta's Conversions API needs to credit a conversion back to the ad that produced the conversation. Present on ad sources; a post source has none.

Parameters:

  • (String)

Returns:

  • (String, nil)


354
# File 'lib/zavudev/models/message_content.rb', line 354

optional :ctwa_clid, String, api_name: :ctwaClid

#headline ⇒ String?

Headline of the ad or post.

Parameters:

  • (String)

Returns:

  • (String, nil)


360
# File 'lib/zavudev/models/message_content.rb', line 360

optional :headline, String

#image_url ⇒ String?

Image of the ad. Present when mediaType is image.

Parameters:

  • (String)

Returns:

  • (String, nil)


366
# File 'lib/zavudev/models/message_content.rb', line 366

optional :image_url, String, api_name: :imageUrl

#media_type ⇒ Symbol, ...

Type of media on the ad, when it had any.



372
# File 'lib/zavudev/models/message_content.rb', line 372

optional :media_type, enum: -> { Zavudev::MessageContent::Referral::MediaType }, api_name: :mediaType

#source_id ⇒ String?

Identifier of the ad or post that produced the click.

Parameters:

  • (String)

Returns:

  • (String, nil)


378
# File 'lib/zavudev/models/message_content.rb', line 378

optional :source_id, String, api_name: :sourceId

#source_type ⇒ Symbol, ...

Where the click came from.



384
385
386
387
388
# File 'lib/zavudev/models/message_content.rb', line 384

optional :source_type,
enum: -> {
  Zavudev::MessageContent::Referral::SourceType
},
api_name: :sourceType

#source_url ⇒ String?

Meta permalink to the ad or post.

Parameters:

  • (String)

Returns:

  • (String, nil)


394
# File 'lib/zavudev/models/message_content.rb', line 394

optional :source_url, String, api_name: :sourceUrl

#thumbnail_url ⇒ String?

Thumbnail of the ad media.

Parameters:

  • (String)

Returns:

  • (String, nil)


400
# File 'lib/zavudev/models/message_content.rb', line 400

optional :thumbnail_url, String, api_name: :thumbnailUrl

#video_url ⇒ String?

Video of the ad. Present when mediaType is video.

Parameters:

  • (String)

Returns:

  • (String, nil)


406
# File 'lib/zavudev/models/message_content.rb', line 406

optional :video_url, String, api_name: :videoUrl

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/zavudev/models/message_content.rb', line 452

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


353
# File 'sig/zavudev/models/message_content.rbs', line 353

def to_hash: -> {