moderation_api 1.2.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ignore +2 -0
- data/CHANGELOG.md +36 -0
- data/README.md +198 -62
- data/SECURITY.md +27 -0
- data/lib/moderation_api/client.rb +98 -0
- data/lib/moderation_api/errors.rb +228 -0
- data/lib/moderation_api/file_part.rb +58 -0
- data/lib/moderation_api/internal/transport/base_client.rb +577 -0
- data/lib/moderation_api/internal/transport/pooled_net_requester.rb +208 -0
- data/lib/moderation_api/internal/type/array_of.rb +168 -0
- data/lib/moderation_api/internal/type/base_model.rb +534 -0
- data/lib/moderation_api/internal/type/base_page.rb +55 -0
- data/lib/moderation_api/internal/type/boolean.rb +77 -0
- data/lib/moderation_api/internal/type/converter.rb +327 -0
- data/lib/moderation_api/internal/type/enum.rb +131 -0
- data/lib/moderation_api/internal/type/file_input.rb +111 -0
- data/lib/moderation_api/internal/type/hash_of.rb +188 -0
- data/lib/moderation_api/internal/type/request_parameters.rb +42 -0
- data/lib/moderation_api/internal/type/union.rb +243 -0
- data/lib/moderation_api/internal/type/unknown.rb +81 -0
- data/lib/moderation_api/internal/util.rb +915 -0
- data/lib/moderation_api/internal.rb +20 -0
- data/lib/moderation_api/models/account_list_params.rb +14 -0
- data/lib/moderation_api/models/account_list_response.rb +68 -0
- data/lib/moderation_api/models/action_create_params.rb +217 -0
- data/lib/moderation_api/models/action_create_response.rb +188 -0
- data/lib/moderation_api/models/action_delete_params.rb +14 -0
- data/lib/moderation_api/models/action_delete_response.rb +25 -0
- data/lib/moderation_api/models/action_list_params.rb +20 -0
- data/lib/moderation_api/models/action_list_response.rb +247 -0
- data/lib/moderation_api/models/action_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/action_retrieve_response.rb +244 -0
- data/lib/moderation_api/models/action_update_params.rb +217 -0
- data/lib/moderation_api/models/action_update_response.rb +188 -0
- data/lib/moderation_api/models/actions/execute_execute_by_id_params.rb +48 -0
- data/lib/moderation_api/models/actions/execute_execute_by_id_response.rb +35 -0
- data/lib/moderation_api/models/actions/execute_execute_params.rb +64 -0
- data/lib/moderation_api/models/actions/execute_execute_response.rb +21 -0
- data/lib/moderation_api/models/auth_create_params.rb +14 -0
- data/lib/moderation_api/models/auth_create_response.rb +33 -0
- data/lib/moderation_api/models/auth_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/auth_retrieve_response.rb +25 -0
- data/lib/moderation_api/models/author_create_params.rb +127 -0
- data/lib/moderation_api/models/author_create_response.rb +272 -0
- data/lib/moderation_api/models/author_delete_params.rb +14 -0
- data/lib/moderation_api/models/author_delete_response.rb +16 -0
- data/lib/moderation_api/models/author_list_params.rb +93 -0
- data/lib/moderation_api/models/author_list_response.rb +326 -0
- data/lib/moderation_api/models/author_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/author_retrieve_response.rb +274 -0
- data/lib/moderation_api/models/author_update_params.rb +119 -0
- data/lib/moderation_api/models/author_update_response.rb +272 -0
- data/lib/moderation_api/models/content_submit_params.rb +871 -0
- data/lib/moderation_api/models/content_submit_response.rb +742 -0
- data/lib/moderation_api/models/queue/item_list_params.rb +118 -0
- data/lib/moderation_api/models/queue/item_list_response.rb +235 -0
- data/lib/moderation_api/models/queue/item_resolve_params.rb +32 -0
- data/lib/moderation_api/models/queue/item_resolve_response.rb +34 -0
- data/lib/moderation_api/models/queue/item_unresolve_params.rb +32 -0
- data/lib/moderation_api/models/queue/item_unresolve_response.rb +34 -0
- data/lib/moderation_api/models/queue_get_stats_params.rb +22 -0
- data/lib/moderation_api/models/queue_get_stats_response.rb +251 -0
- data/lib/moderation_api/models/queue_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/queue_retrieve_response.rb +190 -0
- data/lib/moderation_api/models/wordlist/word_add_params.rb +24 -0
- data/lib/moderation_api/models/wordlist/word_add_response.rb +35 -0
- data/lib/moderation_api/models/wordlist/word_remove_params.rb +24 -0
- data/lib/moderation_api/models/wordlist/word_remove_response.rb +35 -0
- data/lib/moderation_api/models/wordlist_get_embedding_status_params.rb +14 -0
- data/lib/moderation_api/models/wordlist_get_embedding_status_response.rb +35 -0
- data/lib/moderation_api/models/wordlist_list_params.rb +14 -0
- data/lib/moderation_api/models/wordlist_list_response.rb +52 -0
- data/lib/moderation_api/models/wordlist_retrieve_params.rb +14 -0
- data/lib/moderation_api/models/wordlist_retrieve_response.rb +65 -0
- data/lib/moderation_api/models/wordlist_update_params.rb +58 -0
- data/lib/moderation_api/models/wordlist_update_response.rb +65 -0
- data/lib/moderation_api/models.rb +90 -0
- data/lib/moderation_api/request_options.rb +78 -0
- data/lib/moderation_api/resources/account.rb +32 -0
- data/lib/moderation_api/resources/actions/execute.rb +80 -0
- data/lib/moderation_api/resources/actions.rb +175 -0
- data/lib/moderation_api/resources/auth.rb +50 -0
- data/lib/moderation_api/resources/authors.rb +179 -0
- data/lib/moderation_api/resources/content.rb +53 -0
- data/lib/moderation_api/resources/queue/items.rb +131 -0
- data/lib/moderation_api/resources/queue.rb +63 -0
- data/lib/moderation_api/resources/wordlist/words.rb +64 -0
- data/lib/moderation_api/resources/wordlist.rb +111 -0
- data/lib/moderation_api/version.rb +3 -13
- data/lib/moderation_api.rb +115 -89
- data/manifest.yaml +17 -0
- data/rbi/moderation_api/client.rbi +67 -0
- data/rbi/moderation_api/errors.rbi +205 -0
- data/rbi/moderation_api/file_part.rbi +37 -0
- data/rbi/moderation_api/internal/transport/base_client.rbi +305 -0
- data/rbi/moderation_api/internal/transport/pooled_net_requester.rbi +84 -0
- data/rbi/moderation_api/internal/type/array_of.rbi +104 -0
- data/rbi/moderation_api/internal/type/base_model.rbi +314 -0
- data/rbi/moderation_api/internal/type/base_page.rbi +43 -0
- data/rbi/moderation_api/internal/type/boolean.rbi +58 -0
- data/rbi/moderation_api/internal/type/converter.rbi +225 -0
- data/rbi/moderation_api/internal/type/enum.rbi +82 -0
- data/rbi/moderation_api/internal/type/file_input.rbi +59 -0
- data/rbi/moderation_api/internal/type/hash_of.rbi +104 -0
- data/rbi/moderation_api/internal/type/request_parameters.rbi +31 -0
- data/rbi/moderation_api/internal/type/union.rbi +128 -0
- data/rbi/moderation_api/internal/type/unknown.rbi +58 -0
- data/rbi/moderation_api/internal/util.rbi +487 -0
- data/rbi/moderation_api/internal.rbi +18 -0
- data/rbi/moderation_api/models/account_list_params.rbi +32 -0
- data/rbi/moderation_api/models/account_list_response.rbi +115 -0
- data/rbi/moderation_api/models/action_create_params.rbi +433 -0
- data/rbi/moderation_api/models/action_create_response.rbi +354 -0
- data/rbi/moderation_api/models/action_delete_params.rbi +32 -0
- data/rbi/moderation_api/models/action_delete_response.rbi +36 -0
- data/rbi/moderation_api/models/action_list_params.rbi +41 -0
- data/rbi/moderation_api/models/action_list_response.rbi +450 -0
- data/rbi/moderation_api/models/action_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/action_retrieve_response.rbi +442 -0
- data/rbi/moderation_api/models/action_update_params.rbi +436 -0
- data/rbi/moderation_api/models/action_update_response.rbi +354 -0
- data/rbi/moderation_api/models/actions/execute_execute_by_id_params.rbi +84 -0
- data/rbi/moderation_api/models/actions/execute_execute_by_id_response.rbi +54 -0
- data/rbi/moderation_api/models/actions/execute_execute_params.rbi +103 -0
- data/rbi/moderation_api/models/actions/execute_execute_response.rbi +33 -0
- data/rbi/moderation_api/models/auth_create_params.rbi +32 -0
- data/rbi/moderation_api/models/auth_create_response.rbi +48 -0
- data/rbi/moderation_api/models/auth_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/auth_retrieve_response.rbi +36 -0
- data/rbi/moderation_api/models/author_create_params.rbi +184 -0
- data/rbi/moderation_api/models/author_create_response.rbi +467 -0
- data/rbi/moderation_api/models/author_delete_params.rbi +32 -0
- data/rbi/moderation_api/models/author_delete_response.rbi +26 -0
- data/rbi/moderation_api/models/author_list_params.rbi +213 -0
- data/rbi/moderation_api/models/author_list_response.rbi +593 -0
- data/rbi/moderation_api/models/author_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/author_retrieve_response.rbi +472 -0
- data/rbi/moderation_api/models/author_update_params.rbi +176 -0
- data/rbi/moderation_api/models/author_update_response.rbi +467 -0
- data/rbi/moderation_api/models/content_submit_params.rbi +1641 -0
- data/rbi/moderation_api/models/content_submit_response.rbi +1456 -0
- data/rbi/moderation_api/models/queue/item_list_params.rbi +237 -0
- data/rbi/moderation_api/models/queue/item_list_response.rbi +440 -0
- data/rbi/moderation_api/models/queue/item_resolve_params.rbi +59 -0
- data/rbi/moderation_api/models/queue/item_resolve_response.rbi +55 -0
- data/rbi/moderation_api/models/queue/item_unresolve_params.rbi +59 -0
- data/rbi/moderation_api/models/queue/item_unresolve_response.rbi +52 -0
- data/rbi/moderation_api/models/queue_get_stats_params.rbi +49 -0
- data/rbi/moderation_api/models/queue_get_stats_response.rbi +466 -0
- data/rbi/moderation_api/models/queue_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/queue_retrieve_response.rbi +411 -0
- data/rbi/moderation_api/models/wordlist/word_add_params.rbi +48 -0
- data/rbi/moderation_api/models/wordlist/word_add_response.rbi +58 -0
- data/rbi/moderation_api/models/wordlist/word_remove_params.rbi +48 -0
- data/rbi/moderation_api/models/wordlist/word_remove_response.rbi +58 -0
- data/rbi/moderation_api/models/wordlist_get_embedding_status_params.rbi +32 -0
- data/rbi/moderation_api/models/wordlist_get_embedding_status_response.rbi +53 -0
- data/rbi/moderation_api/models/wordlist_list_params.rbi +32 -0
- data/rbi/moderation_api/models/wordlist_list_response.rbi +80 -0
- data/rbi/moderation_api/models/wordlist_retrieve_params.rbi +32 -0
- data/rbi/moderation_api/models/wordlist_retrieve_response.rbi +88 -0
- data/rbi/moderation_api/models/wordlist_update_params.rbi +95 -0
- data/rbi/moderation_api/models/wordlist_update_response.rbi +88 -0
- data/rbi/moderation_api/models.rbi +50 -0
- data/rbi/moderation_api/request_options.rbi +59 -0
- data/rbi/moderation_api/resources/account.rbi +21 -0
- data/rbi/moderation_api/resources/actions/execute.rbi +69 -0
- data/rbi/moderation_api/resources/actions.rbi +164 -0
- data/rbi/moderation_api/resources/auth.rbi +28 -0
- data/rbi/moderation_api/resources/authors.rbi +143 -0
- data/rbi/moderation_api/resources/content.rbi +84 -0
- data/rbi/moderation_api/resources/queue/items.rbi +95 -0
- data/rbi/moderation_api/resources/queue.rbi +47 -0
- data/rbi/moderation_api/resources/wordlist/words.rbi +48 -0
- data/rbi/moderation_api/resources/wordlist.rbi +82 -0
- data/rbi/moderation_api/version.rbi +5 -0
- data/sig/moderation_api/client.rbs +38 -0
- data/sig/moderation_api/errors.rbs +117 -0
- data/sig/moderation_api/file_part.rbs +21 -0
- data/sig/moderation_api/internal/transport/base_client.rbs +133 -0
- data/sig/moderation_api/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/moderation_api/internal/type/array_of.rbs +48 -0
- data/sig/moderation_api/internal/type/base_model.rbs +104 -0
- data/sig/moderation_api/internal/type/base_page.rbs +24 -0
- data/sig/moderation_api/internal/type/boolean.rbs +26 -0
- data/sig/moderation_api/internal/type/converter.rbs +79 -0
- data/sig/moderation_api/internal/type/enum.rbs +32 -0
- data/sig/moderation_api/internal/type/file_input.rbs +25 -0
- data/sig/moderation_api/internal/type/hash_of.rbs +48 -0
- data/sig/moderation_api/internal/type/request_parameters.rbs +19 -0
- data/sig/moderation_api/internal/type/union.rbs +52 -0
- data/sig/moderation_api/internal/type/unknown.rbs +26 -0
- data/sig/moderation_api/internal/util.rbs +185 -0
- data/sig/moderation_api/internal.rbs +10 -0
- data/sig/moderation_api/models/account_list_params.rbs +15 -0
- data/sig/moderation_api/models/account_list_response.rbs +56 -0
- data/sig/moderation_api/models/action_create_params.rbs +195 -0
- data/sig/moderation_api/models/action_create_response.rbs +143 -0
- data/sig/moderation_api/models/action_delete_params.rbs +15 -0
- data/sig/moderation_api/models/action_delete_response.rbs +15 -0
- data/sig/moderation_api/models/action_list_params.rbs +25 -0
- data/sig/moderation_api/models/action_list_response.rbs +190 -0
- data/sig/moderation_api/models/action_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/action_retrieve_response.rbs +185 -0
- data/sig/moderation_api/models/action_update_params.rbs +197 -0
- data/sig/moderation_api/models/action_update_response.rbs +143 -0
- data/sig/moderation_api/models/actions/execute_execute_by_id_params.rbs +51 -0
- data/sig/moderation_api/models/actions/execute_execute_by_id_response.rbs +28 -0
- data/sig/moderation_api/models/actions/execute_execute_params.rbs +63 -0
- data/sig/moderation_api/models/actions/execute_execute_response.rbs +15 -0
- data/sig/moderation_api/models/auth_create_params.rbs +15 -0
- data/sig/moderation_api/models/auth_create_response.rbs +18 -0
- data/sig/moderation_api/models/auth_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/auth_retrieve_response.rbs +15 -0
- data/sig/moderation_api/models/author_create_params.rbs +106 -0
- data/sig/moderation_api/models/author_create_response.rbs +195 -0
- data/sig/moderation_api/models/author_delete_params.rbs +15 -0
- data/sig/moderation_api/models/author_delete_response.rbs +13 -0
- data/sig/moderation_api/models/author_list_params.rbs +110 -0
- data/sig/moderation_api/models/author_list_response.rbs +254 -0
- data/sig/moderation_api/models/author_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/author_retrieve_response.rbs +195 -0
- data/sig/moderation_api/models/author_update_params.rbs +101 -0
- data/sig/moderation_api/models/author_update_response.rbs +195 -0
- data/sig/moderation_api/models/content_submit_params.rbs +733 -0
- data/sig/moderation_api/models/content_submit_response.rbs +599 -0
- data/sig/moderation_api/models/queue/item_list_params.rbs +127 -0
- data/sig/moderation_api/models/queue/item_list_response.rbs +209 -0
- data/sig/moderation_api/models/queue/item_resolve_params.rbs +32 -0
- data/sig/moderation_api/models/queue/item_resolve_response.rbs +26 -0
- data/sig/moderation_api/models/queue/item_unresolve_params.rbs +32 -0
- data/sig/moderation_api/models/queue/item_unresolve_response.rbs +24 -0
- data/sig/moderation_api/models/queue_get_stats_params.rbs +26 -0
- data/sig/moderation_api/models/queue_get_stats_response.rbs +207 -0
- data/sig/moderation_api/models/queue_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/queue_retrieve_response.rbs +207 -0
- data/sig/moderation_api/models/wordlist/word_add_params.rbs +26 -0
- data/sig/moderation_api/models/wordlist/word_add_response.rbs +28 -0
- data/sig/moderation_api/models/wordlist/word_remove_params.rbs +26 -0
- data/sig/moderation_api/models/wordlist/word_remove_response.rbs +32 -0
- data/sig/moderation_api/models/wordlist_get_embedding_status_params.rbs +15 -0
- data/sig/moderation_api/models/wordlist_get_embedding_status_response.rbs +26 -0
- data/sig/moderation_api/models/wordlist_list_params.rbs +15 -0
- data/sig/moderation_api/models/wordlist_list_response.rbs +45 -0
- data/sig/moderation_api/models/wordlist_retrieve_params.rbs +15 -0
- data/sig/moderation_api/models/wordlist_retrieve_response.rbs +50 -0
- data/sig/moderation_api/models/wordlist_update_params.rbs +56 -0
- data/sig/moderation_api/models/wordlist_update_response.rbs +50 -0
- data/sig/moderation_api/models.rbs +47 -0
- data/sig/moderation_api/request_options.rbs +36 -0
- data/sig/moderation_api/resources/account.rbs +11 -0
- data/sig/moderation_api/resources/actions/execute.rbs +28 -0
- data/sig/moderation_api/resources/actions.rbs +57 -0
- data/sig/moderation_api/resources/auth.rbs +15 -0
- data/sig/moderation_api/resources/authors.rbs +54 -0
- data/sig/moderation_api/resources/content.rbs +20 -0
- data/sig/moderation_api/resources/queue/items.rbs +39 -0
- data/sig/moderation_api/resources/queue.rbs +20 -0
- data/sig/moderation_api/resources/wordlist/words.rbs +21 -0
- data/sig/moderation_api/resources/wordlist.rbs +33 -0
- data/sig/moderation_api/version.rbs +3 -0
- metadata +277 -302
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -87
- data/Rakefile +0 -10
- data/docs/AccountApi.md +0 -74
- data/docs/AccountGet200Response.md +0 -26
- data/docs/AccountGet200ResponseCurrentProject.md +0 -20
- data/docs/ActionsCreateRequest.md +0 -36
- data/docs/ActionsCreateRequestWebhooksInner.md +0 -24
- data/docs/ActionsDelete200Response.md +0 -20
- data/docs/ActionsExecute200Response.md +0 -22
- data/docs/ActionsExecuteDeprecatedRequest.md +0 -22
- data/docs/ActionsExecuteRequest.md +0 -24
- data/docs/ActionsGet200Response.md +0 -40
- data/docs/ActionsGet200ResponseWebhooksInner.md +0 -26
- data/docs/ActionsList200ResponseInner.md +0 -38
- data/docs/ActionsList200ResponseInnerPossibleValuesInner.md +0 -18
- data/docs/ActionsList400Response.md +0 -22
- data/docs/ActionsList400ResponseIssuesInner.md +0 -18
- data/docs/ActionsUpdateRequest.md +0 -36
- data/docs/ModerateApi.md +0 -357
- data/docs/ModerationAudioRequest.md +0 -28
- data/docs/ModerationImage200Response.md +0 -28
- data/docs/ModerationImage200ResponseLabelsInner.md +0 -20
- data/docs/ModerationImageRequest.md +0 -28
- data/docs/ModerationObject200Response.md +0 -36
- data/docs/ModerationObject200ResponseAllOfEntitiesInner.md +0 -22
- data/docs/ModerationObject200ResponseAllOfFieldsInner.md +0 -22
- data/docs/ModerationObject200ResponseAllOfLabelsInner.md +0 -22
- data/docs/ModerationObjectRequest.md +0 -28
- data/docs/ModerationObjectRequestValue.md +0 -20
- data/docs/ModerationObjectRequestValueDataValue.md +0 -22
- data/docs/ModerationText200Response.md +0 -64
- data/docs/ModerationText200ResponseAllOfAddress.md +0 -28
- data/docs/ModerationText200ResponseAllOfEmail.md +0 -28
- data/docs/ModerationText200ResponseAllOfName.md +0 -28
- data/docs/ModerationText200ResponseAllOfNsfw.md +0 -26
- data/docs/ModerationText200ResponseAllOfNsfwLabelScores.md +0 -22
- data/docs/ModerationText200ResponseAllOfPhone.md +0 -28
- data/docs/ModerationText200ResponseAllOfProfanity.md +0 -28
- data/docs/ModerationText200ResponseAllOfPropriety.md +0 -26
- data/docs/ModerationText200ResponseAllOfProprietyLabelScores.md +0 -22
- data/docs/ModerationText200ResponseAllOfQuality.md +0 -26
- data/docs/ModerationText200ResponseAllOfQualityLabelScores.md +0 -24
- data/docs/ModerationText200ResponseAllOfRequest.md +0 -20
- data/docs/ModerationText200ResponseAllOfSensitive.md +0 -28
- data/docs/ModerationText200ResponseAllOfSentiment.md +0 -26
- data/docs/ModerationText200ResponseAllOfSentimentLabelScores.md +0 -22
- data/docs/ModerationText200ResponseAllOfToxicity.md +0 -26
- data/docs/ModerationText200ResponseAllOfToxicityLabelScores.md +0 -30
- data/docs/ModerationText200ResponseAllOfUrl.md +0 -28
- data/docs/ModerationText200ResponseAllOfUsername.md +0 -28
- data/docs/ModerationText200ResponseAllOfWordlist.md +0 -28
- data/docs/ModerationText200ResponseAllOfWordlistsInner.md +0 -36
- data/docs/ModerationTextRequest.md +0 -28
- data/docs/ModerationVideo200Response.md +0 -24
- data/docs/ModerationVideoRequest.md +0 -28
- data/docs/QueueActionsApi.md +0 -503
- data/git_push.sh +0 -57
- data/lib/moderation_api/api/account_api.rb +0 -79
- data/lib/moderation_api/api/moderate_api.rb +0 -362
- data/lib/moderation_api/api/queue_actions_api.rb +0 -492
- data/lib/moderation_api/api_client.rb +0 -437
- data/lib/moderation_api/api_error.rb +0 -58
- data/lib/moderation_api/configuration.rb +0 -392
- data/lib/moderation_api/models/account_get200_response.rb +0 -278
- data/lib/moderation_api/models/account_get200_response_current_project.rb +0 -237
- data/lib/moderation_api/models/actions_create_request.rb +0 -374
- data/lib/moderation_api/models/actions_create_request_webhooks_inner.rb +0 -260
- data/lib/moderation_api/models/actions_delete200_response.rb +0 -239
- data/lib/moderation_api/models/actions_execute200_response.rb +0 -258
- data/lib/moderation_api/models/actions_execute_deprecated_request.rb +0 -244
- data/lib/moderation_api/models/actions_execute_request.rb +0 -261
- data/lib/moderation_api/models/actions_get200_response.rb +0 -408
- data/lib/moderation_api/models/actions_get200_response_webhooks_inner.rb +0 -278
- data/lib/moderation_api/models/actions_list200_response_inner.rb +0 -396
- data/lib/moderation_api/models/actions_list200_response_inner_possible_values_inner.rb +0 -222
- data/lib/moderation_api/models/actions_list400_response.rb +0 -248
- data/lib/moderation_api/models/actions_list400_response_issues_inner.rb +0 -221
- data/lib/moderation_api/models/actions_update_request.rb +0 -367
- data/lib/moderation_api/models/moderation_audio_request.rb +0 -302
- data/lib/moderation_api/models/moderation_image200_response.rb +0 -296
- data/lib/moderation_api/models/moderation_image200_response_labels_inner.rb +0 -301
- data/lib/moderation_api/models/moderation_image_request.rb +0 -302
- data/lib/moderation_api/models/moderation_object200_response.rb +0 -368
- data/lib/moderation_api/models/moderation_object200_response_all_of_entities_inner.rb +0 -251
- data/lib/moderation_api/models/moderation_object200_response_all_of_fields_inner.rb +0 -258
- data/lib/moderation_api/models/moderation_object200_response_all_of_labels_inner.rb +0 -284
- data/lib/moderation_api/models/moderation_object_request.rb +0 -301
- data/lib/moderation_api/models/moderation_object_request_value.rb +0 -275
- data/lib/moderation_api/models/moderation_object_request_value_data_value.rb +0 -285
- data/lib/moderation_api/models/moderation_text200_response.rb +0 -488
- data/lib/moderation_api/models/moderation_text200_response_all_of_address.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_email.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_name.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_nsfw.rb +0 -255
- data/lib/moderation_api/models/moderation_text200_response_all_of_nsfw_label_scores.rb +0 -235
- data/lib/moderation_api/models/moderation_text200_response_all_of_phone.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_profanity.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_propriety.rb +0 -255
- data/lib/moderation_api/models/moderation_text200_response_all_of_propriety_label_scores.rb +0 -235
- data/lib/moderation_api/models/moderation_text200_response_all_of_quality.rb +0 -255
- data/lib/moderation_api/models/moderation_text200_response_all_of_quality_label_scores.rb +0 -245
- data/lib/moderation_api/models/moderation_text200_response_all_of_request.rb +0 -240
- data/lib/moderation_api/models/moderation_text200_response_all_of_sensitive.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_sentiment.rb +0 -255
- data/lib/moderation_api/models/moderation_text200_response_all_of_sentiment_label_scores.rb +0 -235
- data/lib/moderation_api/models/moderation_text200_response_all_of_toxicity.rb +0 -262
- data/lib/moderation_api/models/moderation_text200_response_all_of_toxicity_label_scores.rb +0 -275
- data/lib/moderation_api/models/moderation_text200_response_all_of_url.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_username.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_wordlist.rb +0 -303
- data/lib/moderation_api/models/moderation_text200_response_all_of_wordlists_inner.rb +0 -377
- data/lib/moderation_api/models/moderation_text_request.rb +0 -330
- data/lib/moderation_api/models/moderation_video200_response.rb +0 -265
- data/lib/moderation_api/models/moderation_video_request.rb +0 -302
- data/lib/moderation_api/webhook.rb +0 -41
- data/moderation_api-1.2.0.gem +0 -0
- data/moderation_api-1.2.1.gem +0 -0
- data/moderation_api.gemspec +0 -45
- data/ruby_config.yaml +0 -30
- data/spec/api/account_api_spec.rb +0 -46
- data/spec/api/moderate_api_spec.rb +0 -95
- data/spec/api/queue_actions_api_spec.rb +0 -121
- data/spec/models/account_get200_response_current_project_spec.rb +0 -42
- data/spec/models/account_get200_response_spec.rb +0 -60
- data/spec/models/actions_create_request_spec.rb +0 -98
- data/spec/models/actions_create_request_webhooks_inner_spec.rb +0 -54
- data/spec/models/actions_delete200_response_spec.rb +0 -42
- data/spec/models/actions_execute200_response_spec.rb +0 -48
- data/spec/models/actions_execute_deprecated_request_spec.rb +0 -48
- data/spec/models/actions_execute_request_spec.rb +0 -54
- data/spec/models/actions_get200_response_spec.rb +0 -110
- data/spec/models/actions_get200_response_webhooks_inner_spec.rb +0 -60
- data/spec/models/actions_list200_response_inner_possible_values_inner_spec.rb +0 -36
- data/spec/models/actions_list200_response_inner_spec.rb +0 -104
- data/spec/models/actions_list400_response_issues_inner_spec.rb +0 -36
- data/spec/models/actions_list400_response_spec.rb +0 -48
- data/spec/models/actions_update_request_spec.rb +0 -98
- data/spec/models/moderation_audio_request_spec.rb +0 -66
- data/spec/models/moderation_image200_response_labels_inner_spec.rb +0 -46
- data/spec/models/moderation_image200_response_spec.rb +0 -66
- data/spec/models/moderation_image_request_spec.rb +0 -66
- data/spec/models/moderation_object200_response_all_of_entities_inner_spec.rb +0 -48
- data/spec/models/moderation_object200_response_all_of_fields_inner_spec.rb +0 -48
- data/spec/models/moderation_object200_response_all_of_labels_inner_spec.rb +0 -48
- data/spec/models/moderation_object200_response_spec.rb +0 -90
- data/spec/models/moderation_object_request_spec.rb +0 -66
- data/spec/models/moderation_object_request_value_data_value_spec.rb +0 -52
- data/spec/models/moderation_object_request_value_spec.rb +0 -46
- data/spec/models/moderation_text200_response_all_of_address_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_email_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_name_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_nsfw_label_scores_spec.rb +0 -48
- data/spec/models/moderation_text200_response_all_of_nsfw_spec.rb +0 -60
- data/spec/models/moderation_text200_response_all_of_phone_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_profanity_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_propriety_label_scores_spec.rb +0 -48
- data/spec/models/moderation_text200_response_all_of_propriety_spec.rb +0 -60
- data/spec/models/moderation_text200_response_all_of_quality_label_scores_spec.rb +0 -54
- data/spec/models/moderation_text200_response_all_of_quality_spec.rb +0 -60
- data/spec/models/moderation_text200_response_all_of_request_spec.rb +0 -42
- data/spec/models/moderation_text200_response_all_of_sensitive_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_sentiment_label_scores_spec.rb +0 -48
- data/spec/models/moderation_text200_response_all_of_sentiment_spec.rb +0 -60
- data/spec/models/moderation_text200_response_all_of_toxicity_label_scores_spec.rb +0 -72
- data/spec/models/moderation_text200_response_all_of_toxicity_spec.rb +0 -60
- data/spec/models/moderation_text200_response_all_of_url_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_username_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_wordlist_spec.rb +0 -70
- data/spec/models/moderation_text200_response_all_of_wordlists_inner_spec.rb +0 -94
- data/spec/models/moderation_text200_response_spec.rb +0 -174
- data/spec/models/moderation_text_request_spec.rb +0 -66
- data/spec/models/moderation_video200_response_spec.rb +0 -54
- data/spec/models/moderation_video_request_spec.rb +0 -66
- data/spec/spec_helper.rb +0 -111
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
class Client < ModerationAPI::Internal::Transport::BaseClient
|
|
3
|
+
DEFAULT_MAX_RETRIES: 2
|
|
4
|
+
|
|
5
|
+
DEFAULT_TIMEOUT_IN_SECONDS: Float
|
|
6
|
+
|
|
7
|
+
DEFAULT_INITIAL_RETRY_DELAY: Float
|
|
8
|
+
|
|
9
|
+
DEFAULT_MAX_RETRY_DELAY: Float
|
|
10
|
+
|
|
11
|
+
attr_reader secret_key: String
|
|
12
|
+
|
|
13
|
+
attr_reader authors: ModerationAPI::Resources::Authors
|
|
14
|
+
|
|
15
|
+
attr_reader queue: ModerationAPI::Resources::Queue
|
|
16
|
+
|
|
17
|
+
attr_reader actions: ModerationAPI::Resources::Actions
|
|
18
|
+
|
|
19
|
+
attr_reader content: ModerationAPI::Resources::Content
|
|
20
|
+
|
|
21
|
+
attr_reader account: ModerationAPI::Resources::Account
|
|
22
|
+
|
|
23
|
+
attr_reader auth: ModerationAPI::Resources::Auth
|
|
24
|
+
|
|
25
|
+
attr_reader wordlist: ModerationAPI::Resources::Wordlist
|
|
26
|
+
|
|
27
|
+
private def auth_headers: -> ::Hash[String, String]
|
|
28
|
+
|
|
29
|
+
def initialize: (
|
|
30
|
+
?secret_key: String?,
|
|
31
|
+
?base_url: String?,
|
|
32
|
+
?max_retries: Integer,
|
|
33
|
+
?timeout: Float,
|
|
34
|
+
?initial_retry_delay: Float,
|
|
35
|
+
?max_retry_delay: Float
|
|
36
|
+
) -> void
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Errors
|
|
3
|
+
class Error < StandardError
|
|
4
|
+
attr_accessor cause: StandardError?
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class ConversionError < ModerationAPI::Errors::Error
|
|
8
|
+
def cause: -> StandardError?
|
|
9
|
+
|
|
10
|
+
def initialize: (
|
|
11
|
+
on: Class,
|
|
12
|
+
method: Symbol,
|
|
13
|
+
target: top,
|
|
14
|
+
value: top,
|
|
15
|
+
?cause: StandardError?
|
|
16
|
+
) -> void
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class APIError < ModerationAPI::Errors::Error
|
|
20
|
+
attr_accessor url: URI::Generic
|
|
21
|
+
|
|
22
|
+
attr_accessor status: Integer?
|
|
23
|
+
|
|
24
|
+
attr_accessor headers: ::Hash[String, String]?
|
|
25
|
+
|
|
26
|
+
attr_accessor body: top?
|
|
27
|
+
|
|
28
|
+
def initialize: (
|
|
29
|
+
url: URI::Generic,
|
|
30
|
+
?status: Integer?,
|
|
31
|
+
?headers: ::Hash[String, String]?,
|
|
32
|
+
?body: Object?,
|
|
33
|
+
?request: nil,
|
|
34
|
+
?response: nil,
|
|
35
|
+
?message: String?
|
|
36
|
+
) -> void
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class APIConnectionError < ModerationAPI::Errors::APIError
|
|
40
|
+
def initialize: (
|
|
41
|
+
url: URI::Generic,
|
|
42
|
+
?status: nil,
|
|
43
|
+
?headers: ::Hash[String, String]?,
|
|
44
|
+
?body: nil,
|
|
45
|
+
?request: nil,
|
|
46
|
+
?response: nil,
|
|
47
|
+
?message: String?
|
|
48
|
+
) -> void
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class APITimeoutError < ModerationAPI::Errors::APIConnectionError
|
|
52
|
+
def initialize: (
|
|
53
|
+
url: URI::Generic,
|
|
54
|
+
?status: nil,
|
|
55
|
+
?headers: ::Hash[String, String]?,
|
|
56
|
+
?body: nil,
|
|
57
|
+
?request: nil,
|
|
58
|
+
?response: nil,
|
|
59
|
+
?message: String?
|
|
60
|
+
) -> void
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class APIStatusError < ModerationAPI::Errors::APIError
|
|
64
|
+
def self.for: (
|
|
65
|
+
url: URI::Generic,
|
|
66
|
+
status: Integer,
|
|
67
|
+
headers: ::Hash[String, String]?,
|
|
68
|
+
body: Object?,
|
|
69
|
+
request: nil,
|
|
70
|
+
response: nil,
|
|
71
|
+
?message: String?
|
|
72
|
+
) -> instance
|
|
73
|
+
|
|
74
|
+
def initialize: (
|
|
75
|
+
url: URI::Generic,
|
|
76
|
+
status: Integer,
|
|
77
|
+
headers: ::Hash[String, String]?,
|
|
78
|
+
body: Object?,
|
|
79
|
+
request: nil,
|
|
80
|
+
response: nil,
|
|
81
|
+
?message: String?
|
|
82
|
+
) -> void
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class BadRequestError < ModerationAPI::Errors::APIStatusError
|
|
86
|
+
HTTP_STATUS: 400
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class AuthenticationError < ModerationAPI::Errors::APIStatusError
|
|
90
|
+
HTTP_STATUS: 401
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
class PermissionDeniedError < ModerationAPI::Errors::APIStatusError
|
|
94
|
+
HTTP_STATUS: 403
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
class NotFoundError < ModerationAPI::Errors::APIStatusError
|
|
98
|
+
HTTP_STATUS: 404
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
class ConflictError < ModerationAPI::Errors::APIStatusError
|
|
102
|
+
HTTP_STATUS: 409
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class UnprocessableEntityError < ModerationAPI::Errors::APIStatusError
|
|
106
|
+
HTTP_STATUS: 422
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
class RateLimitError < ModerationAPI::Errors::APIStatusError
|
|
110
|
+
HTTP_STATUS: 429
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class InternalServerError < ModerationAPI::Errors::APIStatusError
|
|
114
|
+
HTTP_STATUS: Range[Integer]
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
class FilePart
|
|
3
|
+
attr_reader content: Pathname | StringIO | IO | String
|
|
4
|
+
|
|
5
|
+
attr_reader content_type: String?
|
|
6
|
+
|
|
7
|
+
attr_reader filename: String?
|
|
8
|
+
|
|
9
|
+
private def read: -> String
|
|
10
|
+
|
|
11
|
+
def to_json: (*top a) -> String
|
|
12
|
+
|
|
13
|
+
def to_yaml: (*top a) -> String
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
Pathname | StringIO | IO | String content,
|
|
17
|
+
?filename: (Pathname | String)?,
|
|
18
|
+
?content_type: String?
|
|
19
|
+
) -> void
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Transport
|
|
4
|
+
class BaseClient
|
|
5
|
+
extend ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type request_components =
|
|
8
|
+
{
|
|
9
|
+
method: Symbol,
|
|
10
|
+
path: String | ::Array[String],
|
|
11
|
+
query: ::Hash[String, (::Array[String] | String)?]?,
|
|
12
|
+
headers: ::Hash[String, (String
|
|
13
|
+
| Integer
|
|
14
|
+
| ::Array[(String | Integer)?])?]?,
|
|
15
|
+
body: top?,
|
|
16
|
+
unwrap: (Symbol
|
|
17
|
+
| Integer
|
|
18
|
+
| ::Array[(Symbol | Integer)]
|
|
19
|
+
| (^(top arg0) -> top))?,
|
|
20
|
+
page: Class?,
|
|
21
|
+
stream: Class?,
|
|
22
|
+
model: ModerationAPI::Internal::Type::Converter::input?,
|
|
23
|
+
options: ModerationAPI::request_opts?
|
|
24
|
+
}
|
|
25
|
+
type request_input =
|
|
26
|
+
{
|
|
27
|
+
method: Symbol,
|
|
28
|
+
url: URI::Generic,
|
|
29
|
+
headers: ::Hash[String, String],
|
|
30
|
+
body: top,
|
|
31
|
+
max_retries: Integer,
|
|
32
|
+
timeout: Float
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
MAX_REDIRECTS: 20
|
|
36
|
+
|
|
37
|
+
PLATFORM_HEADERS: ::Hash[String, String]
|
|
38
|
+
|
|
39
|
+
def self.validate!: (
|
|
40
|
+
ModerationAPI::Internal::Transport::BaseClient::request_components req
|
|
41
|
+
) -> void
|
|
42
|
+
|
|
43
|
+
def self.should_retry?: (
|
|
44
|
+
Integer status,
|
|
45
|
+
headers: ::Hash[String, String]
|
|
46
|
+
) -> bool
|
|
47
|
+
|
|
48
|
+
def self.follow_redirect: (
|
|
49
|
+
ModerationAPI::Internal::Transport::BaseClient::request_input request,
|
|
50
|
+
status: Integer,
|
|
51
|
+
response_headers: ::Hash[String, String]
|
|
52
|
+
) -> ModerationAPI::Internal::Transport::BaseClient::request_input
|
|
53
|
+
|
|
54
|
+
def self.reap_connection!: (
|
|
55
|
+
Integer | ModerationAPI::Errors::APIConnectionError status,
|
|
56
|
+
stream: Enumerable[String]?
|
|
57
|
+
) -> void
|
|
58
|
+
|
|
59
|
+
attr_reader base_url: URI::Generic
|
|
60
|
+
|
|
61
|
+
attr_reader timeout: Float
|
|
62
|
+
|
|
63
|
+
attr_reader max_retries: Integer
|
|
64
|
+
|
|
65
|
+
attr_reader initial_retry_delay: Float
|
|
66
|
+
|
|
67
|
+
attr_reader max_retry_delay: Float
|
|
68
|
+
|
|
69
|
+
attr_reader headers: ::Hash[String, String]
|
|
70
|
+
|
|
71
|
+
attr_reader idempotency_header: String?
|
|
72
|
+
|
|
73
|
+
# @api private
|
|
74
|
+
attr_reader requester: ModerationAPI::Internal::Transport::PooledNetRequester
|
|
75
|
+
|
|
76
|
+
def initialize: (
|
|
77
|
+
base_url: String,
|
|
78
|
+
?timeout: Float,
|
|
79
|
+
?max_retries: Integer,
|
|
80
|
+
?initial_retry_delay: Float,
|
|
81
|
+
?max_retry_delay: Float,
|
|
82
|
+
?headers: ::Hash[String, (String
|
|
83
|
+
| Integer
|
|
84
|
+
| ::Array[(String | Integer)?])?],
|
|
85
|
+
?idempotency_header: String?
|
|
86
|
+
) -> void
|
|
87
|
+
|
|
88
|
+
private def auth_headers: -> ::Hash[String, String]
|
|
89
|
+
|
|
90
|
+
private def user_agent: -> String
|
|
91
|
+
|
|
92
|
+
private def generate_idempotency_key: -> String
|
|
93
|
+
|
|
94
|
+
private def build_request: (
|
|
95
|
+
ModerationAPI::Internal::Transport::BaseClient::request_components req,
|
|
96
|
+
ModerationAPI::request_options opts
|
|
97
|
+
) -> ModerationAPI::Internal::Transport::BaseClient::request_input
|
|
98
|
+
|
|
99
|
+
private def retry_delay: (
|
|
100
|
+
::Hash[String, String] headers,
|
|
101
|
+
retry_count: Integer
|
|
102
|
+
) -> Float
|
|
103
|
+
|
|
104
|
+
def send_request: (
|
|
105
|
+
ModerationAPI::Internal::Transport::BaseClient::request_input request,
|
|
106
|
+
redirect_count: Integer,
|
|
107
|
+
retry_count: Integer,
|
|
108
|
+
send_retry_header: bool
|
|
109
|
+
) -> [Integer, top, Enumerable[String]]
|
|
110
|
+
|
|
111
|
+
def request: (
|
|
112
|
+
Symbol method,
|
|
113
|
+
String | ::Array[String] path,
|
|
114
|
+
?query: ::Hash[String, (::Array[String] | String)?]?,
|
|
115
|
+
?headers: ::Hash[String, (String
|
|
116
|
+
| Integer
|
|
117
|
+
| ::Array[(String | Integer)?])?]?,
|
|
118
|
+
?body: top?,
|
|
119
|
+
?unwrap: (Symbol
|
|
120
|
+
| Integer
|
|
121
|
+
| ::Array[(Symbol | Integer)]
|
|
122
|
+
| (^(top arg0) -> top))?,
|
|
123
|
+
?page: Class?,
|
|
124
|
+
?stream: Class?,
|
|
125
|
+
?model: ModerationAPI::Internal::Type::Converter::input?,
|
|
126
|
+
?options: ModerationAPI::request_opts?
|
|
127
|
+
) -> top
|
|
128
|
+
|
|
129
|
+
def inspect: -> String
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Transport
|
|
4
|
+
class PooledNetRequester
|
|
5
|
+
extend ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type request =
|
|
8
|
+
{
|
|
9
|
+
method: Symbol,
|
|
10
|
+
url: URI::Generic,
|
|
11
|
+
headers: ::Hash[String, String],
|
|
12
|
+
body: top,
|
|
13
|
+
deadline: Float
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
KEEP_ALIVE_TIMEOUT: 30
|
|
17
|
+
|
|
18
|
+
DEFAULT_MAX_CONNECTIONS: Integer
|
|
19
|
+
|
|
20
|
+
def self.connect: (
|
|
21
|
+
cert_store: OpenSSL::X509::Store,
|
|
22
|
+
url: URI::Generic
|
|
23
|
+
) -> top
|
|
24
|
+
|
|
25
|
+
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
|
26
|
+
|
|
27
|
+
def self.build_request: (
|
|
28
|
+
ModerationAPI::Internal::Transport::PooledNetRequester::request request
|
|
29
|
+
) {
|
|
30
|
+
(String arg0) -> void
|
|
31
|
+
} -> [top, (^-> void)]
|
|
32
|
+
|
|
33
|
+
private def with_pool: (
|
|
34
|
+
URI::Generic url,
|
|
35
|
+
deadline: Float
|
|
36
|
+
) {
|
|
37
|
+
(top arg0) -> void
|
|
38
|
+
} -> void
|
|
39
|
+
|
|
40
|
+
def execute: (
|
|
41
|
+
ModerationAPI::Internal::Transport::PooledNetRequester::request request
|
|
42
|
+
) -> [Integer, top, Enumerable[String]]
|
|
43
|
+
|
|
44
|
+
def initialize: (?size: Integer) -> void
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class ArrayOf[Elem]
|
|
5
|
+
include ModerationAPI::Internal::Type::Converter
|
|
6
|
+
include ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.[]: (
|
|
9
|
+
::Hash[Symbol, top]
|
|
10
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
11
|
+
| ModerationAPI::Internal::Type::Converter::input type_info,
|
|
12
|
+
?::Hash[Symbol, top] spec
|
|
13
|
+
) -> instance
|
|
14
|
+
|
|
15
|
+
def ===: (top other) -> bool
|
|
16
|
+
|
|
17
|
+
def ==: (top other) -> bool
|
|
18
|
+
|
|
19
|
+
def hash: -> Integer
|
|
20
|
+
|
|
21
|
+
def coerce: (
|
|
22
|
+
::Array[top] | top value,
|
|
23
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
24
|
+
) -> (::Array[top] | top)
|
|
25
|
+
|
|
26
|
+
def dump: (
|
|
27
|
+
::Array[top] | top value,
|
|
28
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
29
|
+
) -> (::Array[top] | top)
|
|
30
|
+
|
|
31
|
+
def to_sorbet_type: -> top
|
|
32
|
+
|
|
33
|
+
def item_type: -> Elem
|
|
34
|
+
|
|
35
|
+
def nilable?: -> bool
|
|
36
|
+
|
|
37
|
+
def initialize: (
|
|
38
|
+
::Hash[Symbol, top]
|
|
39
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
40
|
+
| ModerationAPI::Internal::Type::Converter::input type_info,
|
|
41
|
+
?::Hash[Symbol, top] spec
|
|
42
|
+
) -> void
|
|
43
|
+
|
|
44
|
+
def inspect: (?depth: Integer) -> String
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class BaseModel
|
|
5
|
+
extend ModerationAPI::Internal::Type::Converter
|
|
6
|
+
extend ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
type known_field =
|
|
9
|
+
{ mode: (:coerce | :dump)?, required: bool, nilable: bool }
|
|
10
|
+
|
|
11
|
+
def self.inherited: (self child) -> void
|
|
12
|
+
|
|
13
|
+
def self.known_fields: -> ::Hash[Symbol, (ModerationAPI::Internal::Type::BaseModel::known_field
|
|
14
|
+
& { type_fn: (^-> ModerationAPI::Internal::Type::Converter::input) })]
|
|
15
|
+
|
|
16
|
+
def self.fields: -> ::Hash[Symbol, (ModerationAPI::Internal::Type::BaseModel::known_field
|
|
17
|
+
& { type: ModerationAPI::Internal::Type::Converter::input })]
|
|
18
|
+
|
|
19
|
+
private def self.add_field: (
|
|
20
|
+
Symbol name_sym,
|
|
21
|
+
required: bool,
|
|
22
|
+
type_info: {
|
|
23
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
24
|
+
enum: ^-> ModerationAPI::Internal::Type::Converter::input?,
|
|
25
|
+
union: ^-> ModerationAPI::Internal::Type::Converter::input?,
|
|
26
|
+
api_name: Symbol
|
|
27
|
+
}
|
|
28
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
29
|
+
| ModerationAPI::Internal::Type::Converter::input,
|
|
30
|
+
spec: ::Hash[Symbol, top]
|
|
31
|
+
) -> void
|
|
32
|
+
|
|
33
|
+
def self.required: (
|
|
34
|
+
Symbol name_sym,
|
|
35
|
+
::Hash[Symbol, top]
|
|
36
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
37
|
+
| ModerationAPI::Internal::Type::Converter::input type_info,
|
|
38
|
+
?::Hash[Symbol, top] spec
|
|
39
|
+
) -> void
|
|
40
|
+
|
|
41
|
+
def self.optional: (
|
|
42
|
+
Symbol name_sym,
|
|
43
|
+
::Hash[Symbol, top]
|
|
44
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
45
|
+
| ModerationAPI::Internal::Type::Converter::input type_info,
|
|
46
|
+
?::Hash[Symbol, top] spec
|
|
47
|
+
) -> void
|
|
48
|
+
|
|
49
|
+
private def self.request_only: { -> void } -> void
|
|
50
|
+
|
|
51
|
+
private def self.response_only: { -> void } -> void
|
|
52
|
+
|
|
53
|
+
def self.==: (top other) -> bool
|
|
54
|
+
|
|
55
|
+
def self.hash: -> Integer
|
|
56
|
+
|
|
57
|
+
def ==: (top other) -> bool
|
|
58
|
+
|
|
59
|
+
def hash: -> Integer
|
|
60
|
+
|
|
61
|
+
def self.coerce: (
|
|
62
|
+
ModerationAPI::Internal::Type::BaseModel
|
|
63
|
+
| ::Hash[top, top]
|
|
64
|
+
| top value,
|
|
65
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
66
|
+
) -> (instance | top)
|
|
67
|
+
|
|
68
|
+
def self.dump: (
|
|
69
|
+
instance | top value,
|
|
70
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
71
|
+
) -> (::Hash[top, top] | top)
|
|
72
|
+
|
|
73
|
+
def self.to_sorbet_type: -> top
|
|
74
|
+
|
|
75
|
+
def self.recursively_to_h: (
|
|
76
|
+
ModerationAPI::Internal::Type::BaseModel model,
|
|
77
|
+
convert: bool
|
|
78
|
+
) -> ::Hash[Symbol, top]
|
|
79
|
+
|
|
80
|
+
def []: (Symbol key) -> top?
|
|
81
|
+
|
|
82
|
+
def to_h: -> ::Hash[Symbol, top]
|
|
83
|
+
|
|
84
|
+
alias to_hash to_h
|
|
85
|
+
|
|
86
|
+
def deep_to_h: -> ::Hash[Symbol, top]
|
|
87
|
+
|
|
88
|
+
def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
|
|
89
|
+
|
|
90
|
+
def to_json: (*top a) -> String
|
|
91
|
+
|
|
92
|
+
def to_yaml: (*top a) -> String
|
|
93
|
+
|
|
94
|
+
def initialize: (?::Hash[Symbol, top] | instance data) -> void
|
|
95
|
+
|
|
96
|
+
def self.inspect: (?depth: Integer) -> String
|
|
97
|
+
|
|
98
|
+
def to_s: -> String
|
|
99
|
+
|
|
100
|
+
def inspect: -> String
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module BasePage[Elem]
|
|
5
|
+
def next_page?: -> bool
|
|
6
|
+
|
|
7
|
+
def next_page: -> instance
|
|
8
|
+
|
|
9
|
+
def auto_paging_each: { (Elem arg0) -> void } -> void
|
|
10
|
+
|
|
11
|
+
def to_enum: -> Enumerable[Elem]
|
|
12
|
+
|
|
13
|
+
alias enum_for to_enum
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
client: ModerationAPI::Internal::Transport::BaseClient,
|
|
17
|
+
req: ModerationAPI::Internal::Transport::BaseClient::request_components,
|
|
18
|
+
headers: ::Hash[String, String],
|
|
19
|
+
page_data: top
|
|
20
|
+
) -> void
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class Boolean
|
|
5
|
+
extend ModerationAPI::Internal::Type::Converter
|
|
6
|
+
extend ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.===: (top other) -> bool
|
|
9
|
+
|
|
10
|
+
def self.==: (top other) -> bool
|
|
11
|
+
|
|
12
|
+
def self.coerce: (
|
|
13
|
+
bool | top value,
|
|
14
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
15
|
+
) -> (bool | top)
|
|
16
|
+
|
|
17
|
+
def self.dump: (
|
|
18
|
+
bool | top value,
|
|
19
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
20
|
+
) -> (bool | top)
|
|
21
|
+
|
|
22
|
+
def self.to_sorbet_type: -> top
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module Converter
|
|
5
|
+
extend ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
type input = ModerationAPI::Internal::Type::Converter | Class
|
|
8
|
+
|
|
9
|
+
type coerce_state =
|
|
10
|
+
{
|
|
11
|
+
translate_names: bool,
|
|
12
|
+
strictness: bool,
|
|
13
|
+
exactness: { yes: Integer, no: Integer, maybe: Integer },
|
|
14
|
+
error: Class,
|
|
15
|
+
branched: Integer
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type dump_state = { can_retry: bool }
|
|
19
|
+
|
|
20
|
+
def coerce: (
|
|
21
|
+
top value,
|
|
22
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
23
|
+
) -> top
|
|
24
|
+
|
|
25
|
+
def dump: (
|
|
26
|
+
top value,
|
|
27
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
28
|
+
) -> top
|
|
29
|
+
|
|
30
|
+
def inspect: (?depth: Integer) -> String
|
|
31
|
+
|
|
32
|
+
def self.type_info: (
|
|
33
|
+
{
|
|
34
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
35
|
+
enum: ^-> ModerationAPI::Internal::Type::Converter::input?,
|
|
36
|
+
union: ^-> ModerationAPI::Internal::Type::Converter::input?
|
|
37
|
+
}
|
|
38
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
39
|
+
| ModerationAPI::Internal::Type::Converter::input spec
|
|
40
|
+
) -> (^-> top)
|
|
41
|
+
|
|
42
|
+
def self.meta_info: (
|
|
43
|
+
{
|
|
44
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
45
|
+
enum: ^-> ModerationAPI::Internal::Type::Converter::input?,
|
|
46
|
+
union: ^-> ModerationAPI::Internal::Type::Converter::input?
|
|
47
|
+
}
|
|
48
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
49
|
+
| ModerationAPI::Internal::Type::Converter::input type_info,
|
|
50
|
+
{
|
|
51
|
+
const: (nil | bool | Integer | Float | Symbol)?,
|
|
52
|
+
enum: ^-> ModerationAPI::Internal::Type::Converter::input?,
|
|
53
|
+
union: ^-> ModerationAPI::Internal::Type::Converter::input?
|
|
54
|
+
}
|
|
55
|
+
| ^-> ModerationAPI::Internal::Type::Converter::input
|
|
56
|
+
| ModerationAPI::Internal::Type::Converter::input spec
|
|
57
|
+
) -> ::Hash[Symbol, top]
|
|
58
|
+
|
|
59
|
+
def self.new_coerce_state: (
|
|
60
|
+
?translate_names: bool
|
|
61
|
+
) -> ModerationAPI::Internal::Type::Converter::coerce_state
|
|
62
|
+
|
|
63
|
+
def self.coerce: (
|
|
64
|
+
ModerationAPI::Internal::Type::Converter::input target,
|
|
65
|
+
top value,
|
|
66
|
+
?state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
67
|
+
) -> top
|
|
68
|
+
|
|
69
|
+
def self.dump: (
|
|
70
|
+
ModerationAPI::Internal::Type::Converter::input target,
|
|
71
|
+
top value,
|
|
72
|
+
?state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
73
|
+
) -> top
|
|
74
|
+
|
|
75
|
+
def self.inspect: (top target, depth: Integer) -> String
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
module Enum
|
|
5
|
+
include ModerationAPI::Internal::Type::Converter
|
|
6
|
+
include ModerationAPI::Internal::Util::SorbetRuntimeSupport
|
|
7
|
+
|
|
8
|
+
def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
|
|
9
|
+
|
|
10
|
+
def ===: (top other) -> bool
|
|
11
|
+
|
|
12
|
+
def ==: (top other) -> bool
|
|
13
|
+
|
|
14
|
+
def hash: -> Integer
|
|
15
|
+
|
|
16
|
+
def coerce: (
|
|
17
|
+
String | Symbol | top value,
|
|
18
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
19
|
+
) -> (Symbol | top)
|
|
20
|
+
|
|
21
|
+
def dump: (
|
|
22
|
+
Symbol | top value,
|
|
23
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
24
|
+
) -> (Symbol | top)
|
|
25
|
+
|
|
26
|
+
def to_sorbet_type: -> top
|
|
27
|
+
|
|
28
|
+
def inspect: (?depth: Integer) -> String
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module ModerationAPI
|
|
2
|
+
module Internal
|
|
3
|
+
module Type
|
|
4
|
+
class FileInput
|
|
5
|
+
extend ModerationAPI::Internal::Type::Converter
|
|
6
|
+
|
|
7
|
+
def self.===: (top other) -> bool
|
|
8
|
+
|
|
9
|
+
def self.==: (top other) -> bool
|
|
10
|
+
|
|
11
|
+
def self.coerce: (
|
|
12
|
+
StringIO | String | top value,
|
|
13
|
+
state: ModerationAPI::Internal::Type::Converter::coerce_state
|
|
14
|
+
) -> (StringIO | top)
|
|
15
|
+
|
|
16
|
+
def self.dump: (
|
|
17
|
+
Pathname | StringIO | IO | String | top value,
|
|
18
|
+
state: ModerationAPI::Internal::Type::Converter::dump_state
|
|
19
|
+
) -> (Pathname | StringIO | IO | String | top)
|
|
20
|
+
|
|
21
|
+
def self.to_sorbet_type: -> top
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|