Class: GetStream::Generated::Models::AnalyzeRequest
- Defined in:
- lib/getstream_ruby/generated/models/analyze_request.rb
Instance Attribute Summary collapse
-
#async_response ⇒ 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.
-
#config_key ⇒ String
Moderation policy key.
-
#content_ids ⇒ 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.
-
#content_published_at ⇒ DateTime
Original timestamp when the content was produced.
-
#custom ⇒ Object
Arbitrary metadata surfaced in the dashboard.
-
#entity_creator_id ⇒ String
ID of the user who created the content.
-
#entity_id ⇒ String
Caller-supplied content identifier.
-
#entity_type ⇒ String
Caller-defined entity type.
-
#texts ⇒ Hash<String, String>
Named text fields to moderate, keyed by caller label (e.g. title, description).
- #user ⇒ UserRequest
- #user_id ⇒ String
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AnalyzeRequest
constructor
Initialize with attributes.
Methods inherited from BaseModel
#==, #inspect, omit_empty_fields, #to_h, #to_json
Constructor Details
#initialize(attributes = {}) ⇒ AnalyzeRequest
Initialize with attributes
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 47 def initialize(attributes = {}) super(attributes) @async_response = attributes[:async_response] || attributes['async_response'] || nil @config_key = attributes[:config_key] || attributes['config_key'] || nil @content_published_at = attributes[:content_published_at] || attributes['content_published_at'] || nil @entity_creator_id = attributes[:entity_creator_id] || attributes['entity_creator_id'] || nil @entity_id = attributes[:entity_id] || attributes['entity_id'] || nil @entity_type = attributes[:entity_type] || attributes['entity_type'] || nil @user_id = attributes[:user_id] || attributes['user_id'] || nil @content_ids = attributes[:content_ids] || attributes['content_ids'] || nil @custom = attributes[:custom] || attributes['custom'] || nil @texts = attributes[:texts] || attributes['texts'] || nil @user = attributes[:user] || attributes['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.
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.
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.
35 36 37 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 35 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.
20 21 22 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 20 def content_published_at @content_published_at end |
#custom ⇒ Object
Returns Arbitrary metadata surfaced in the dashboard.
38 39 40 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 38 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.
23 24 25 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 23 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.
26 27 28 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 26 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.
29 30 31 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 29 def entity_type @entity_type end |
#texts ⇒ Hash<String, String>
Returns Named text fields to moderate, keyed by caller label (e.g. title, description).
41 42 43 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 41 def texts @texts end |
#user ⇒ UserRequest
44 45 46 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 44 def user @user end |
#user_id ⇒ String
32 33 34 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 32 def user_id @user_id end |
Class Method Details
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/getstream_ruby/generated/models/analyze_request.rb', line 63 def self.json_field_mappings { async_response: 'async_response', config_key: 'config_key', content_published_at: 'content_published_at', entity_creator_id: 'entity_creator_id', entity_id: 'entity_id', entity_type: 'entity_type', user_id: 'user_id', content_ids: 'content_ids', custom: 'custom', texts: 'texts', user: 'user' } end |