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) ⇒ 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) ⇒ 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.
-
#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) ⇒ 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_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_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_policy_test_sets ⇒ Models::PolicyTestSetListResponse
- #list_queues(user_id = nil) ⇒ Models::ListQueuesResponse
-
#mute(mute_request) ⇒ Models::MuteResponse
Mute a user.
-
#query_appeals(query_appeals_request) ⇒ Models::QueryAppealsResponse
Query Appeals.
-
#query_label_results(query_label_results_request) ⇒ Models::QueryLabelResultsResponse
Search and filter moderation label results with support for pagination and sorting.
-
#query_moderation_configs(query_moderation_configs_request) ⇒ Models::QueryModerationConfigsResponse
Search and filter moderation configurations across your application.
-
#query_moderation_flags(query_moderation_flags_request) ⇒ Models::QueryModerationFlagsResponse
Query flags associated with moderation items.
-
#query_moderation_logs(query_moderation_logs_request) ⇒ Models::QueryModerationLogsResponse
Search and filter moderation action logs with support for pagination.
-
#query_moderation_rules(query_moderation_rules_request) ⇒ Models::QueryModerationRulesResponse
Search and filter moderation rules across your application.
-
#query_review_queue(query_review_queue_request) ⇒ Models::QueryReviewQueueResponse
Query review queue items allows you to filter the review queue items.
-
#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_moderation_feedback(submit_moderation_feedback_request) ⇒ Models::SubmitModerationFeedbackResponse
Forward a moderator-supplied correction to the moderation feedback pipeline.
-
#unban(unban_request, target_user_id, channel_cid = nil, created_by = 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) ⇒ 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 ⇒ 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) ⇒ Models::AnalyzeResponse
Moderate named text fields and raw image bytes via multipart/form-data. Returns a per-field lightweight verdict.
134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 134 def analyze(analyze_request) 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
151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 151 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
218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 218 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.
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 201 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
235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 235 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.
252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 252 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
269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 269 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) ⇒ 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.
286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 286 def check_s3_access(check_s3_access_request) 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 |
#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.
660 661 662 663 664 665 666 667 668 669 670 671 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 660 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
743 744 745 746 747 748 749 750 751 752 753 754 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 743 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
381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 381 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
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 322 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
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 561 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
677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 677 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) ⇒ Models::QueueResponse
802 803 804 805 806 807 808 809 810 811 812 813 814 815 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 802 def delete_queue(_id, delete_queue_request) 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.
441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 441 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_appeal(_id) ⇒ Models::GetAppealResponse
Retrieve a specific appeal item by its ID
168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 168 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.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 344 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_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.
458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 458 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
581 582 583 584 585 586 587 588 589 590 591 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 581 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
631 632 633 634 635 636 637 638 639 640 641 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 631 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
693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 693 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
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 761 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
838 839 840 841 842 843 844 845 846 847 848 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 838 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
853 854 855 856 857 858 859 860 861 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 853 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
492 493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 492 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_policy_test_sets ⇒ Models::PolicyTestSetListResponse
646 647 648 649 650 651 652 653 654 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 646 def list_policy_test_sets() path = '/api/v2/moderation/policy_tests/sets' # Make the API request @client.make_request( :get, path ) end |
#list_queues(user_id = nil) ⇒ Models::ListQueuesResponse
725 726 727 728 729 730 731 732 733 734 735 736 737 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 725 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.
614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 614 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 |
#query_appeals(query_appeals_request) ⇒ Models::QueryAppealsResponse
Query Appeals
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 184 def query_appeals(query_appeals_request) 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) ⇒ Models::QueryLabelResultsResponse
Search and filter moderation label results with support for pagination and sorting. View the history of moderation labels applied to content.
509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 509 def query_label_results(query_label_results_request) 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) ⇒ Models::QueryModerationConfigsResponse
Search and filter moderation configurations across your application. This endpoint is designed for building moderation dashboards and managing multiple configuration sets.
364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 364 def query_moderation_configs(query_moderation_configs_request) 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_flags(query_moderation_flags_request) ⇒ Models::QueryModerationFlagsResponse
Query flags associated with moderation items. This is used for building a moderation dashboard.
475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 475 def query_moderation_flags(query_moderation_flags_request) 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) ⇒ 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.
526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 526 def query_moderation_logs(query_moderation_logs_request) 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) ⇒ Models::QueryModerationRulesResponse
Search and filter moderation rules across your application. This endpoint is designed for building moderation dashboards and managing multiple rule sets.
597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 597 def query_moderation_rules(query_moderation_rules_request) 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) ⇒ Models::QueryReviewQueueResponse
Query review queue items allows you to filter the review queue items. This is used for building a moderation dashboard.
821 822 823 824 825 826 827 828 829 830 831 832 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 821 def query_review_queue(query_review_queue_request) 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 |
#start_policy_test_run(_id) ⇒ Models::PolicyTestRunResponse
Enqueue a background run of the set against the saved live moderation config.
709 710 711 712 713 714 715 716 717 718 719 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 709 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.
884 885 886 887 888 889 890 891 892 893 894 895 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 884 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_moderation_feedback(submit_moderation_feedback_request) ⇒ Models::SubmitModerationFeedbackResponse
Forward a moderator-supplied correction to the moderation feedback pipeline. Server-side only.
901 902 903 904 905 906 907 908 909 910 911 912 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 901 def submit_moderation_feedback(submit_moderation_feedback_request) 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) ⇒ Models::UnbanResponse
Unban a user from a channel or globally.
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 921 def unban(unban_request, target_user_id, channel_cid = nil, created_by = 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? # 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
944 945 946 947 948 949 950 951 952 953 954 955 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 944 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) ⇒ Models::QueueResponse
782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 782 def update_queue(_id, update_queue_request) 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.
303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 303 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
543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 543 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
867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 867 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 ⇒ Models::DeleteModerationTemplateResponse
Delete a specific moderation template by its name
397 398 399 400 401 402 403 404 405 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 397 def v2_delete_template() path = '/api/v2/moderation/feeds_moderation_template' # Make the API request @client.make_request( :delete, path ) 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.
410 411 412 413 414 415 416 417 418 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 410 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
424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/getstream_ruby/generated/moderation_client.rb', line 424 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 |