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



6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
# File 'lib/moderation_api/models/webhook_event.rb', line 6052

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::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, nil]
  optional :signals,
           -> { ModerationAPI::WebhookEvent::QueueItemAllowed::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::QueueItemAllowed::Data::Object::Item::Label::Match::Signals]

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


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

optional :entity_type, String

#maskString?

Returns:

  • (String, nil)


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

optional :mask, String, nil?: true

#matchString

The matched substring

Returns:

  • (String)


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

required :match, String

#probabilityFloat

Match confidence between 0 and 1

Returns:

  • (Float)


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

required :probability, Float

#reasonsArray<String>?

Returns:

  • (Array<String>, nil)


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

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

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



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

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

#spanArray<Object>

start, end

character offsets in the source text

Returns:



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

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