Class: XTwitterScraper::Models::EventDetail

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/x_twitter_scraper/models/event_detail.rb

Overview

Instance Attribute 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(id:, data:, monitor_id:, occurred_at:, type:, username:, x_event_id: nil) ⇒ Object

Full monitor event including payload data and optional X event ID.

Parameters:

  • id (String)
  • data (Hash{Symbol=>Object})

    Event payload — shape varies by event type (JSON)

  • monitor_id (String)
  • occurred_at (Time)
  • type (Symbol, XTwitterScraper::Models::EventType)

    Type of monitor event fired when account activity occurs.

  • username (String)
  • x_event_id (String) (defaults to: nil)


# File 'lib/x_twitter_scraper/models/event_detail.rb', line 44

Instance Attribute Details

#dataHash{Symbol=>Object}

Event payload — shape varies by event type (JSON)

Returns:

  • (Hash{Symbol=>Object})


16
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 16

required :data, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]

#idString

Returns:

  • (String)


10
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 10

required :id, String

#monitor_idString

Returns:

  • (String)


21
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 21

required :monitor_id, String, api_name: :monitorId

#occurred_atTime

Returns:

  • (Time)


26
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 26

required :occurred_at, Time, api_name: :occurredAt

#typeSymbol, XTwitterScraper::Models::EventType

Type of monitor event fired when account activity occurs.



32
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 32

required :type, enum: -> { XTwitterScraper::EventType }

#usernameString

Returns:

  • (String)


37
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 37

required :username, String

#x_event_idString?

Returns:

  • (String, nil)


42
# File 'lib/x_twitter_scraper/models/event_detail.rb', line 42

optional :x_event_id, String, api_name: :xEventId