Class: GetStream::Generated::Models::MatchedContent
- Defined in:
- lib/getstream_ruby/generated/models/matched_content.rb
Instance Attribute Summary collapse
-
#classifications ⇒ Array<Classification>
Image-classification entries (keyframe rule, Type=image) carry nested L1 → L2 classifications.
-
#confidence ⇒ Float
Image-classification entries only.
-
#id ⇒ String
The ‘content_ids` value supplied on the `/analyze` request that contributed this entry.
-
#ocr_classifications ⇒ Array<Classification>
OCR entries only (keyframe_ocr rule, Type=image).
-
#published_at ⇒ DateTime
‘content_published_at` from the contributing `/analyze` request, or server receive time when that field was omitted.
-
#severity ⇒ String
Text and OCR entries.
-
#type ⇒ String
Content type that contributed this entry: ‘image` or `text`.
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ MatchedContent
constructor
Initialize with attributes.
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
#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.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 29 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.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 23 def confidence @confidence end |
#id ⇒ String
Returns 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_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.
32 33 34 |
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 32 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.
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.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/matched_content.rb', line 26 def severity @severity end |
#type ⇒ String
Returns 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
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 |