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



35
36
37
38
39
40
41
42
43
44
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 35

def initialize(attributes = {})
  super(attributes)
  @id = attributes[:id] || attributes['id']
  @published_at = attributes[:published_at] || attributes['published_at']
  @type = attributes[:type] || attributes['type']
  @confidence = attributes[:confidence] || attributes['confidence'] || nil
  @severity = attributes[:severity] || attributes['severity'] || nil
  @classifications = attributes[:classifications] || attributes['classifications'] || nil
  @ocr_classifications = attributes[:ocr_classifications] || attributes['ocr_classifications'] || nil
end

Instance Attribute Details

#classificationsArray<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.



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

def classifications
  @classifications
end

#confidenceFloat

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

#idString

Returns The ‘content_ids` value supplied on the `/analyze` request that contributed this entry.

Returns:

  • (String)

    The ‘content_ids` 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_classificationsArray<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.



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

def ocr_classifications
  @ocr_classifications
end

#published_atDateTime

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

#severityString

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

#typeString

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_mappingsObject

Override field mappings for JSON serialization



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 47

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