Class: GetStream::Generated::Models::AnalyzeTextField
- Defined in:
- lib/getstream_ruby/generated/models/analyze_text_field.rb
Instance Attribute Summary collapse
-
#action ⇒ String
Per-field action: keep | flag | remove.
-
#classifications ⇒ Array<Classification>
Flat list of detected Bodyguard text labels (e.g. INSULT, VULGARITY).
-
#detected_urls ⇒ Array<DetectedURLResponse>
URLs found in the text, as
{url, source}objects withsource=text. -
#error ⇒ String
Set when moderation couldn't be determined for this field — action is absent.
-
#id ⇒ String
Echo of
content_ids[label]when supplied on the request; omitted otherwise. -
#language ⇒ String
Detected language code.
-
#severity ⇒ String
Aggregate severity across the field: LOW | MEDIUM | HIGH | CRITICAL.
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AnalyzeTextField
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ AnalyzeTextField
Initialize with attributes
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 35 def initialize(attributes = {}) super(attributes) @action = attributes.fetch(:action) { attributes.fetch('action', nil) } @error = attributes.fetch(:error) { attributes.fetch('error', nil) } @id = attributes.fetch(:id) { attributes.fetch('id', nil) } @language = attributes.fetch(:language) { attributes.fetch('language', nil) } @severity = attributes.fetch(:severity) { attributes.fetch('severity', nil) } @classifications = attributes.fetch(:classifications) { attributes.fetch('classifications', nil) } @detected_urls = attributes.fetch(:detected_urls) { attributes.fetch('detected_urls', nil) } end |
Instance Attribute Details
#action ⇒ String
Returns Per-field action: keep | flag | remove.
14 15 16 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 14 def action @action end |
#classifications ⇒ Array<Classification>
Returns Flat list of detected Bodyguard text labels (e.g. INSULT, VULGARITY). Each entry carries name and severity.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 29 def classifications @classifications end |
#detected_urls ⇒ Array<DetectedURLResponse>
Returns URLs found in the text, as {url, source} objects with source = text. Independent of the action; omitted when none were found.
32 33 34 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 32 def detected_urls @detected_urls end |
#error ⇒ String
Returns Set when moderation couldn't be determined for this field — action is absent.
17 18 19 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 17 def error @error end |
#id ⇒ String
Returns Echo of content_ids[label] when supplied on the request; omitted otherwise.
20 21 22 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 20 def id @id end |
#language ⇒ String
Returns Detected language code.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 23 def language @language end |
#severity ⇒ String
Returns Aggregate severity across the field: LOW | MEDIUM | HIGH | CRITICAL.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 26 def severity @severity 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/analyze_text_field.rb', line 47 def self.json_field_mappings { action: 'action', error: 'error', id: 'id', language: 'language', severity: 'severity', classifications: 'classifications', detected_urls: 'detected_urls' } end |