Class: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match

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

Defined Under Namespace

Classes: Signals

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(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil) ⇒ Object

Parameters:



5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
# File 'lib/moderation_api/models/webhook_event.rb', line 5418

class Match < ModerationAPI::Internal::Type::BaseModel
  # @!attribute match
  #   The matched substring
  #
  #   @return [String]
  required :match, String

  # @!attribute probability
  #   Match confidence between 0 and 1
  #
  #   @return [Float]
  required :probability, Float

  # @!attribute span
  #   [start, end] character offsets in the source text
  #
  #   @return [Array<Object>]
  required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown]

  # @!attribute entity_type
  #
  #   @return [String, nil]
  optional :entity_type, String

  # @!attribute mask
  #
  #   @return [String, nil]
  optional :mask, String, nil?: true

  # @!attribute reasons
  #
  #   @return [Array<String>, nil]
  optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String]

  # @!attribute scripts
  #
  #   @return [Array<String>, nil]
  optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String]

  # @!attribute signals
  #
  #   @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, nil]
  optional :signals,
           -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals }

  # @!attribute skeleton
  #
  #   @return [String, nil]
  optional :skeleton, String

  # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil)
  #   @param match [String] The matched substring
  #
  #   @param probability [Float] Match confidence between 0 and 1
  #
  #   @param span [Array<Object>] [start, end] character offsets in the source text
  #
  #   @param entity_type [String]
  #
  #   @param mask [String, nil]
  #
  #   @param reasons [Array<String>]
  #
  #   @param scripts [Array<String>]
  #
  #   @param signals [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals]
  #
  #   @param skeleton [String]

  # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match#signals
  class Signals < ModerationAPI::Internal::Type::BaseModel
    # @!attribute bot_protection
    #
    #   @return [Boolean, nil]
    required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!attribute brand_impersonation
    #
    #   @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil]
    required :brand_impersonation,
             -> {
               ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation
             },
             nil?: true

    # @!attribute domain_age_days
    #
    #   @return [Float, nil]
    required :domain_age_days, Float, nil?: true

    # @!attribute final_url
    #
    #   @return [String, nil]
    required :final_url, String, nil?: true

    # @!attribute has_email_setup
    #
    #   @return [Boolean, nil]
    required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true

    # @!attribute has_suspicious_characters
    #
    #   @return [Boolean]
    required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean

    # @!attribute is_link_shortener
    #
    #   @return [Boolean]
    required :is_link_shortener, ModerationAPI::Internal::Type::Boolean

    # @!attribute is_reported
    #
    #   @return [Boolean]
    required :is_reported, ModerationAPI::Internal::Type::Boolean

    # @!attribute redirect_count
    #
    #   @return [Float, nil]
    required :redirect_count, Float, nil?: true

    # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:)
    #   @param bot_protection [Boolean, nil]
    #   @param brand_impersonation [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil]
    #   @param domain_age_days [Float, nil]
    #   @param final_url [String, nil]
    #   @param has_email_setup [Boolean, nil]
    #   @param has_suspicious_characters [Boolean]
    #   @param is_link_shortener [Boolean]
    #   @param is_reported [Boolean]
    #   @param redirect_count [Float, nil]

    # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals#brand_impersonation
    class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel
      # @!attribute brand
      #
      #   @return [String]
      required :brand, String

      # @!attribute method_
      #
      #   @return [String]
      required :method_, String, api_name: :method

      # @!method initialize(brand:, method_:)
      #   @param brand [String]
      #   @param method_ [String]
    end
  end
end

Instance Attribute Details

#entity_typeString?

Parameters:

  • (String)

Returns:

  • (String, nil)


5440
# File 'lib/moderation_api/models/webhook_event.rb', line 5440

optional :entity_type, String

#maskString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


5445
# File 'lib/moderation_api/models/webhook_event.rb', line 5445

optional :mask, String, nil?: true

#matchString

The matched substring

Parameters:

  • value (String)

Returns:

  • (String)


5423
# File 'lib/moderation_api/models/webhook_event.rb', line 5423

required :match, String

#probabilityFloat

Match confidence between 0 and 1

Parameters:

  • value (Float)

Returns:

  • (Float)


5429
# File 'lib/moderation_api/models/webhook_event.rb', line 5429

required :probability, Float

#reasonsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


5450
# File 'lib/moderation_api/models/webhook_event.rb', line 5450

optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String]

#scriptsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


5455
# File 'lib/moderation_api/models/webhook_event.rb', line 5455

optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String]

#signalsModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals?



5460
5461
# File 'lib/moderation_api/models/webhook_event.rb', line 5460

optional :signals,
-> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals }

#skeletonString?

Parameters:

  • (String)

Returns:

  • (String, nil)


5466
# File 'lib/moderation_api/models/webhook_event.rb', line 5466

optional :skeleton, String

#spanArray<Object>

[start, end] character offsets in the source text

Parameters:

  • value (::Array[top])

Returns:



5435
# File 'lib/moderation_api/models/webhook_event.rb', line 5435

required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown]

Instance Method Details

#to_hash{

Returns:

  • ({)


4152
# File 'sig/moderation_api/models/webhook_event.rbs', line 4152

def to_hash: -> {