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

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, signals: nil) ⇒ Object

Parameters:



4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
# File 'lib/moderation_api/models/webhook_event.rb', line 4085

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

  # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, signals: 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 signals [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals]

  # @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?

Returns:

  • (String, nil)


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

optional :entity_type, String

#maskString?

Returns:

  • (String, nil)


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

optional :mask, String, nil?: true

#matchString

The matched substring

Returns:

  • (String)


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

required :match, String

#probabilityFloat

Match confidence between 0 and 1

Returns:

  • (Float)


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

required :probability, Float

#reasonsArray<String>?

Returns:

  • (Array<String>, nil)


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

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

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



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

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

#spanArray<Object>

start, end

character offsets in the source text

Returns:



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

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