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



2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
# File 'lib/moderation_api/models/webhook_event.rb', line 2820

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

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


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

optional :entity_type, String

#maskString?

Returns:

  • (String, nil)


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

optional :mask, String, nil?: true

#matchString

The matched substring

Returns:

  • (String)


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

required :match, String

#probabilityFloat

Match confidence between 0 and 1

Returns:

  • (Float)


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

required :probability, Float

#reasonsArray<String>?

Returns:

  • (Array<String>, nil)


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

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

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



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

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

#spanArray<Object>

start, end

character offsets in the source text

Returns:



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

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