Class: XTwitterScraper::Models::Webhook

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

Overview

See Also:

  • XTwitterScraper::Resources::Webhooks#update

Defined Under Namespace

Modules: DeliveryStatus

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:, consecutive_failures:, created_at:, delivery_status:, event_types:, failure_hard_cap:, is_active:, url:) ⇒ Object

Some parameter documentations has been truncated, see XTwitterScraper::Models::Webhook for more details.

Webhook endpoint registered to receive event deliveries.

Parameters:

  • id (String)
  • consecutive_failures (Integer)

    Consecutive failed delivery attempts since the last success.

  • created_at (Time)
  • delivery_status (Symbol, XTwitterScraper::Models::Webhook::DeliveryStatus)

    Endpoint delivery state. needs_attention means delivery stopped after repeated f

  • event_types (Array<Symbol, XTwitterScraper::Models::EventType>)

    Array of event types to subscribe to.

  • failure_hard_cap (Integer)

    Consecutive delivery failures that pause the endpoint.

  • is_active (Boolean)
  • url (String)


# File 'lib/x_twitter_scraper/models/webhook.rb', line 56

Instance Attribute Details

#consecutive_failuresInteger

Consecutive failed delivery attempts since the last success.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :consecutive_failures, Integer, api_name: :consecutiveFailures

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time, api_name: :createdAt

#delivery_statusSymbol, XTwitterScraper::Models::Webhook::DeliveryStatus

Endpoint delivery state. needs_attention means delivery stopped after repeated failures.

Parameters:

  • value (XTwitterScraper::Models::Webhook::delivery_status)

Returns:



28
29
30
# File 'lib/x_twitter_scraper/models/webhook.rb', line 28

required :delivery_status,
enum: -> { XTwitterScraper::Webhook::DeliveryStatus },
api_name: :deliveryStatus

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

Array of event types to subscribe to.

Parameters:

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

Returns:



36
37
38
# File 'lib/x_twitter_scraper/models/webhook.rb', line 36

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

#failure_hard_capInteger

Consecutive delivery failures that pause the endpoint.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :failure_hard_cap, Integer, api_name: :failureHardCap

#idString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#is_activeBoolean

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


49
# File 'lib/x_twitter_scraper/models/webhook.rb', line 49

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

#urlString

Parameters:

  • value (String)

Returns:

  • (String)


54
# File 'lib/x_twitter_scraper/models/webhook.rb', line 54

required :url, String

Instance Method Details

#to_hash{

Returns:

  • ({)


43
# File 'sig/x_twitter_scraper/models/webhook.rbs', line 43

def to_hash: -> {