Class: GetStream::Generated::Models::MatchedContent

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/matched_content.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ MatchedContent

Initialize with attributes



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 38

def initialize(attributes = {})
  super(attributes)
  @id = attributes.fetch(:id) { attributes.fetch('id', nil) }
  @published_at = attributes.fetch(:published_at) { attributes.fetch('published_at', nil) }
  @type = attributes.fetch(:type) { attributes.fetch('type', nil) }
  @confidence = attributes.fetch(:confidence) { attributes.fetch('confidence', nil) }
  @severity = attributes.fetch(:severity) { attributes.fetch('severity', nil) }
  @text = attributes.fetch(:text) { attributes.fetch('text', nil) }
  @classifications = attributes.fetch(:classifications) { attributes.fetch('classifications', nil) }
  @ocr_classifications = attributes.fetch(:ocr_classifications) { attributes.fetch('ocr_classifications', nil) }
end

Instance Attribute Details

#classifications ⇒ Array<Classification>

Returns Image-classification entries (keyframe rule, Type=image) carry nested L1 → L2 classifications. Text entries (closed_caption rule, Type=text) carry flat label + severity. Resolved against the app's effective taxonomy on the image side.

Returns:

  • (Array<Classification>) —

    Image-classification entries (keyframe rule, Type=image) carry nested L1 → L2 classifications. Text entries (closed_caption rule, Type=text) carry flat label + severity. Resolved against the app's effective taxonomy on the image side.



32
33
34
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 32

def classifications
  @classifications
end

#confidence ⇒ Float

Returns Image-classification entries only. Aggregate (max) confidence score across the entry's classifications + sub-classifications. Absent on text and OCR entries.

Returns:

  • (Float) —

    Image-classification entries only. Aggregate (max) confidence score across the entry's classifications + sub-classifications. Absent on text and OCR entries.



23
24
25
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 23

def confidence
  @confidence
end

#id ⇒ String

Returns The content_ids[label] value supplied on the /analyze request that contributed this entry.

Returns:

  • (String) —

    The content_ids[label] value supplied on the /analyze request that contributed this entry.



14
15
16
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 14

def id
  @id
end

#ocr_classifications ⇒ Array<Classification>

Returns OCR entries only (keyframe_ocr rule, Type=image). Bodyguard labels that fired against the keyframe's OCR-extracted text (e.g. INSULT, HATE_SPEECH). Distinct from classifications so consumers can route OCR matches separately from image-classification matches.

Returns:

  • (Array<Classification>) —

    OCR entries only (keyframe_ocr rule, Type=image). Bodyguard labels that fired against the keyframe's OCR-extracted text (e.g. INSULT, HATE_SPEECH). Distinct from classifications so consumers can route OCR matches separately from image-classification matches.



35
36
37
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 35

def ocr_classifications
  @ocr_classifications
end

#published_at ⇒ DateTime

Returns content_published_at from the contributing /analyze request, or server receive time when that field was omitted.

Returns:

  • (DateTime) —

    content_published_at from the contributing /analyze request, or server receive time when that field was omitted.



17
18
19
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 17

def published_at
  @published_at
end

#severity ⇒ String

Returns Text and OCR entries. Aggregate (max) Bodyguard severity level (LOW / MEDIUM / HIGH / CRITICAL). Absent on image-classification entries.

Returns:

  • (String) —

    Text and OCR entries. Aggregate (max) Bodyguard severity level (LOW / MEDIUM / HIGH / CRITICAL). Absent on image-classification entries.



26
27
28
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 26

def severity
  @severity
end

#text ⇒ String

Returns:

  • (String)


29
30
31
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 29

def text
  @text
end

#type ⇒ String

Returns Content type that contributed this entry: image or text.

Returns:

  • (String) —

    Content type that contributed this entry: image or text.



20
21
22
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 20

def type
  @type
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 51

def self.json_field_mappings
  {
    id: 'id',
    published_at: 'published_at',
    type: 'type',
    confidence: 'confidence',
    severity: 'severity',
    text: 'text',
    classifications: 'classifications',
    ocr_classifications: 'ocr_classifications'
  }
end