Class: GetStream::Generated::Models::AnalyzeImageField

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

Initialize with attributes



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

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

Instance Attribute Details

#actionString

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

Returns:

  • (String)

    Per-image action: keep | flag | remove.



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

def action
  @action
end

#classificationsArray<Classification>

Returns Hierarchical list of L1 (parent) classifications. Each entry: ‘name`, `confidence` (0–1), and nested `subclassifications` (L2 leaves with their own confidence). Resolved against the app’s effective taxonomy (custom taxonomy when configured, otherwise the standard Bodyguard catalogue).

Returns:

  • (Array<Classification>)

    Hierarchical list of L1 (parent) classifications. Each entry: ‘name`, `confidence` (0–1), and nested `subclassifications` (L2 leaves with their own confidence). Resolved against the app’s effective taxonomy (custom taxonomy when configured, otherwise the standard Bodyguard catalogue).



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

def classifications
  @classifications
end

#confidenceFloat

Returns Highest confidence (0–1) across detected classifications + sub-classifications. Convenience aggregate over the nested values in ‘classifications`.

Returns:

  • (Float)

    Highest confidence (0–1) across detected classifications + sub-classifications. Convenience aggregate over the nested values in ‘classifications`.



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

def confidence
  @confidence
end

#errorString

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

Returns:

  • (String)

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



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

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.



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

def id
  @id
end

#ocr_classificationsArray<Classification>

Returns Flat list of Bodyguard OCR text-moderation labels on the image’s extracted text (e.g. VULGARITY, PII). Each entry: ‘name` + `severity`. Populated when BG’s OCR pipeline returned non-empty results for this image.

Returns:

  • (Array<Classification>)

    Flat list of Bodyguard OCR text-moderation labels on the image’s extracted text (e.g. VULGARITY, PII). Each entry: ‘name` + `severity`. Populated when BG’s OCR pipeline returned non-empty results for this image.



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

def ocr_classifications
  @ocr_classifications
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_image_field.rb', line 43

def self.json_field_mappings
  {
    action: 'action',
    confidence: 'confidence',
    error: 'error',
    id: 'id',
    classifications: 'classifications',
    ocr_classifications: 'ocr_classifications'
  }
end