Class: XTwitterScraper::Models::Monitor

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

Overview

See Also:

  • XTwitterScraper::Resources::Monitors#retrieve

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:, created_at:, event_types:, is_active:, username:, x_user_id:) ⇒ Object

Account monitor that tracks activity for a given X user.

Parameters:

  • id (String)
  • created_at (Time)
  • event_types (Array<Symbol, XTwitterScraper::Models::EventType>)

    Array of event types to subscribe to.

  • is_active (Boolean)
  • username (String)
  • x_user_id (String)


# File 'lib/x_twitter_scraper/models/monitor.rb', line 40

Instance Attribute Details

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


15
# File 'lib/x_twitter_scraper/models/monitor.rb', line 15

required :created_at, Time, api_name: :createdAt

#event_typesArray<Symbol, XTwitterScraper::Models::EventType>

Array of event types to subscribe to.

Parameters:

  • value (::Array[XTwitterScraper::Models::event_type])

Returns:



21
22
23
# File 'lib/x_twitter_scraper/models/monitor.rb', line 21

required :event_types,
-> { XTwitterScraper::Internal::Type::ArrayOf[enum: XTwitterScraper::EventType] },
api_name: :eventTypes

#idString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#is_activeBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


28
# File 'lib/x_twitter_scraper/models/monitor.rb', line 28

required :is_active, XTwitterScraper::Internal::Type::Boolean, api_name: :isActive

#usernameString

Parameters:

  • value (String)

Returns:

  • (String)


33
# File 'lib/x_twitter_scraper/models/monitor.rb', line 33

required :username, String

#x_user_idString

Parameters:

  • value (String)

Returns:

  • (String)


38
# File 'lib/x_twitter_scraper/models/monitor.rb', line 38

required :x_user_id, String, api_name: :xUserId

Instance Method Details

#to_hash{

Returns:

  • ({)


35
# File 'sig/x_twitter_scraper/models/monitor.rbs', line 35

def to_hash: -> {