Class: GetStream::Generated::Models::AnalyzeRequest

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

Initialize with attributes



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 54

def initialize(attributes = {})
  super(attributes)
  @async_response = attributes.fetch(:async_response) { attributes.fetch('async_response', nil) }
  @config_key = attributes.fetch(:config_key) { attributes.fetch('config_key', nil) }
  @content_published_at = attributes.fetch(:content_published_at) { attributes.fetch('content_published_at', nil) }
  @country_code = attributes.fetch(:country_code) { attributes.fetch('country_code', nil) }
  @entity_creator_id = attributes.fetch(:entity_creator_id) { attributes.fetch('entity_creator_id', nil) }
  @entity_id = attributes.fetch(:entity_id) { attributes.fetch('entity_id', nil) }
  @entity_type = attributes.fetch(:entity_type) { attributes.fetch('entity_type', nil) }
  @user_id = attributes.fetch(:user_id) { attributes.fetch('user_id', nil) }
  @country_codes = attributes.fetch(:country_codes) { attributes.fetch('country_codes', nil) }
  @content_ids = attributes.fetch(:content_ids) { attributes.fetch('content_ids', nil) }
  @custom = attributes.fetch(:custom) { attributes.fetch('custom', nil) }
  @texts = attributes.fetch(:texts) { attributes.fetch('texts', nil) }
  @user = attributes.fetch(:user) { attributes.fetch('user', nil) }
end

Instance Attribute Details

#async_response ⇒ Boolean

Returns When true, the response carries no verdicts (status pending) and per-modality results arrive via moderation.text_analysis.complete and moderation.image_analysis.complete webhooks. Image moderation runs on a background worker; text moderation runs synchronously and is then delivered via webhook.

Returns:

  • (Boolean) —

    When true, the response carries no verdicts (status pending) and per-modality results arrive via moderation.text_analysis.complete and moderation.image_analysis.complete webhooks. Image moderation runs on a background worker; text moderation runs synchronously and is then delivered via webhook.



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

def async_response
  @async_response
end

#config_key ⇒ String

Returns Moderation policy key. Optional in stateful mode, required in stateless mode.

Returns:

  • (String) —

    Moderation policy key. Optional in stateful mode, required in stateless mode.



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

def config_key
  @config_key
end

#content_ids ⇒ Hash<String, String>

Returns Optional map from a content label (either a texts key or an image:<key> multipart label) to a caller-supplied per-instance identifier. Echoed on per-field verdicts and surfaced in matched_contents when an aggregation rule fires.

Returns:

  • (Hash<String, String>) —

    Optional map from a content label (either a texts key or an image:<key> multipart label) to a caller-supplied per-instance identifier. Echoed on per-field verdicts and surfaced in matched_contents when an aggregation rule fires.



42
43
44
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 42

def content_ids
  @content_ids
end

#content_published_at ⇒ DateTime

Returns Original timestamp when the content was produced. Used as the published_at timestamp on per-content log entries that surface in matched_contents on aggregation-rule webhooks.

Returns:

  • (DateTime) —

    Original timestamp when the content was produced. Used as the published_at timestamp on per-content log entries that surface in matched_contents on aggregation-rule webhooks.



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

def 
  @content_published_at
end

#country_code ⇒ Object

Deprecated.

This field is deprecated. @return [String] ISO 3166-1 alpha-2 country the content is aimed at (e.g. US, DE). Ignored when country_codes is set, but an invalid value is still rejected with 400.



24
25
26
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 24

def country_code
  @country_code
end

#country_codes ⇒ Array<String>

Returns ISO 3166-1 alpha-2 countries the content is aimed at (e.g. US, DE), up to 300. The first is the primary country. Every country is sent to the AI text and image harm detection engines as country context. Takes precedence over country_code.

Returns:

  • (Array<String>) —

    ISO 3166-1 alpha-2 countries the content is aimed at (e.g. US, DE), up to 300. The first is the primary country. Every country is sent to the AI text and image harm detection engines as country context. Takes precedence over country_code.



39
40
41
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 39

def country_codes
  @country_codes
end

#custom ⇒ Object

Returns Arbitrary metadata surfaced in the dashboard.

Returns:

  • (Object) —

    Arbitrary metadata surfaced in the dashboard.



45
46
47
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 45

def custom
  @custom
end

#entity_creator_id ⇒ String

Returns ID of the user who created the content. Required with entity_type + entity_id; omit all three for stateless mode.

Returns:

  • (String) —

    ID of the user who created the content. Required with entity_type + entity_id; omit all three for stateless mode.



27
28
29
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 27

def entity_creator_id
  @entity_creator_id
end

#entity_id ⇒ String

Returns Caller-supplied content identifier. Required with entity_type + entity_creator_id; omit all three for stateless mode.

Returns:

  • (String) —

    Caller-supplied content identifier. Required with entity_type + entity_creator_id; omit all three for stateless mode.



30
31
32
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 30

def entity_id
  @entity_id
end

#entity_type ⇒ String

Returns Caller-defined entity type. Required with entity_id + entity_creator_id; omit all three for stateless mode.

Returns:

  • (String) —

    Caller-defined entity type. Required with entity_id + entity_creator_id; omit all three for stateless mode.



33
34
35
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 33

def entity_type
  @entity_type
end

#texts ⇒ Hash<String, String>

Returns Named text fields to moderate, keyed by caller label (e.g. title, description).

Returns:

  • (Hash<String, String>) —

    Named text fields to moderate, keyed by caller label (e.g. title, description).



48
49
50
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 48

def texts
  @texts
end

#user ⇒ UserRequest

Returns User request object.

Returns:



51
52
53
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 51

def user
  @user
end

#user_id ⇒ String

Returns:

  • (String)


36
37
38
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 36

def user_id
  @user_id
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 72

def self.json_field_mappings
  {
    async_response: 'async_response',
    config_key: 'config_key',
    content_published_at: 'content_published_at',
    country_code: 'country_code',
    entity_creator_id: 'entity_creator_id',
    entity_id: 'entity_id',
    entity_type: 'entity_type',
    user_id: 'user_id',
    country_codes: 'country_codes',
    content_ids: 'content_ids',
    custom: 'custom',
    texts: 'texts',
    user: 'user'
  }
end