Class: ModerationAPI::Models::WebhookEvent::QueueItemAction::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:



4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
# File 'lib/moderation_api/models/webhook_event.rb', line 4312

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::QueueItemAction::Data::Object::Item::Label::Match::Signals, nil]
  optional :signals,
           -> { ModerationAPI::WebhookEvent::QueueItemAction::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::QueueItemAction::Data::Object::Item::Label::Match::Signals]
  #
  #   @param skeleton [String]

  # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::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::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil]
    required :brand_impersonation,
             -> {
               ModerationAPI::WebhookEvent::QueueItemAction::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::QueueItemAction::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::QueueItemAction::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)


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

optional :entity_type, String

#maskString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :mask, String, nil?: true

#matchString

The matched substring

Parameters:

  • value (String)

Returns:

  • (String)


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

required :match, String

#probabilityFloat

Match confidence between 0 and 1

Parameters:

  • value (Float)

Returns:

  • (Float)


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

required :probability, Float

#reasonsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


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

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

#scriptsArray<String>?

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


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

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

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



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

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

#skeletonString?

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :skeleton, String

#spanArray<Object>

[start, end] character offsets in the source text

Parameters:

  • value (::Array[top])

Returns:



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

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

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {