Class: GetStream::Generated::ModerationClient
- Inherits:
-
Object
- Object
- GetStream::Generated::ModerationClient
- Defined in:
- lib/getstream_ruby/generated/moderation_client.rb,
lib/getstream_ruby/extensions/moderation_extensions.rb
Overview
Moderation API client with generated methods
Instance Method Summary collapse
-
#analyze(analyze_request = nil) ⇒ Models::AnalyzeResponse
Moderate named text fields and raw image bytes via multipart/form-data.
-
#appeal(appeal_request) ⇒ Models::AppealResponse
Appeal against the moderation decision.
-
#ban(ban_request) ⇒ Models::ModerationBanResponse
Ban a user from a channel or the entire app.
-
#bulk_action_appeals(bulk_action_appeals_request) ⇒ Models::BulkActionAppealsResponse
Process multiple appeals in a single request by applying the specified action to each.
-
#bulk_delete_action_config(bulk_delete_action_config_request) ⇒ Models::BulkDeleteActionConfigResponse
Delete multiple moderation action config entries by UUID in a single request.
-
#bulk_image_moderation(bulk_image_moderation_request) ⇒ Models::BulkImageModerationResponse
Moderate multiple images in bulk using a CSV file.
-
#bulk_upsert_action_config(bulk_upsert_action_config_request) ⇒ Models::BulkUpsertActionConfigResponse
Create or update multiple moderation action config entries in a single request.
-
#bypass(bypass_request) ⇒ Models::BypassResponse
Enable or disable moderation bypass for a user.
-
#check(check_request) ⇒ Models::CheckResponse
Run moderation checks on the provided content.
-
#check_s3_access(check_s3_access_request = nil) ⇒ Models::CheckS3AccessResponse
Verifies that the configured IAM role ARN can access private S3 images for moderation.
-
#check_user_profile(user_id, profile, config_key: 'user_profile:default') ⇒ Models::CheckResponse
Experimental: Check user profile.
-
#count_review_queue(count_review_queue_request = nil) ⇒ Models::CountReviewQueueResponse
Count the review queue items matching a filter, so a moderation dashboard can show a total for a queue or view.
-
#create_policy_test_set(create_policy_test_set_request) ⇒ Models::PolicyTestSetResponse
Save a labeled set of messages that can be re-run against the moderation policy.
- #create_queue(create_queue_request) ⇒ Models::QueueResponse
-
#custom_check(custom_check_request) ⇒ Models::CustomCheckResponse
Custom check, add your own AI model reports to the review queue.
-
#delete_action_config(_id, user_id = nil) ⇒ Models::DeleteActionConfigResponse
Delete a specific moderation action config entry by its UUID.
-
#delete_config(key, team = nil, user_id = nil) ⇒ Models::DeleteModerationConfigResponse
Delete a specific moderation policy by its name.
-
#delete_moderation_rule(_id, user_id = nil) ⇒ Models::DeleteModerationRuleResponse
Delete an existing moderation rule.
- #delete_policy_test_set(_id) ⇒ Models::Response
- #delete_queue(_id, delete_queue_request = nil) ⇒ Models::QueueResponse
-
#flag(flag_request) ⇒ Models::FlagItemResponse
Flag any type of content (messages, users, channels, activities) for moderation review.
-
#get_action_config(queue_type = nil, entity_type = nil, exclude_defaults = nil, only_defaults = nil, user_id = nil) ⇒ Models::GetActionConfigResponse
Returns moderation action configs grouped by entity type, sorted by order ascending.
-
#get_agent_review_status ⇒ Models::GetAgentReviewStatusResponse
Last error and 7-day counts for the app's agent moderator.
-
#get_appeal(_id) ⇒ Models::GetAppealResponse
Retrieve a specific appeal item by its ID.
-
#get_config(key, team = nil) ⇒ Models::GetConfigResponse
Retrieve a specific moderation configuration by its key and team.
-
#get_config_version(key, version, team = nil) ⇒ Models::GetConfigVersionResponse
Retrieve the full moderation configuration stored in a specific version, whether or not it is published.
-
#get_flag_count(get_flag_count_request) ⇒ Models::GetFlagCountResponse
Returns the number of moderation flags created against a specific user's content.
-
#get_moderation_rule(_id) ⇒ Models::GetModerationRuleResponse
Get a specific moderation rule by ID.
- #get_policy_test_run(_id) ⇒ Models::PolicyTestRunResponse
- #get_policy_test_set(_id) ⇒ Models::PolicyTestSetResponse
- #get_queue(_id, user_id = nil) ⇒ Models::QueueResponse
-
#get_review_queue_item(_id) ⇒ Models::GetReviewQueueItemResponse
Retrieve a specific review queue item by its ID.
-
#get_setup_session ⇒ Models::GetSetupSessionResponse
Retrieve a setup session for an app.
-
#initialize(client) ⇒ ModerationClient
constructor
A new instance of ModerationClient.
-
#insert_action_log(insert_action_log_request) ⇒ Models::InsertActionLogResponse
Insert a moderation action log entry.
-
#labels(labels_request) ⇒ Models::LabelsResponse
Run moderation on text and return labels.
-
#list_agent_feedback(limit = nil, _next = nil) ⇒ Models::ListAgentFeedbackResponse
List moderator corrections of Nora's reviews for this app, newest first.
-
#list_config_versions(key, team = nil) ⇒ Models::ListConfigVersionsResponse
List the retained versions of a moderation configuration, newest first, and which one is published.
- #list_policy_test_sets(limit = nil, offset = nil) ⇒ Models::PolicyTestSetListResponse
- #list_queues(user_id = nil) ⇒ Models::ListQueuesResponse
-
#mute(mute_request) ⇒ Models::MuteResponse
Mute a user.
-
#publish_config_version(key, version, publish_config_version_request = nil) ⇒ Models::PublishConfigVersionResponse
Make a stored version the moderation configuration in effect.
-
#query_appeals(query_appeals_request = nil) ⇒ Models::QueryAppealsResponse
Query Appeals.
-
#query_label_results(query_label_results_request = nil) ⇒ Models::QueryLabelResultsResponse
Search and filter moderation label results with support for pagination and sorting.
-
#query_moderation_configs(query_moderation_configs_request = nil) ⇒ Models::QueryModerationConfigsResponse
Search and filter moderation configurations across your application.
-
#query_moderation_feedback(query_moderation_feedback_request = nil) ⇒ Models::QueryModerationFeedbackResponse
List moderation feedback submissions that have an item matching the filter, with those items, sorting and pagination.
-
#query_moderation_flags(query_moderation_flags_request = nil) ⇒ Models::QueryModerationFlagsResponse
Query flags associated with moderation items.
-
#query_moderation_logs(query_moderation_logs_request = nil) ⇒ Models::QueryModerationLogsResponse
Search and filter moderation action logs with support for pagination.
-
#query_moderation_rules(query_moderation_rules_request = nil) ⇒ Models::QueryModerationRulesResponse
Search and filter moderation rules across your application.
-
#query_review_queue(query_review_queue_request = nil) ⇒ Models::QueryReviewQueueResponse
Query review queue items allows you to filter the review queue items.
-
#reveal_media(reveal_media_request) ⇒ Models::RevealMediaResponse
Authorize revealing a review queue item's blurred media.
-
#save_config_version(save_config_version_request) ⇒ Models::SaveConfigVersionResponse
Save a moderation configuration as a new version without making it live.
-
#start_policy_test_run(_id) ⇒ Models::PolicyTestRunResponse
Enqueue a background run of the set against the saved live moderation config.
-
#submit_action(submit_action_request) ⇒ Models::SubmitActionResponse
Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions.
-
#submit_agent_feedback(submit_agent_feedback_request) ⇒ Models::SubmitAgentFeedbackResponse
Record a moderator correction when their action overturns Nora's review of a queue item.
-
#submit_moderation_feedback(submit_moderation_feedback_request = nil) ⇒ Models::SubmitModerationFeedbackResponse
Forward a moderator-supplied correction to the moderation feedback pipeline, optionally marking the referenced flags as false positives.
-
#unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, remove_future_channels_ban = nil, channel_type = nil) ⇒ Models::UnbanResponse
Unban a user from a channel or globally.
-
#unmute(unmute_request) ⇒ Models::UnmuteResponse
Unmute a user.
- #update_queue(_id, update_queue_request = nil) ⇒ Models::QueueResponse
-
#upsert_action_config(upsert_action_config_request) ⇒ Models::UpsertActionConfigResponse
Create a new moderation action config entry or update an existing one.
-
#upsert_config(upsert_config_request) ⇒ Models::UpsertConfigResponse
Create a new moderation configuration or update an existing one.
-
#upsert_moderation_rule(upsert_moderation_rule_request) ⇒ Models::UpsertModerationRuleResponse
Create or update a moderation rule that can apply app-wide or to specific moderation configs.
-
#upsert_setup_session(upsert_setup_session_request) ⇒ Models::UpsertSetupSessionResponse
Update a setup session for an app.
-
#v2_delete_template(name = nil) ⇒ Models::DeleteModerationTemplateResponse
Delete a specific moderation template by its name.
-
#v2_query_templates ⇒ Models::QueryFeedModerationTemplatesResponse
Retrieve a list of feed moderation templates that define preset moderation rules and configurations.
-
#v2_upsert_template(upsert_moderation_template_request) ⇒ Models::UpsertModerationTemplateResponse
Upsert feeds template for moderation.
Constructor Details
#initialize(client) ⇒ ModerationClient
Returns a new instance of ModerationClient.
12 13 14 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 12 def initialize(client) @client = client end |
Instance Method Details
#analyze(analyze_request = nil) ⇒ Models::AnalyzeResponse
Moderate named text fields and raw image bytes via multipart/form-data. Returns a per-field lightweight verdict.
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 184 def analyze(analyze_request = nil) path = '/api/v2/moderation/analyze' # Build request body body = analyze_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#appeal(appeal_request) ⇒ Models::AppealResponse
Appeal against the moderation decision
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 201 def appeal(appeal_request) path = '/api/v2/moderation/appeal' # Build request body body = appeal_request # Make the API request @client.make_request( :post, path, body: body ) end |
#ban(ban_request) ⇒ Models::ModerationBanResponse
Ban a user from a channel or the entire app
268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 268 def ban(ban_request) path = '/api/v2/moderation/ban' # Build request body body = ban_request # Make the API request @client.make_request( :post, path, body: body ) end |
#bulk_action_appeals(bulk_action_appeals_request) ⇒ Models::BulkActionAppealsResponse
Process multiple appeals in a single request by applying the specified action to each. Supported actions: unban, restore, unblock, mark_reviewed, reject_appeal. Each appeal goes through the same path as a single submit_action call.
251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 251 def bulk_action_appeals(bulk_action_appeals_request) path = '/api/v2/moderation/appeals/bulk_action' # Build request body body = bulk_action_appeals_request # Make the API request @client.make_request( :post, path, body: body ) end |
#bulk_delete_action_config(bulk_delete_action_config_request) ⇒ Models::BulkDeleteActionConfigResponse
Delete multiple moderation action config entries by UUID in a single request.
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 79 def bulk_delete_action_config(bulk_delete_action_config_request) path = '/api/v2/moderation/action_config/bulk_delete' # Build request body body = bulk_delete_action_config_request # Make the API request @client.make_request( :post, path, body: body ) end |
#bulk_image_moderation(bulk_image_moderation_request) ⇒ Models::BulkImageModerationResponse
Moderate multiple images in bulk using a CSV file
285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 285 def bulk_image_moderation(bulk_image_moderation_request) path = '/api/v2/moderation/bulk_image_moderation' # Build request body body = bulk_image_moderation_request # Make the API request @client.make_request( :post, path, body: body ) end |
#bulk_upsert_action_config(bulk_upsert_action_config_request) ⇒ Models::BulkUpsertActionConfigResponse
Create or update multiple moderation action config entries in a single request. Omit the ID field to create; provide an ID to update.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 62 def bulk_upsert_action_config(bulk_upsert_action_config_request) path = '/api/v2/moderation/action_config/bulk' # Build request body body = bulk_upsert_action_config_request # Make the API request @client.make_request( :post, path, body: body ) end |
#bypass(bypass_request) ⇒ Models::BypassResponse
Enable or disable moderation bypass for a user. This endpoint is server-side only.
302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 302 def bypass(bypass_request) path = '/api/v2/moderation/bypass' # Build request body body = bypass_request # Make the API request @client.make_request( :post, path, body: body ) end |
#check(check_request) ⇒ Models::CheckResponse
Run moderation checks on the provided content
319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 319 def check(check_request) path = '/api/v2/moderation/check' # Build request body body = check_request # Make the API request @client.make_request( :post, path, body: body ) end |
#check_s3_access(check_s3_access_request = nil) ⇒ Models::CheckS3AccessResponse
Verifies that the configured IAM role ARN can access private S3 images for moderation. Optionally accepts a stream+s3:// URL to check access to a specific object.
336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 336 def check_s3_access(check_s3_access_request = nil) path = '/api/v2/moderation/check_s3_access' # Build request body body = check_s3_access_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#check_user_profile(user_id, profile, config_key: 'user_profile:default') ⇒ Models::CheckResponse
Experimental: Check user profile
Warning: This is an experimental feature and the API is subject to change.
This function is used to check a user profile for moderation. This will not create any review queue items for the user profile. You can just use this to check whether to allow a certain user profile to be created or not.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/getstream_ruby/extensions/moderation_extensions.rb', line 28 def check_user_profile(user_id, profile, config_key: 'user_profile:default') if profile[:username].nil? && profile[:image].nil? raise ArgumentError, 'Either username or image must be provided' end moderation_payload = Models::ModerationPayload.new moderation_payload.texts = [profile[:username]] if profile[:username] moderation_payload.images = [profile[:image]] if profile[:image] check_request = Models::CheckRequest.new( entity_type: 'userprofile', entity_id: user_id, entity_creator_id: user_id, moderation_payload: moderation_payload, config_key: config_key, options: { force_sync: true }, test_mode: true, ) check(check_request) end |
#count_review_queue(count_review_queue_request = nil) ⇒ Models::CountReviewQueueResponse
Count the review queue items matching a filter, so a moderation dashboard can show a total for a queue or view. Counts are kept up to date in the background while they are being requested.
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1017 def count_review_queue(count_review_queue_request = nil) path = '/api/v2/moderation/review_queue/count' # Build request body body = count_review_queue_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#create_policy_test_set(create_policy_test_set_request) ⇒ Models::PolicyTestSetResponse
Save a labeled set of messages that can be re-run against the moderation policy.
822 823 824 825 826 827 828 829 830 831 832 833 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 822 def create_policy_test_set(create_policy_test_set_request) path = '/api/v2/moderation/policy_tests/sets' # Build request body body = create_policy_test_set_request # Make the API request @client.make_request( :post, path, body: body ) end |
#create_queue(create_queue_request) ⇒ Models::QueueResponse
905 906 907 908 909 910 911 912 913 914 915 916 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 905 def create_queue(create_queue_request) path = '/api/v2/moderation/queues' # Build request body body = create_queue_request # Make the API request @client.make_request( :post, path, body: body ) end |
#custom_check(custom_check_request) ⇒ Models::CustomCheckResponse
Custom check, add your own AI model reports to the review queue
514 515 516 517 518 519 520 521 522 523 524 525 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 514 def custom_check(custom_check_request) path = '/api/v2/moderation/custom_check' # Build request body body = custom_check_request # Make the API request @client.make_request( :post, path, body: body ) end |
#delete_action_config(_id, user_id = nil) ⇒ Models::DeleteActionConfigResponse
Delete a specific moderation action config entry by its UUID.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 97 def delete_action_config(_id, user_id = nil) path = '/api/v2/moderation/action_config/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build query parameters query_params = {} query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :delete, path, query_params: query_params ) end |
#delete_config(key, team = nil, user_id = nil) ⇒ Models::DeleteModerationConfigResponse
Delete a specific moderation policy by its name
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 389 def delete_config(key, team = nil, user_id = nil) path = '/api/v2/moderation/config/{key}' # Replace path parameters path = path.gsub('{key}', key.to_s) # Build query parameters query_params = {} query_params['team'] = team unless team.nil? query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :delete, path, query_params: query_params ) end |
#delete_moderation_rule(_id, user_id = nil) ⇒ Models::DeleteModerationRuleResponse
Delete an existing moderation rule
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 716 def delete_moderation_rule(_id, user_id = nil) path = '/api/v2/moderation/moderation_rule/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build query parameters query_params = {} query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :delete, path, query_params: query_params ) end |
#delete_policy_test_set(_id) ⇒ Models::Response
839 840 841 842 843 844 845 846 847 848 849 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 839 def delete_policy_test_set(_id) path = '/api/v2/moderation/policy_tests/sets/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :delete, path ) end |
#delete_queue(_id, delete_queue_request = nil) ⇒ Models::QueueResponse
964 965 966 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 964 def delete_queue(_id, delete_queue_request = nil) path = '/api/v2/moderation/queues/{id}/delete' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = delete_queue_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#flag(flag_request) ⇒ Models::FlagItemResponse
Flag any type of content (messages, users, channels, activities) for moderation review. Supports custom content types and additional metadata for flagged content.
596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 596 def flag(flag_request) path = '/api/v2/moderation/flag' # Build request body body = flag_request # Make the API request @client.make_request( :post, path, body: body ) end |
#get_action_config(queue_type = nil, entity_type = nil, exclude_defaults = nil, only_defaults = nil, user_id = nil) ⇒ Models::GetActionConfigResponse
Returns moderation action configs grouped by entity type, sorted by order ascending. Supports fetching DB-configured actions, hardcoded defaults, or both.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 23 def get_action_config(queue_type = nil, entity_type = nil, exclude_defaults = nil, only_defaults = nil, user_id = nil) path = '/api/v2/moderation/action_config' # Build query parameters query_params = {} query_params['queue_type'] = queue_type unless queue_type.nil? query_params['entity_type'] = entity_type unless entity_type.nil? query_params['exclude_defaults'] = exclude_defaults unless exclude_defaults.nil? query_params['only_defaults'] = only_defaults unless only_defaults.nil? query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#get_agent_review_status ⇒ Models::GetAgentReviewStatusResponse
Last error and 7-day counts for the app's agent moderator
170 171 172 173 174 175 176 177 178 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 170 def get_agent_review_status() path = '/api/v2/moderation/agent_review_status' # Make the API request @client.make_request( :get, path ) end |
#get_appeal(_id) ⇒ Models::GetAppealResponse
Retrieve a specific appeal item by its ID
218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 218 def get_appeal(_id) path = '/api/v2/moderation/appeal/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :get, path ) end |
#get_config(key, team = nil) ⇒ Models::GetConfigResponse
Retrieve a specific moderation configuration by its key and team. This configuration contains settings for various moderation features like toxicity detection, AI analysis, and filtering rules.
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 411 def get_config(key, team = nil) path = '/api/v2/moderation/config/{key}' # Replace path parameters path = path.gsub('{key}', key.to_s) # Build query parameters query_params = {} query_params['team'] = team unless team.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#get_config_version(key, version, team = nil) ⇒ Models::GetConfigVersionResponse
Retrieve the full moderation configuration stored in a specific version, whether or not it is published.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 454 def get_config_version(key, version, team = nil) path = '/api/v2/moderation/config/{key}/versions/{version}' # Replace path parameters path = path.gsub('{key}', key.to_s) path = path.gsub('{version}', version.to_s) # Build query parameters query_params = {} query_params['team'] = team unless team.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#get_flag_count(get_flag_count_request) ⇒ Models::GetFlagCountResponse
Returns the number of moderation flags created against a specific user's content. Optionally filter by entity type.
613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 613 def get_flag_count(get_flag_count_request) path = '/api/v2/moderation/flag_count' # Build request body body = get_flag_count_request # Make the API request @client.make_request( :post, path, body: body ) end |
#get_moderation_rule(_id) ⇒ Models::GetModerationRuleResponse
Get a specific moderation rule by ID
736 737 738 739 740 741 742 743 744 745 746 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 736 def get_moderation_rule(_id) path = '/api/v2/moderation/moderation_rule/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :get, path ) end |
#get_policy_test_run(_id) ⇒ Models::PolicyTestRunResponse
786 787 788 789 790 791 792 793 794 795 796 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 786 def get_policy_test_run(_id) path = '/api/v2/moderation/policy_tests/runs/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :get, path ) end |
#get_policy_test_set(_id) ⇒ Models::PolicyTestSetResponse
855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 855 def get_policy_test_set(_id) path = '/api/v2/moderation/policy_tests/sets/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :get, path ) end |
#get_queue(_id, user_id = nil) ⇒ Models::QueueResponse
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 923 def get_queue(_id, user_id = nil) path = '/api/v2/moderation/queues/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build query parameters query_params = {} query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#get_review_queue_item(_id) ⇒ Models::GetReviewQueueItemResponse
Retrieve a specific review queue item by its ID
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1034 def get_review_queue_item(_id) path = '/api/v2/moderation/review_queue/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :get, path ) end |
#get_setup_session ⇒ Models::GetSetupSessionResponse
Retrieve a setup session for an app
1049 1050 1051 1052 1053 1054 1055 1056 1057 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1049 def get_setup_session() path = '/api/v2/moderation/setup' # Make the API request @client.make_request( :get, path ) end |
#insert_action_log(insert_action_log_request) ⇒ Models::InsertActionLogResponse
Insert a moderation action log entry. Server-side only. Used by product services to log moderation-related actions.
117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 117 def insert_action_log(insert_action_log_request) path = '/api/v2/moderation/action_logs' # Build request body body = insert_action_log_request # Make the API request @client.make_request( :post, path, body: body ) end |
#labels(labels_request) ⇒ Models::LabelsResponse
Run moderation on text and return labels
647 648 649 650 651 652 653 654 655 656 657 658 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 647 def labels(labels_request) path = '/api/v2/moderation/labels' # Build request body body = labels_request # Make the API request @client.make_request( :post, path, body: body ) end |
#list_agent_feedback(limit = nil, _next = nil) ⇒ Models::ListAgentFeedbackResponse
List moderator corrections of Nora's reviews for this app, newest first
135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 135 def list_agent_feedback(limit = nil, _next = nil) path = '/api/v2/moderation/agent_feedback' # Build query parameters query_params = {} query_params['limit'] = limit unless limit.nil? query_params['next'] = _next unless _next.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#list_config_versions(key, team = nil) ⇒ Models::ListConfigVersionsResponse
List the retained versions of a moderation configuration, newest first, and which one is published.
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 432 def list_config_versions(key, team = nil) path = '/api/v2/moderation/config/{key}/versions' # Replace path parameters path = path.gsub('{key}', key.to_s) # Build query parameters query_params = {} query_params['team'] = team unless team.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#list_policy_test_sets(limit = nil, offset = nil) ⇒ Models::PolicyTestSetListResponse
803 804 805 806 807 808 809 810 811 812 813 814 815 816 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 803 def list_policy_test_sets(limit = nil, offset = nil) path = '/api/v2/moderation/policy_tests/sets' # Build query parameters query_params = {} query_params['limit'] = limit unless limit.nil? query_params['offset'] = offset unless offset.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#list_queues(user_id = nil) ⇒ Models::ListQueuesResponse
887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 887 def list_queues(user_id = nil) path = '/api/v2/moderation/queues' # Build query parameters query_params = {} query_params['user_id'] = user_id unless user_id.nil? # Make the API request @client.make_request( :get, path, query_params: query_params ) end |
#mute(mute_request) ⇒ Models::MuteResponse
Mute a user. Mutes are generally not visible to the user you mute, while block is something you notice.
769 770 771 772 773 774 775 776 777 778 779 780 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 769 def mute(mute_request) path = '/api/v2/moderation/mute' # Build request body body = mute_request # Make the API request @client.make_request( :post, path, body: body ) end |
#publish_config_version(key, version, publish_config_version_request = nil) ⇒ Models::PublishConfigVersionResponse
Make a stored version the moderation configuration in effect. Publishing an older version reverts to it without creating a new version.
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 477 def publish_config_version(key, version, publish_config_version_request = nil) path = '/api/v2/moderation/config/{key}/versions/{version}/publish' # Replace path parameters path = path.gsub('{key}', key.to_s) path = path.gsub('{version}', version.to_s) # Build request body body = publish_config_version_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_appeals(query_appeals_request = nil) ⇒ Models::QueryAppealsResponse
Query Appeals
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 234 def query_appeals(query_appeals_request = nil) path = '/api/v2/moderation/appeals' # Build request body body = query_appeals_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_label_results(query_label_results_request = nil) ⇒ Models::QueryLabelResultsResponse
Search and filter moderation label results with support for pagination and sorting. View the history of moderation labels applied to content.
664 665 666 667 668 669 670 671 672 673 674 675 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 664 def query_label_results(query_label_results_request = nil) path = '/api/v2/moderation/labels/results' # Build request body body = query_label_results_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_moderation_configs(query_moderation_configs_request = nil) ⇒ Models::QueryModerationConfigsResponse
Search and filter moderation configurations across your application. This endpoint is designed for building moderation dashboards and managing multiple configuration sets.
497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 497 def query_moderation_configs(query_moderation_configs_request = nil) path = '/api/v2/moderation/configs' # Build request body body = query_moderation_configs_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_moderation_feedback(query_moderation_feedback_request = nil) ⇒ Models::QueryModerationFeedbackResponse
List moderation feedback submissions that have an item matching the filter, with those items, sorting and pagination. Server-side only.
531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 531 def query_moderation_feedback(query_moderation_feedback_request = nil) path = '/api/v2/moderation/feedback_items' # Build request body body = query_moderation_feedback_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_moderation_flags(query_moderation_flags_request = nil) ⇒ Models::QueryModerationFlagsResponse
Query flags associated with moderation items. This is used for building a moderation dashboard.
630 631 632 633 634 635 636 637 638 639 640 641 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 630 def query_moderation_flags(query_moderation_flags_request = nil) path = '/api/v2/moderation/flags' # Build request body body = query_moderation_flags_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_moderation_logs(query_moderation_logs_request = nil) ⇒ Models::QueryModerationLogsResponse
Search and filter moderation action logs with support for pagination. View the history of moderation actions taken, including who performed them and when.
681 682 683 684 685 686 687 688 689 690 691 692 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 681 def query_moderation_logs(query_moderation_logs_request = nil) path = '/api/v2/moderation/logs' # Build request body body = query_moderation_logs_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_moderation_rules(query_moderation_rules_request = nil) ⇒ Models::QueryModerationRulesResponse
Search and filter moderation rules across your application. This endpoint is designed for building moderation dashboards and managing multiple rule sets.
752 753 754 755 756 757 758 759 760 761 762 763 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 752 def query_moderation_rules(query_moderation_rules_request = nil) path = '/api/v2/moderation/moderation_rules' # Build request body body = query_moderation_rules_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#query_review_queue(query_review_queue_request = nil) ⇒ Models::QueryReviewQueueResponse
Query review queue items allows you to filter the review queue items. This is used for building a moderation dashboard.
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1000 def query_review_queue(query_review_queue_request = nil) path = '/api/v2/moderation/review_queue' # Build request body body = query_review_queue_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#reveal_media(reveal_media_request) ⇒ Models::RevealMediaResponse
Authorize revealing a review queue item's blurred media. CSAM can only be revealed by users with the RevealProtectedMedia permission. Reveals of blurred CSAM or gore are recorded in the moderation action logs.
983 984 985 986 987 988 989 990 991 992 993 994 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 983 def reveal_media(reveal_media_request) path = '/api/v2/moderation/reveal_media' # Build request body body = reveal_media_request # Make the API request @client.make_request( :post, path, body: body ) end |
#save_config_version(save_config_version_request) ⇒ Models::SaveConfigVersionResponse
Save a moderation configuration as a new version without making it live. The version takes effect once it is published.
370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 370 def save_config_version(save_config_version_request) path = '/api/v2/moderation/config/versions' # Build request body body = save_config_version_request # Make the API request @client.make_request( :post, path, body: body ) end |
#start_policy_test_run(_id) ⇒ Models::PolicyTestRunResponse
Enqueue a background run of the set against the saved live moderation config.
871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 871 def start_policy_test_run(_id) path = '/api/v2/moderation/policy_tests/sets/{id}/runs' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Make the API request @client.make_request( :post, path ) end |
#submit_action(submit_action_request) ⇒ Models::SubmitActionResponse
Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions. Supports various action types with configurable parameters.
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1080 def submit_action(submit_action_request) path = '/api/v2/moderation/submit_action' # Build request body body = submit_action_request # Make the API request @client.make_request( :post, path, body: body ) end |
#submit_agent_feedback(submit_agent_feedback_request) ⇒ Models::SubmitAgentFeedbackResponse
Record a moderator correction when their action overturns Nora's review of a queue item
154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 154 def submit_agent_feedback(submit_agent_feedback_request) path = '/api/v2/moderation/agent_feedback' # Build request body body = submit_agent_feedback_request # Make the API request @client.make_request( :post, path, body: body ) end |
#submit_moderation_feedback(submit_moderation_feedback_request = nil) ⇒ Models::SubmitModerationFeedbackResponse
Forward a moderator-supplied correction to the moderation feedback pipeline, optionally marking the referenced flags as false positives. Server-side only.
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1097 def submit_moderation_feedback(submit_moderation_feedback_request = nil) path = '/api/v2/moderation/submit_moderation_feedback' # Build request body body = submit_moderation_feedback_request || {} # Make the API request @client.make_request( :post, path, body: body ) end |
#unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, remove_future_channels_ban = nil, channel_type = nil) ⇒ Models::UnbanResponse
Unban a user from a channel or globally.
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1119 def unban(unban_request, target_user_id, channel_cid = nil, created_by = nil, remove_future_channels_ban = nil, channel_type = nil) path = '/api/v2/moderation/unban' # Build query parameters query_params = {} query_params['target_user_id'] = target_user_id unless target_user_id.nil? query_params['channel_cid'] = channel_cid unless channel_cid.nil? query_params['created_by'] = created_by unless created_by.nil? query_params['remove_future_channels_ban'] = remove_future_channels_ban unless remove_future_channels_ban.nil? query_params['channel_type'] = channel_type unless channel_type.nil? # Build request body body = unban_request # Make the API request @client.make_request( :post, path, query_params: query_params, body: body ) end |
#unmute(unmute_request) ⇒ Models::UnmuteResponse
Unmute a user
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1144 def unmute(unmute_request) path = '/api/v2/moderation/unmute' # Build request body body = unmute_request # Make the API request @client.make_request( :post, path, body: body ) end |
#update_queue(_id, update_queue_request = nil) ⇒ Models::QueueResponse
944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 944 def update_queue(_id, update_queue_request = nil) path = '/api/v2/moderation/queues/{id}' # Replace path parameters path = path.gsub('{id}', _id.to_s) # Build request body body = update_queue_request || {} # Make the API request @client.make_request( :patch, path, body: body ) end |
#upsert_action_config(upsert_action_config_request) ⇒ Models::UpsertActionConfigResponse
Create a new moderation action config entry or update an existing one. Action configs control the action buttons displayed in the moderation dashboard for each entity type.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 45 def upsert_action_config(upsert_action_config_request) path = '/api/v2/moderation/action_config' # Build request body body = upsert_action_config_request # Make the API request @client.make_request( :post, path, body: body ) end |
#upsert_config(upsert_config_request) ⇒ Models::UpsertConfigResponse
Create a new moderation configuration or update an existing one. Configure settings for content filtering, AI analysis, toxicity detection, and other moderation features.
353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 353 def upsert_config(upsert_config_request) path = '/api/v2/moderation/config' # Build request body body = upsert_config_request # Make the API request @client.make_request( :post, path, body: body ) end |
#upsert_moderation_rule(upsert_moderation_rule_request) ⇒ Models::UpsertModerationRuleResponse
Create or update a moderation rule that can apply app-wide or to specific moderation configs
698 699 700 701 702 703 704 705 706 707 708 709 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 698 def upsert_moderation_rule(upsert_moderation_rule_request) path = '/api/v2/moderation/moderation_rule' # Build request body body = upsert_moderation_rule_request # Make the API request @client.make_request( :post, path, body: body ) end |
#upsert_setup_session(upsert_setup_session_request) ⇒ Models::UpsertSetupSessionResponse
Update a setup session for an app
1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 1063 def upsert_setup_session(upsert_setup_session_request) path = '/api/v2/moderation/setup' # Build request body body = upsert_setup_session_request # Make the API request @client.make_request( :post, path, body: body ) end |
#v2_delete_template(name = nil) ⇒ Models::DeleteModerationTemplateResponse
Delete a specific moderation template by its name
548 549 550 551 552 553 554 555 556 557 558 559 560 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 548 def v2_delete_template(name = nil) path = '/api/v2/moderation/feeds_moderation_template' # Build query parameters query_params = {} query_params['name'] = name unless name.nil? # Make the API request @client.make_request( :delete, path, query_params: query_params ) end |
#v2_query_templates ⇒ Models::QueryFeedModerationTemplatesResponse
Retrieve a list of feed moderation templates that define preset moderation rules and configurations. Limited to 100 templates per request.
565 566 567 568 569 570 571 572 573 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 565 def v2_query_templates() path = '/api/v2/moderation/feeds_moderation_template' # Make the API request @client.make_request( :get, path ) end |
#v2_upsert_template(upsert_moderation_template_request) ⇒ Models::UpsertModerationTemplateResponse
Upsert feeds template for moderation
579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 579 def v2_upsert_template(upsert_moderation_template_request) path = '/api/v2/moderation/feeds_moderation_template' # Build request body body = upsert_moderation_template_request # Make the API request @client.make_request( :post, path, body: body ) end |