Class: GetStream::Generated::Models::AnalyzeTextField

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/analyze_text_field.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 = {}) ⇒ AnalyzeTextField

Initialize with attributes



32
33
34
35
36
37
38
39
40
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 32

def initialize(attributes = {})
  super(attributes)
  @action = attributes[:action] || attributes['action'] || nil
  @error = attributes[:error] || attributes['error'] || nil
  @id = attributes[:id] || attributes['id'] || nil
  @language = attributes[:language] || attributes['language'] || nil
  @severity = attributes[:severity] || attributes['severity'] || nil
  @classifications = attributes[:classifications] || attributes['classifications'] || nil
end

Instance Attribute Details

#actionString

Returns Per-field action: keep | flag | remove.

Returns:

  • (String)

    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

#classificationsArray<Classification>

Returns Flat list of detected Bodyguard text labels (e.g. INSULT, VULGARITY). Each entry carries ‘name` and `severity`.

Returns:

  • (Array<Classification>)

    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

#errorString

Returns Set when moderation couldn’t be determined for this field — action is absent.

Returns:

  • (String)

    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

#idString

Returns Echo of ‘content_ids` when supplied on the request; omitted otherwise.

Returns:

  • (String)

    Echo of ‘content_ids` 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

#languageString

Returns Detected language code.

Returns:

  • (String)

    Detected language code.



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

def language
  @language
end

#severityString

Returns Aggregate severity across the field: LOW | MEDIUM | HIGH | CRITICAL.

Returns:

  • (String)

    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_mappingsObject

Override field mappings for JSON serialization



43
44
45
46
47
48
49
50
51
52
# File 'lib/getstream_ruby/generated/models/analyze_text_field.rb', line 43

def self.json_field_mappings
  {
    action: 'action',
    error: 'error',
    id: 'id',
    language: 'language',
    severity: 'severity',
    classifications: 'classifications'
  }
end